22
22
from bzrlib.osutils import pathjoin, basename, abspath, getcwd
23
23
from bzrlib.urlutils import local_path_to_url
25
def cbranch(from_location, to_location=None, revision=None,
25
def cbranch(from_location, to_location=None, revision=None, lightweight=False):
27
26
from_location = from_location.rstrip('/')
29
28
to_location = pathjoin(getcwd(), basename(from_location))
30
29
config = LocationConfig(abspath(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)