Rev 3906: Combine the 'move recent to front' with the 'split chk by prefix' in http://bzr.arbash-meinel.com/branches/bzr/brisbane/split_pack

John Arbash Meinel john at arbash-meinel.com
Wed Mar 25 15:28:20 GMT 2009


At http://bzr.arbash-meinel.com/branches/bzr/brisbane/split_pack

------------------------------------------------------------
revno: 3906
revision-id: john at arbash-meinel.com-20090325152759-qwtyd1ce50ox0pzu
parent: john at arbash-meinel.com-20090325145300-gycg1qqm2mtbm7tq
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: split_pack
timestamp: Wed 2009-03-25 10:27:59 -0500
message:
  Combine the 'move recent to front' with the 'split chk by prefix'
-------------- next part --------------
=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- a/bzrlib/repofmt/groupcompress_repo.py	2009-03-25 14:53:00 +0000
+++ b/bzrlib/repofmt/groupcompress_repo.py	2009-03-25 15:27:59 +0000
@@ -304,10 +304,18 @@
                     yield next_stream(subkeys)
         # Grab the text keys that are referenced by recent commits, so we can
         # prioritize those as well
-        for stream in _get_referenced_stream(self._chk_id_roots,
-                                             self._gather_text_refs):
-            yield stream
+        recent_roots = self._chk_id_roots[:self._RECENT_HORIZON]
+        old_roots = self._chk_id_roots[self._RECENT_HORIZON:]
         del self._chk_id_roots
+        for stream in _get_referenced_stream(recent_roots, True):
+            yield stream
+        self._recent_text_refs = self._text_refs
+        if self._gather_text_refs:
+            self._text_refs = set(self._text_refs)
+        else:
+            self._text_refs = None
+        for stream in _get_referenced_stream(old_roots, self._gather_text_refs):
+            yield stream
         # while it isn't really possible for chk_id_roots to not be in the
         # local group of packs, it is possible that the tree shape has not
         # changed recently, so we need to filter _chk_p_id_roots by the
@@ -315,9 +323,13 @@
         chk_p_id_roots = [key for key in self._chk_p_id_roots
                           if key in remaining_keys]
         del self._chk_p_id_roots
-        for stream in _get_referenced_stream(chk_p_id_roots, False):
-            yield stream
+        recent_roots = chk_p_id_roots[:self._RECENT_HORIZON]
+        old_roots = chk_p_id_roots[self._RECENT_HORIZON:]
         del chk_p_id_roots
+        for stream in _get_referenced_stream(recent_roots, False):
+            yield stream
+        for stream in _get_referenced_stream(old_roots, False):
+            yield stream
         if remaining_keys:
             trace.mutter('There were %d keys in the chk index, %d of which'
                          ' were not referenced', total_keys,



More information about the bazaar-commits mailing list