Rev 2673: Review feedback. in http://people.ubuntu.com/~robertc/baz2.0/reconcile

Robert Collins robertc at robertcollins.net
Wed Aug 8 06:37:56 BST 2007


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

------------------------------------------------------------
revno: 2673
revision-id: robertc at robertcollins.net-20070808053751-72npeyouas425fck
parent: robertc at robertcollins.net-20070805095335-dn7artt5nlwr8kwe
committer: Robert Collins <robertc at robertcollins.net>
branch nick: reconcile
timestamp: Wed 2007-08-08 15:37:51 +1000
message:
  Review feedback.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/repository_implementations/test_reconcile.py test_reconcile.py-20060223022332-572ef70a3288e369
=== modified file 'NEWS'
--- a/NEWS	2007-08-05 09:53:35 +0000
+++ b/NEWS	2007-08-08 05:37:51 +0000
@@ -195,10 +195,6 @@
     * ``bzrlib.pack.make_readv_reader`` allows readv based access to pack
       files that are stored on a transport. (Robert Collins)
 
-    * Add a new method ``bzrlib.repository.Repository.reconcile_actions``
-      allowing conditional test cases on the sorts of things reconcile
-      will actually perform. (Robert Collins)
-
   TESTING:
 
     * Remove selftest ``--clean-output``, ``--numbered-dirs`` and

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2007-07-25 00:52:21 +0000
+++ b/bzrlib/remote.py	2007-08-08 05:37:51 +0000
@@ -248,6 +248,8 @@
         self._lock_token = None
         self._lock_count = 0
         self._leave_lock = False
+        # for tests
+        self._reconcile_does_inventory_gc = True
 
     def _ensure_real(self):
         """Ensure that there is a _real_repository set.

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-08-05 09:53:35 +0000
+++ b/bzrlib/repository.py	2007-08-08 05:37:51 +0000
@@ -223,6 +223,8 @@
         self._revision_store = _revision_store
         # backwards compatibility
         self.weave_store = text_store
+        # for tests
+        self._reconcile_does_inventory_gc = True
         # not right yet - should be more semantically clear ? 
         # 
         self.control_store = control_store
@@ -801,13 +803,6 @@
         reconciler.reconcile()
         return reconciler
 
-    def reconcile_actions(self):
-        """Return a set of actions taken by reconcile on this repository.
-        
-        :return: A set of actions. e.g. set(['inventory_gc']).
-        """
-        return set(['inventory_gc'])
-
     @needs_read_lock
     def revision_tree(self, revision_id):
         """Return Tree for a revision on this branch.

=== modified file 'bzrlib/tests/repository_implementations/test_reconcile.py'
--- a/bzrlib/tests/repository_implementations/test_reconcile.py	2007-08-05 09:53:35 +0000
+++ b/bzrlib/tests/repository_implementations/test_reconcile.py	2007-08-08 05:37:51 +0000
@@ -127,10 +127,9 @@
         # in an empty repo, theres nothing to do.
         self.checkEmptyReconcile()
 
-    def test_reconcile_actions(self):
-        """reconcile_actions() returns a set naming what a repo reconciles."""
+    def test_repo_has_reconcile_does_inventory_gc_attribute(self):
         repo = self.make_repository('repo')
-        self.assertNotEqual(None, set(repo.reconcile_actions()))
+        self.assertNotEqual(None, repo._reconcile_does_inventory_gc)
 
     def test_reconcile_empty_thorough(self):
         # reconcile should accept thorough=True
@@ -141,9 +140,8 @@
         bzrdir_url = self.get_url('inventory_without_revision')
         bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url)
         repo = bzrdir.open_repository()
-        if 'inventory_gc' not in repo.reconcile_actions():
-            # irrelevant test.
-            return
+        if not repo._reconcile_does_inventory_gc:
+            raise TestSkipped('Irrelevant test')
         reconcile(bzrdir)
         # now the backup should have it but not the current inventory
         repo = bzrdir.open_repository()
@@ -154,9 +152,8 @@
         d_url = self.get_url('inventory_without_revision')
         d = bzrlib.bzrdir.BzrDir.open(d_url)
         repo = d.open_repository()
-        if 'inventory_gc' not in repo.reconcile_actions():
-            # irrelevant test.
-            return
+        if not repo._reconcile_does_inventory_gc:
+            raise TestSkipped('Irrelevant test')
         self.checkUnreconciled(d, repo.reconcile())
         reconciler = repo.reconcile(thorough=True)
         # no bad parents
@@ -206,9 +203,8 @@
         # other tests use the lower level repo.reconcile()
         d_url = self.get_url('inventory_without_revision_and_ghost')
         d = bzrlib.bzrdir.BzrDir.open(d_url)
-        if 'inventory_gc' not in d.open_repository().reconcile_actions():
-            # irrelevant test.
-            return
+        if not d.open_repository()._reconcile_does_inventory_gc:
+            raise TestSkipped('Irrelevant test')
         def reconcile():
             reconciler = Reconciler(d)
             reconciler.reconcile()
@@ -220,9 +216,8 @@
         d_url = self.get_url('inventory_without_revision_and_ghost')
         d = bzrlib.bzrdir.BzrDir.open(d_url)
         repo = d.open_repository()
-        if 'inventory_gc' not in repo.reconcile_actions():
-            # irrelevant test.
-            return
+        if not repo._reconcile_does_inventory_gc:
+            raise TestSkipped('Irrelevant test')
         # nothing should have been altered yet : inventories without
         # revisions are not data loss incurring for current format
         self.check_thorough_reweave_missing_revision(d, repo.reconcile,



More information about the bazaar-commits mailing list