75
75
assert isinstance(to_location, basestring)
76
76
if basis_branch is not None:
77
77
note("basis_branch is not supported for fast weave copy yet.")
78
if not (branch_from.weave_store.listable()
79
and branch_from.revision_store.listable()):
80
return copy_branch_slower(branch_from, to_location, revision,
82
history = _get_truncated_history(branch_from, revision)
83
if not bzrlib.osutils.lexists(to_location):
85
branch_to = Branch.initialize(to_location)
86
mutter("copy branch from %s to %s", branch_from, branch_to)
87
branch_to.set_root_id(branch_from.get_root_id())
88
branch_to.append_revision(*history)
89
_copy_control_weaves(branch_from, branch_to)
90
_copy_text_weaves(branch_from, branch_to)
91
_copy_revision_store(branch_from, branch_to)
92
build_working_dir(to_location)
93
branch_to.set_parent(branch_from.base)
78
branch_from.lock_read()
80
if not (branch_from.weave_store.listable()
81
and branch_from.revision_store.listable()):
82
return copy_branch_slower(branch_from, to_location, revision,
84
history = _get_truncated_history(branch_from, revision)
85
if not bzrlib.osutils.lexists(to_location):
87
branch_to = Branch.initialize(to_location)
88
mutter("copy branch from %s to %s", branch_from, branch_to)
89
branch_to.set_root_id(branch_from.get_root_id())
90
branch_to.append_revision(*history)
91
_copy_control_weaves(branch_from, branch_to)
92
_copy_text_weaves(branch_from, branch_to)
93
_copy_revision_store(branch_from, branch_to)
94
build_working_dir(to_location)
95
branch_to.set_parent(branch_from.base)
98
102
def _get_truncated_history(branch_from, revision):