Rev 3367: (robertc) Fix major regression in fetching from knits to packs. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Apr 15 02:01:05 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3367
revision-id:pqm at pqm.ubuntu.com-20080415010057-76elfmmg090kxo75
parent: pqm at pqm.ubuntu.com-20080414205628-khxum18d23suak10
parent: robertc at robertcollins.net-20080414223951-6cnknexu9wfniwno
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-04-15 02:00:57 +0100
message:
  (robertc) Fix major regression in fetching from knits to packs.
  	(Robert Collins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
    ------------------------------------------------------------
    revno: 3366.1.1
    revision-id:robertc at robertcollins.net-20080414223951-6cnknexu9wfniwno
    parent: pqm at pqm.ubuntu.com-20080414205628-khxum18d23suak10
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: knit-revision-search
    timestamp: Tue 2008-04-15 08:39:51 +1000
    message:
       * Severe performance degradation in fetching from knit repositories to
         packs due to parsing the entire revisions.kndx on every graph walk
         iteration fixed by using the Repository.get_graph API. (Robert Collins)
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'NEWS'
--- a/NEWS	2008-04-14 18:38:11 +0000
+++ b/NEWS	2008-04-14 22:39:51 +0000
@@ -23,6 +23,10 @@
 
   BUGFIXES:
 
+    * Severe performance degradation in fetching from knit repositories to
+      packs due to parsing the entire revisions.kndx on every graph walk
+      iteration fixed by using the Repository.get_graph API. (Robert Collins)
+
   DOCUMENTATION:
 
     * Document outlining strategies for TortoiseBzr. (Mark Hammond)

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-04-10 06:19:49 +0000
+++ b/bzrlib/repository.py	2008-04-14 22:39:51 +0000
@@ -2385,6 +2385,7 @@
         :return: A set of revision ids.
         """
         graph = self.source.get_graph()
+        target_graph = self.target.get_graph()
         missing_revs = set()
         # ensure we don't pay silly lookup costs.
         revision_ids = frozenset(revision_ids)
@@ -2399,14 +2400,14 @@
                 absent_ids = set(revision_ids.intersection(ghosts))
                 # If all absent_ids are present in target, no error is needed.
                 absent_ids.difference_update(
-                    self.target.has_revisions(absent_ids))
+                    set(target_graph.get_parent_map(absent_ids)))
                 if absent_ids:
                     raise errors.NoSuchRevision(self.source, absent_ids.pop())
             # we don't care about other ghosts as we can't fetch them and
             # haven't been asked to.
             next_revs = set(next_revs)
             # we always have NULL_REVISION present.
-            have_revs = self.target.has_revisions(next_revs).union(null_set)
+            have_revs = set(target_graph.get_parent_map(next_revs)).union(null_set)
             missing_revs.update(next_revs - have_revs)
             searcher.stop_searching_any(have_revs)
         return searcher.get_result()




More information about the bazaar-commits mailing list