Rev 4607: Revert the previous change, in preparation for doing it 'right'. in http://bazaar.launchpad.net/~jameinel/bzr/1.18-faster-iter-ancestry

John Arbash Meinel john at arbash-meinel.com
Thu Aug 13 21:10:34 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/1.18-faster-iter-ancestry

------------------------------------------------------------
revno: 4607
revision-id: john at arbash-meinel.com-20090813201026-xvvho0lt5d0tozm7
parent: john at arbash-meinel.com-20090813200547-xk9jthbsxnp9hgs4
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 1.18-faster-iter-ancestry
timestamp: Thu 2009-08-13 15:10:26 -0500
message:
  Revert the previous change, in preparation for doing it 'right'.
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2009-08-13 20:05:47 +0000
+++ b/bzrlib/branch.py	2009-08-13 20:10:26 +0000
@@ -446,18 +446,10 @@
         # start_revision_id.
         if self._merge_sorted_revisions_cache is None:
             last_revision = self.last_revision()
-            last_rev_key = (last_revision,)
-            # TODO: we need to expose this on Repository
-            find_ancestry = self.repository.revisions._index._graph_index.find_ancestry
-            parent_map, missing_keys = find_ancestry([last_rev_key], 0)
-            # We now have the graph of keys, and a list of ghosts
-            # remove ghosts because they aren't handled by merge_sort, and
-            # convert back to simple revision_ids
-            # TODO: Is it faster to do "p in parent_map" or is it faster to do
-            # "p not in missing_keys"?
-            revision_graph = dict(
-                (r[-1], [p[-1] for p in parent_ids if p in parent_map])
-                for r, parent_ids in parent_map.iteritems())
+            graph = self.repository.get_graph()
+            parent_map = dict(((key, value) for key, value in
+                     graph.iter_ancestry([last_revision]) if value is not None))
+            revision_graph = repository._strip_NULL_ghosts(parent_map)
             revs = tsort.merge_sort(revision_graph, last_revision, None,
                 generate_revno=True)
             # Drop the sequence # before caching



More information about the bazaar-commits mailing list