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, lightweight=False):
25
def cbranch(from_location, to_location=None, revision=None,
26
27
from_location = from_location.rstrip('/')
28
29
to_location = pathjoin(getcwd(), basename(from_location))
29
30
config = LocationConfig(abspath(to_location))
34
38
cmd_branch().run(from_location, b_loc, revision=revision)
35
39
cmd_checkout().run(b_loc, to_location, lightweight=lightweight)
36
40
b = Branch.open(to_location)