Rev 3624: Switch out --1.6-rich-root for --1.6.1-rich-root. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/rich_root_serializer

John Arbash Meinel john at arbash-meinel.com
Fri Aug 29 06:18:57 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/rich_root_serializer

------------------------------------------------------------
revno: 3624
revision-id: john at arbash-meinel.com-20080829051856-cybdbv604adwbzn1
parent: john at arbash-meinel.com-20080829044612-i5eshappfji5sjfz
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: rich_root_serializer
timestamp: Fri 2008-08-29 00:18:56 -0500
message:
  Switch out --1.6-rich-root for --1.6.1-rich-root.
  
  Fix up the tests that were expecting the old name.
  Also add tests that stacking properly check the various
  permutations.
-------------- next part --------------
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-08-29 04:46:12 +0000
+++ b/bzrlib/bzrdir.py	2008-08-29 05:18:56 +0000
@@ -153,7 +153,6 @@
             raise errors.UnsupportedFormatError(format=format)
         if recommend_upgrade \
             and getattr(format, 'upgrade_recommended', False):
-            import pdb; pdb.set_trace()
             ui.ui_factory.recommend_upgrade(
                 format.get_format_description(),
                 basedir)

=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- a/bzrlib/tests/blackbox/test_info.py	2008-07-24 06:10:47 +0000
+++ b/bzrlib/tests/blackbox/test_info.py	2008-08-29 05:18:56 +0000
@@ -247,7 +247,7 @@
         branch5 = tree5.branch
         out, err = self.run_bzr('info -v lightcheckout')
         self.assertEqualDiff(
-"""Lightweight checkout (format: 1.6 or 1.6-rich-root \
+"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root \
 or dirstate or dirstate-tags or \
 pack-0.92 or rich-root or rich-root-pack)
 Location:
@@ -415,7 +415,7 @@
         # Out of date lightweight checkout
         out, err = self.run_bzr('info lightcheckout --verbose')
         self.assertEqualDiff(
-"""Lightweight checkout (format: 1.6 or 1.6-rich-root or \
+"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
 dirstate or dirstate-tags or \
 pack-0.92 or rich-root or rich-root-pack)
 Location:
@@ -552,7 +552,7 @@
         datestring_first = format_date(rev.timestamp, rev.timezone)
         out, err = self.run_bzr('info tree/lightcheckout --verbose')
         self.assertEqualDiff(
-"""Lightweight checkout (format: 1.6 or 1.6-rich-root or \
+"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
 dirstate or dirstate-tags or \
 pack-0.92 or rich-root or rich-root-pack)
 Location:
@@ -676,7 +676,7 @@
         datestring_last = format_date(rev.timestamp, rev.timezone)
         out, err = self.run_bzr('info tree/lightcheckout --verbose')
         self.assertEqualDiff(
-"""Lightweight checkout (format: 1.6 or 1.6-rich-root or \
+"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
 dirstate or dirstate-tags or \
 pack-0.92 or rich-root or rich-root-pack)
 Location:
@@ -1092,7 +1092,7 @@
             (False, True): 'Lightweight checkout',
             (False, False): 'Checkout',
             }[(shared_repo is not None, light_checkout)]
-        format = {True: '1.6 or 1.6-rich-root'
+        format = {True: '1.6 or 1.6.1-rich-root'
                         ' or dirstate or dirstate-tags or pack-0.92'
                         ' or rich-root or rich-root-pack',
                   False: 'dirstate'}[light_checkout]

=== modified file 'bzrlib/tests/test_info.py'
--- a/bzrlib/tests/test_info.py	2008-07-24 05:19:40 +0000
+++ b/bzrlib/tests/test_info.py	2008-08-29 05:18:56 +0000
@@ -146,8 +146,8 @@
             expected = None
             if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree',
                 'pack-0.92', 'pack-0.92-subtree', 'rich-root',
-                'rich-root-pack', '1.6', '1.6-rich-root'):
-                expected = '1.6 or 1.6-rich-root or ' \
+                'rich-root-pack', '1.6', '1.6.1-rich-root'):
+                expected = '1.6 or 1.6.1-rich-root or ' \
                     'dirstate or dirstate-tags or pack-0.92 or'\
                     ' rich-root or rich-root-pack'
             if key in ('knit', 'metaweave'):

=== modified file 'bzrlib/tests/test_pack_repository.py'
--- a/bzrlib/tests/test_pack_repository.py	2008-08-18 23:11:59 +0000
+++ b/bzrlib/tests/test_pack_repository.py	2008-08-29 05:18:56 +0000
@@ -495,7 +495,7 @@
     def get_format(self):
         return bzrdir.format_registry.make_bzrdir(self.format_name)
 
-    def test_stack_checks_compatibility(self):
+    def test_stack_checks_rich_root_compatibility(self):
         # early versions of the packing code relied on pack internals to
         # stack, but the current version should be able to stack on any
         # format.
@@ -507,7 +507,10 @@
         if repo.supports_rich_root():
             # can only stack on repositories that have compatible internal
             # metadata
-            matching_format_name = 'pack-0.92-subtree'
+            if getattr(repo._format, 'supports_tree_reference', False):
+                matching_format_name = 'pack-0.92-subtree'
+            else:
+                matching_format_name = 'rich-root-pack'
             mismatching_format_name = 'pack-0.92'
         else:
             matching_format_name = 'pack-0.92'
@@ -524,6 +527,32 @@
             r'KnitPackRepository.*/repo/.*\n'
             r'different rich-root support')
 
+    def test_stack_checks_serializers_compatibility(self):
+        repo = self.make_repository('repo', format=self.get_format())
+        if getattr(repo._format, 'supports_tree_reference', False):
+            # can only stack on repositories that have compatible internal
+            # metadata
+            matching_format_name = 'pack-0.92-subtree'
+            mismatching_format_name = 'rich-root-pack'
+        else:
+            if repo.supports_rich_root():
+                matching_format_name = 'rich-root-pack'
+                mismatching_format_name = 'pack-0.92-subtree'
+            else:
+                raise TestNotApplicable('No formats use non-v5 serializer'
+                    ' without having rich-root also set')
+        base = self.make_repository('base', format=matching_format_name)
+        repo.add_fallback_repository(base)
+        # you can't stack on something with incompatible data
+        bad_repo = self.make_repository('mismatch',
+            format=mismatching_format_name)
+        e = self.assertRaises(errors.IncompatibleRepositories,
+            repo.add_fallback_repository, bad_repo)
+        self.assertContainsRe(str(e),
+            r'(?m)KnitPackRepository.*/mismatch/.*\nis not compatible with\n'
+            r'KnitPackRepository.*/repo/.*\n'
+            r'different serializers')
+
     def test_adding_pack_does_not_record_pack_names_from_other_repositories(self):
         base = self.make_branch_and_tree('base', format=self.get_format())
         base.commit('foo')
@@ -590,9 +619,9 @@
          dict(format_name='1.6',
               format_string="Bazaar RepositoryFormatKnitPack5 (bzr 1.6)\n",
               format_supports_external_lookups=True),
-         dict(format_name='1.6-rich-root',
+         dict(format_name='1.6.1-rich-root',
               format_string="Bazaar RepositoryFormatKnitPack5RichRoot "
-                  "(bzr 1.6)\n",
+                  "(bzr 1.6.1)\n",
               format_supports_external_lookups=True),
          dict(format_name='development0',
               format_string="Bazaar development format 0 "

=== modified file 'bzrlib/tests/test_upgrade_stacked.py'
--- a/bzrlib/tests/test_upgrade_stacked.py	2008-08-04 07:55:41 +0000
+++ b/bzrlib/tests/test_upgrade_stacked.py	2008-08-29 05:18:56 +0000
@@ -74,7 +74,7 @@
 #        ('knit', 'rich-root', True),
         ('knit', '1.6', False),
 #        ('pack-0.92', '1.6', False),
-        ('1.6', '1.6-rich-root', True),
+        ('1.6', '1.6.1-rich-root', True),
         ]
     scenarios = []
     for (old_name, new_name, model_change) in scenario_pairs:



More information about the bazaar-commits mailing list