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
26
config = LocationConfig(abspath(to_location))
25
27
b_root = config.get_user_option("cbranch_root")
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)