Rev 2961: Peer review feedback with Ian. in http://people.ubuntu.com/~robertc/baz2.0/reconcile

Robert Collins robertc at robertcollins.net
Sun Nov 4 20:35:44 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/reconcile

------------------------------------------------------------
revno: 2961
revision-id:robertc at robertcollins.net-20071104203532-6vndyb5pv82em6n7
parent: robertc at robertcollins.net-20071104195306-36xbgtsvvrtr5jkz
committer: Robert Collins <robertc at robertcollins.net>
branch nick: reconcile
timestamp: Mon 2007-11-05 07:35:32 +1100
message:
  Peer review feedback with Ian.
modified:
  bzrlib/reconcile.py            reweave_inventory.py-20051108164726-1e5e0934febac06e
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
=== modified file 'bzrlib/reconcile.py'
--- a/bzrlib/reconcile.py	2007-11-04 15:32:55 +0000
+++ b/bzrlib/reconcile.py	2007-11-04 20:35:32 +0000
@@ -484,20 +484,23 @@
                     collection, packs, ".reconcile", all_revisions)
                 new_pack = self._packer.pack(pb=self.pb)
                 if new_pack is not None:
-                    self._discard_packs(packs)
+                    self._discard_and_save(packs)
             else:
                 # only make a new pack when there is data to copy.
-                self._discard_packs(packs)
+                self._discard_and_save(packs)
             self.garbage_inventories = total_inventories - len(list(
                 collection.inventory_index.combined_index.iter_all_entries()))
         finally:
             collection._unlock_names()
 
-    def _discard_packs(self, packs):
+    def _discard_and_save(self, packs):
         """Discard some packs from the repository.
 
-        This removes them from the memory index and renames them into the
+        This removes them from the memory index, saves the in-memory index
+        which makes the newly reconciled pack visible and hides the packs to be
+        discarded, and finally renames the packs being discarded into the
         obsolete packs directory.
+
         :param packs: The packs to discard.
         """
         for pack in packs:

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2007-11-03 13:47:54 +0000
+++ b/bzrlib/remote.py	2007-11-04 20:35:32 +0000
@@ -258,9 +258,11 @@
         self._lock_token = None
         self._lock_count = 0
         self._leave_lock = False
-        # for tests
-        # These depend on the actual remote format, so force it off for maximum
-        # compatibility.
+        # For tests:
+        # These depend on the actual remote format, so force them off for
+        # maximum compatibility. XXX: In future these should depend on the
+        # remote repository instance, but this is irrelevant until we perform
+        # reconcile via an RPC call.
         self._reconcile_does_inventory_gc = False
         self._reconcile_fixes_text_parents = False
         self._reconcile_backsup_inventory = False

=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2007-10-31 22:33:53 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2007-11-04 20:35:32 +0000
@@ -1535,8 +1535,9 @@
                     tuple(parent[0] for parent in refs[0])))
                 pb.update("Reading revision index.", 0, 0)
             index_positions.sort()
-            total = len(index_positions) / 1000 + 1
-            for offset in xrange(total):
+            batch_count = len(index_positions) / 1000 + 1
+            pb.update("Checking cached revision graph.", 0, batch_count)
+            for offset in xrange(batch_count):
                 pb.update("Checking cached revision graph.", offset)
                 to_query = index_positions[offset * 1000:(offset + 1) * 1000]
                 if not to_query:

=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py	2007-10-31 20:53:23 +0000
+++ b/bzrlib/tests/test_repository.py	2007-11-04 20:35:32 +0000
@@ -1391,3 +1391,6 @@
 
 class TestPacker(TestCaseWithTransport):
     """Tests for the packs repository Packer class."""
+
+    # To date, this class has been factored out and nothing new added to it;
+    # thus there are not yet any tests.



More information about the bazaar-commits mailing list