145
145
stop_revision = source.last_revision()
146
146
# FIXME: Check for diverged branches
147
147
revidmap = self.repository.dfetch(source.repository, stop_revision)
148
self.generate_revision_history(revidmap[stop_revision])
149
self.generate_revision_history(revidmap[stop_revision])
151
152
def generate_revision_history(self, revid, old_revid=None):
295
296
prev_last_revid = self.target.last_revision()
296
297
self.target.generate_revision_history(self._last_revid, prev_last_revid)
299
def pull(self, overwrite=False, stop_revision=None,
300
possible_transports=None, _hook_master=None, run_hooks=True,
301
_override_hook_target=None):
304
:param _hook_master: Private parameter - set the branch to
305
be supplied as the master to pull hooks.
306
:param run_hooks: Private parameter - if false, this branch
307
is being called because it's the master of the primary branch,
308
so it should not run its hooks.
309
:param _override_hook_target: Private parameter - set the branch to be
310
supplied as the target_branch to pull hooks.
312
result = branch.PullResult()
313
result.source_branch = self.source
314
if _override_hook_target is None:
315
result.target_branch = self.target
317
result.target_branch = _override_hook_target
318
self.source.lock_read()
320
# We assume that during 'pull' the target repository is closer than
322
graph = self.target.repository.get_graph(self.source.repository)
323
result.old_revno, result.old_revid = \
324
self.target.last_revision_info()
325
self.target.update_revisions(self.source, stop_revision,
326
overwrite=overwrite, graph=graph)
327
result.tag_conflicts = self.source.tags.merge_to(self.target.tags,
329
result.new_revno, result.new_revid = self.target.last_revision_info()
331
result.master_branch = _hook_master
332
result.local_branch = result.target_branch
334
result.master_branch = result.target_branch
335
result.local_branch = None
337
for hook in branch.Branch.hooks['post_pull']:
299
346
branch.InterBranch.register_optimiser(InterGitGenericBranch)