Rev 2957: All check/reconcile tests passing now. in http://people.ubuntu.com/~robertc/baz2.0/reconcile

Robert Collins robertc at robertcollins.net
Sat Nov 3 14:26:41 GMT 2007


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

------------------------------------------------------------
revno: 2957
revision-id:robertc at robertcollins.net-20071103142637-1diuxsp2at93vcon
parent: robertc at robertcollins.net-20071103134754-l5lspakbc6pssydf
committer: Robert Collins <robertc at robertcollins.net>
branch nick: reconcile
timestamp: Sun 2007-11-04 01:26:37 +1100
message:
  All check/reconcile tests passing now.
modified:
  bzrlib/tests/repository_implementations/__init__.py __init__.py-20060131092037-9564957a7d4a841b
  bzrlib/tests/repository_implementations/test_check_reconcile.py test_broken.py-20070928125406-62236394w0jpbpd6-2
  bzrlib/tests/repository_implementations/test_reconcile.py test_reconcile.py-20060223022332-572ef70a3288e369
=== modified file 'bzrlib/tests/repository_implementations/__init__.py'
--- a/bzrlib/tests/repository_implementations/__init__.py	2007-10-26 06:58:43 +0000
+++ b/bzrlib/tests/repository_implementations/__init__.py	2007-11-03 14:26:37 +0000
@@ -160,7 +160,7 @@
         # Same as the populated parents, because there was nothing wrong.
         return self.populated_parents()
 
-    def check_regexes(self):
+    def check_regexes(self, repo):
         return ["0 unreferenced text ancestors"]
 
     def populate_repository(self, repo):
@@ -193,7 +193,7 @@
             ((), 'rev1b'),
             (('rev1a',), 'rev2'))
 
-    def check_regexes(self):
+    def check_regexes(self, repo):
         return [r"\* a-file-id version rev2 has parents \('rev1a', 'rev1b'\) "
                 r"but should have \('rev1a',\)",
                 "1 unreferenced text ancestors",
@@ -241,7 +241,7 @@
             ((), 'rev2'),
             ((), 'rev3'))
 
-    def check_regexes(self):
+    def check_regexes(self, repo):
         return [r"\* a-file-id version rev3 has parents "
                 r"\('rev1c',\) but should have \(\)",
                 # Also check reporting of unreferenced ancestors
@@ -307,9 +307,15 @@
             # per-file last-modified revisions.
             (('rev2c',), 'rev5'))
 
-    def check_regexes(self):
+    def check_regexes(self, repo):
+        if repo.supports_rich_root():
+            # TREE_ROOT will be wrong; but we're not testing it. so just adjust
+            # the expected count of errors.
+            count = 11
+        else:
+            count = 5
         return [
-            "5 inconsistent parents",
+            "%d inconsistent parents" % count,
             r"a-file-id version rev2 has parents \('rev1a',\) "
             r"but should have \(\)",
             r"a-file-id version rev2b has parents \('rev1a',\) "
@@ -413,7 +419,7 @@
     def corrected_fulltexts(self):
         return ['rev4']
 
-    def check_regexes(self):
+    def check_regexes(self, repo):
         return []
 
     def populate_repository(self, repo):
@@ -472,9 +478,15 @@
             (('bad-parent',), 'good-parent'),
             (('good-parent',), 'broken-revision'))
 
-    def check_regexes(self):
+    def check_regexes(self, repo):
+        if repo.supports_rich_root():
+            # TREE_ROOT will be wrong; but we're not testing it. so just adjust
+            # the expected count of errors.
+            count = 3
+        else:
+            count = 1
         return (
-            '     1 inconsistent parents',
+            '     %d inconsistent parents' % count,
             (r"      \* a-file-id version broken-revision has parents "
              r"\('good-parent', 'bad-parent'\) but "
              r"should have \('good-parent',\)"))
@@ -518,9 +530,15 @@
             (None, 'modified-something-else'),
             (('basis',), 'current'))
 
-    def check_regexes(self):
+    def check_regexes(self, repo):
+        if repo.supports_rich_root():
+            # TREE_ROOT will be wrong; but we're not testing it. so just adjust
+            # the expected count of errors.
+            count = 4
+        else:
+            count = 2
         return (
-            '2 inconsistent parents',
+            "%d inconsistent parents" % count,
             r"\* a-file-id version current has parents "
             r"\('modified-something-else',\) but should have \('basis',\)",
             r"\* a-file-id version modified-something-else has parents "
@@ -576,9 +594,15 @@
             (('parent-1', 'parent-2'), 'broken-revision-1-2'),
             (('parent-2', 'parent-1'), 'broken-revision-2-1'))
 
-    def check_regexes(self):
+    def check_regexes(self, repo):
+        if repo.supports_rich_root():
+            # TREE_ROOT will be wrong; but we're not testing it. so just adjust
+            # the expected count of errors.
+            count = 4
+        else:
+            count = 2
         return (
-            "2 inconsistent parents",
+            "%d inconsistent parents" % count,
             r"\* a-file-id version broken-revision-1-2 has parents "
             r"\('parent-2', 'parent-1'\) but should have "
             r"\('parent-1', 'parent-2'\)",

=== modified file 'bzrlib/tests/repository_implementations/test_check_reconcile.py'
--- a/bzrlib/tests/repository_implementations/test_check_reconcile.py	2007-11-03 13:47:54 +0000
+++ b/bzrlib/tests/repository_implementations/test_check_reconcile.py	2007-11-03 14:26:37 +0000
@@ -188,7 +188,7 @@
         self.require_repo_suffers_text_parent_corruption(repo)
         check_result = repo.check()
         check_result.report_results(verbose=True)
-        for pattern in scenario.check_regexes():
+        for pattern in scenario.check_regexes(repo):
             self.assertContainsRe(
                 self._get_log(keep_log_file=True),
                 pattern)

=== modified file 'bzrlib/tests/repository_implementations/test_reconcile.py'
--- a/bzrlib/tests/repository_implementations/test_reconcile.py	2007-10-31 22:33:53 +0000
+++ b/bzrlib/tests/repository_implementations/test_reconcile.py	2007-11-03 14:26:37 +0000
@@ -323,10 +323,11 @@
         repo.start_write_group()
         inv = Inventory(revision_id='wrong-secondary-parent')
         inv.root.revision = 'wrong-secondary-parent'
-        root_id = inv.root.file_id
-        vf = repo.weave_store.get_weave_or_empty(root_id,
-            repo.get_transaction())
-        vf.add_lines('wrong-secondary-parent', [], [])
+        if repo.supports_rich_root():
+            root_id = inv.root.file_id
+            vf = repo.weave_store.get_weave_or_empty(root_id,
+                repo.get_transaction())
+            vf.add_lines('wrong-secondary-parent', [], [])
         sha1 = repo.add_inventory('wrong-secondary-parent', inv, ['1', '3', '2'])
         rev = Revision(timestamp=0,
                        timezone=None,




More information about the bazaar-commits mailing list