~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to cbranch.py

  • Committer: Aaron Bentley
  • Date: 2006-12-12 02:21:50 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20061212022150-7lqyw46pbb3jhkak
Clean up patch command (support http urls again)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib.osutils import pathjoin, basename, abspath, getcwd
23
23
from bzrlib.urlutils import local_path_to_url
24
24
 
25
 
def cbranch(from_location, to_location=None, revision=None,
26
 
            lightweight=False):
 
25
def cbranch(from_location, to_location=None, revision=None, lightweight=False):
27
26
    from_location = from_location.rstrip('/')
28
27
    if to_location is None:
29
28
        to_location = pathjoin(getcwd(), basename(from_location))
30
29
    config = LocationConfig(abspath(to_location))
31
 
    b_loc = config.get_user_option("cbranch_target")
32
 
    if b_loc is None:
33
 
        b_root = config.get_user_option("cbranch_root")
34
 
        if b_root is None:
35
 
            raise BzrCommandError("Can't find cbranch_target in"
36
 
                                  " locations.conf")
37
 
        b_loc = pathjoin(b_root, basename(to_location))
 
30
    b_root = config.get_user_option("cbranch_root")
 
31
    if b_root is None:
 
32
        raise BzrCommandError("Can't find cbranch_root in branches.conf")
 
33
    b_loc = pathjoin(b_root, basename(to_location))
38
34
    cmd_branch().run(from_location, b_loc, revision=revision)
39
35
    cmd_checkout().run(b_loc, to_location, lightweight=lightweight)
40
36
    b = Branch.open(to_location)