Rev 2404: We don't need to extract ancestry_b until we after we've checked for existence. in http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/shortcut-common-ancestor

John Arbash Meinel john at arbash-meinel.com
Tue Apr 10 19:30:51 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/shortcut-common-ancestor

------------------------------------------------------------
revno: 2404
revision-id: john at arbash-meinel.com-20070410183032-rw4d3kpb8f9cesfw
parent: john at arbash-meinel.com-20070410181305-9y6qbm51we9k37kz
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: shortcut-common-ancestor
timestamp: Tue 2007-04-10 13:30:32 -0500
message:
  We don't need to extract ancestry_b until we after we've checked for existence.
  It seems to make sense to check 'b in ancestry_a' first, though we might consider checking
  a in ancestry_b first.
  b in a is merging something which has already been merged.
  a in b is merging something which has merged you.
  And 'a in b' may actually be more common.
  The timing difference is fairly small, though.
modified:
  bzrlib/revision.py             revision.py-20050309040759-e77802c08f3999d5
-------------- next part --------------
=== modified file 'bzrlib/revision.py'
--- a/bzrlib/revision.py	2007-04-10 18:13:05 +0000
+++ b/bzrlib/revision.py	2007-04-10 18:30:32 +0000
@@ -254,9 +254,9 @@
             # Shortcut the case where one of the tips is already included in
             # the other graphs ancestry.
             ancestry_a = graph.get_ancestry(revision_a)
-            ancestry_b = graph.get_ancestry(revision_b)
             if revision_b in ancestry_a:
                 return revision_b
+            ancestry_b = graph.get_ancestry(revision_b)
             if revision_a in ancestry_b:
                 return revision_a
             # convert to a NULL_REVISION based graph.



More information about the bazaar-commits mailing list