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, getcwd
23
def cbranch(from_location, to_location=None, revision=None, lightweight=False):
24
24
config = LocationConfig(abspath(to_location))
25
25
b_root = config.get_user_option("cbranch_root")
27
27
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)