Rev 4676: I didn't mean to change get_deltas_for_revisions yet. in http://bazaar.launchpad.net/~jameinel/bzr/2.0.1-faster-log-dir-bug374730

John Arbash Meinel john at arbash-meinel.com
Thu Sep 24 21:03:55 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.0.1-faster-log-dir-bug374730

------------------------------------------------------------
revno: 4676
revision-id: john at arbash-meinel.com-20090924200343-ku1e3gdasstvzoj7
parent: john at arbash-meinel.com-20090924193615-s58xz6bq2237tx26
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.0.1-faster-log-dir-bug374730
timestamp: Thu 2009-09-24 15:03:43 -0500
message:
  I didn't mean to change get_deltas_for_revisions yet.
  
  I didn't implement support for specific_fileids, which means the results
  were probably wrong. However, it does show that going through iter_changes()
  first, and then filtering second is going to be vastly faster.
  (Time was 38s vs 5m+ for 'bzr log tools')
  What is surprising is that 'time bzr log -v' which should just be the simple
  iter_changes route, was >2min. So something isn't quite right with those
  numbers.
-------------- next part --------------
=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- a/bzrlib/repofmt/groupcompress_repo.py	2009-09-23 21:43:06 +0000
+++ b/bzrlib/repofmt/groupcompress_repo.py	2009-09-24 20:03:43 +0000
@@ -991,35 +991,6 @@
         finally:
             pb.finished()
 
-    def get_deltas_for_revisions(self, revisions, specific_fileids=None):
-        """Produce a generator of revision deltas.
-
-        Note that the input is a sequence of REVISIONS, not revision_ids.
-        Trees will be held in memory until the generator exits.
-        Each delta is relative to the revision's lefthand predecessor.
-
-        :param specific_fileids: if not None, the result is filtered
-          so that only those file-ids, their parents and their
-          children are included.
-        """
-        # Get the revision-ids of interest
-        required_trees = set()
-        for revision in revisions:
-            required_trees.add(revision.revision_id)
-            required_trees.update(revision.parent_ids[:1])
-
-        trees = dict((t.get_revision_id(), t) for
-            t in self.revision_trees(required_trees))
-
-        # Calculate the deltas
-        for revision in revisions:
-            if not revision.parent_ids:
-                old_tree = self.revision_tree(_mod_revision.NULL_REVISION)
-            else:
-                old_tree = trees[revision.parent_ids[0]]
-            yield trees[revision.revision_id].changes_from(old_tree)
-
-
     def _reconcile_pack(self, collection, packs, extension, revs, pb):
         packer = GCCHKReconcilePacker(collection, packs, extension)
         return packer.pack(pb)



More information about the bazaar-commits mailing list