Rev 3451: Start using the 'graph' parameter of update_revisions to bias push and pull checking in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/graph_find_distance_to_null

John Arbash Meinel john at arbash-meinel.com
Fri May 23 00:05:52 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/graph_find_distance_to_null

------------------------------------------------------------
revno: 3451
revision-id: john at arbash-meinel.com-20080522230502-dpz32ohckuidvwyw
parent: john at arbash-meinel.com-20080522225634-bl5qfq1caf119hr2
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: graph_find_distance_to_null
timestamp: Thu 2008-05-22 18:05:02 -0500
message:
  Start using the 'graph' parameter of update_revisions to bias push and pull checking
modified:
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2008-05-22 22:56:34 +0000
+++ b/bzrlib/branch.py	2008-05-22 23:05:02 +0000
@@ -1567,8 +1567,12 @@
         result.target_branch = self
         source.lock_read()
         try:
+            # We assume that during 'pull' the local repository is closer than
+            # the remote one.
+            graph = self.repository.get_graph(source.repository)
             result.old_revno, result.old_revid = self.last_revision_info()
-            self.update_revisions(source, stop_revision, overwrite=overwrite)
+            self.update_revisions(source, stop_revision, overwrite=overwrite,
+                                  graph=graph)
             result.tag_conflicts = source.tags.merge_to(self.tags, overwrite)
             result.new_revno, result.new_revid = self.last_revision_info()
             if _hook_master:
@@ -1671,13 +1675,10 @@
         result.source_branch = self
         result.target_branch = target
         result.old_revno, result.old_revid = target.last_revision_info()
-        try:
-            target.update_revisions(self, stop_revision)
-        except errors.DivergedBranches:
-            if not overwrite:
-                raise
-        if overwrite:
-            target.set_revision_history(self.revision_history())
+
+        graph = self.repository.get_graph(target.repository)
+        target.update_revisions(self, stop_revision, overwrite=overwrite,
+                                graph=graph)
         result.tag_conflicts = self.tags.merge_to(target.tags, overwrite)
         result.new_revno, result.new_revid = target.last_revision_info()
         return result



More information about the bazaar-commits mailing list