~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to cbranch.py

  • Committer: Aaron Bentley
  • Date: 2006-03-29 06:43:34 UTC
  • mfrom: (355.1.3 bzrtools)
  • Revision ID: aaron.bentley@utoronto.ca-20060329064334-62e56b84dedf3f8d
Merge combined work

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from bzrlib.builtins import cmd_branch, cmd_checkout
19
19
from bzrlib.config import LocationConfig
20
20
from bzrlib.errors import BzrCommandError
21
 
from bzrlib.osutils import pathjoin, basename, abspath
 
21
from bzrlib.osutils import pathjoin, basename, abspath, getcwd
22
22
 
23
 
def cbranch(from_location, to_location, revision=None):
 
23
def cbranch(from_location, to_location=None, revision=None, lightweight=False):
 
24
    if to_location is None:
 
25
        to_location = pathjoin(getcwd(), basename(to_location))
24
26
    config = LocationConfig(abspath(to_location))
25
27
    b_root = config.get_user_option("cbranch_root")
26
28
    if b_root is None:
27
29
        raise BzrCommandError("Can't find cbranch_root in branches.conf")
28
30
    b_loc = pathjoin(b_root, basename(to_location))
29
31
    cmd_branch().run(from_location, b_loc, revision=revision)
30
 
    cmd_checkout().run(b_loc, to_location, lightweight=True)
 
32
    cmd_checkout().run(b_loc, to_location, lightweight=lightweight)