42
42
"""Pull deltas from another branch.
44
44
:note: This does not, like pull, retain the revision ids from
45
the source branch and will, rather than adding bzr-specific metadata,
46
push only those semantics of the revision that can be natively
47
represented in this branch.
45
the source branch and will, rather than adding bzr-specific
46
metadata, push only those semantics of the revision that can be
47
natively represented in this branch.
49
49
:param source: Source branch
50
50
:param stop_revision: Revision to pull, defaults to last revision.
51
:return: Revision id map and file id map
52
53
raise NotImplementedError(self.dpull)
113
115
bzrdir = BzrDir.open(location)
114
116
target_branch = bzrdir.open_branch()
115
117
target_branch.lock_write()
116
if not isinstance(target_branch, ForeignBranch):
117
info("target branch is not a foreign branch, using regular push.")
118
target_branch.pull(source_branch)
121
revid_map = target_branch.dpull(source_branch)
122
# We successfully created the target, remember it
123
if source_branch.get_push_location() is None or remember:
124
source_branch.set_push_location(target_branch.base)
126
_, old_last_revid = source_branch.last_revision_info()
127
new_last_revid = revid_map[old_last_revid]
128
if source_wt is not None:
129
source_wt.pull(target_branch, overwrite=True,
130
stop_revision=new_last_revid)
119
if not isinstance(target_branch, ForeignBranch):
120
info("target branch is not a foreign branch, using regular push.")
121
target_branch.pull(source_branch)
132
source_branch.pull(target_branch, overwrite=True,
124
revid_map = target_branch.dpull(source_branch)
125
# We successfully created the target, remember it
126
if source_branch.get_push_location() is None or remember:
127
source_branch.set_push_location(target_branch.base)
129
_, old_last_revid = source_branch.last_revision_info()
130
new_last_revid = revid_map[old_last_revid]
131
if source_wt is not None:
132
source_wt.pull(target_branch, overwrite=True,
133
133
stop_revision=new_last_revid)
134
source_wt.lock_write()
136
update_workingtree_fileids(source_wt,
137
source_wt.branch.repository.revision_tree(old_last_revid),
138
source_wt.branch.repository.revision_tree(new_last_revid))
142
source_branch.pull(target_branch, overwrite=True,
143
stop_revision=new_last_revid)
145
target_branch.unlock()
135
147
def test_suite():
136
148
from unittest import TestSuite