Rev 4622: (robertc) Fix upgrade when the default format has been changed to 2a. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Aug 18 02:38:59 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4622 [merge]
revision-id: pqm at pqm.ubuntu.com-20090818013856-vezgd3arfawq9x2l
parent: pqm at pqm.ubuntu.com-20090817224326-uhljmr5me5x3xyda
parent: mbp at sourcefrog.net-20090814111734-qvss9y1ommjfdish
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-08-18 02:38:56 +0100
message:
  (robertc) Fix upgrade when the default format has been changed to 2a.
  	(Martin Pool)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
=== modified file 'NEWS'
--- a/NEWS	2009-08-15 09:15:03 +0000
+++ b/NEWS	2009-08-18 01:38:56 +0000
@@ -58,6 +58,11 @@
 * StreamSource generates rich roots from non-rich root sources correctly
   now.  (Andrew Bennetts, #368921)
 
+* When deciding whether a repository was compatible for upgrading or
+  fetching, we previously incorrectly checked the default repository
+  format for the bzrdir format, rather than the format that was actually
+  present on disk.  (Martin Pool, #408824)
+
 Improvements
 ************
 

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2009-08-17 06:17:21 +0000
+++ b/bzrlib/bzrdir.py	2009-08-18 01:38:56 +0000
@@ -130,8 +130,7 @@
 
     def check_conversion_target(self, target_format):
         target_repo_format = target_format.repository_format
-        source_repo_format = self._format.repository_format
-        source_repo_format.check_conversion_target(target_repo_format)
+        self.open_repository()._format.check_conversion_target(target_repo_format)
 
     @staticmethod
     def _check_supported(format, allow_unsupported,

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2009-08-14 09:31:37 +0000
+++ b/bzrlib/remote.py	2009-08-14 11:11:29 +0000
@@ -566,17 +566,6 @@
     def __eq__(self, other):
         return self.__class__ is other.__class__
 
-    def check_conversion_target(self, target_format):
-        if self.rich_root_data and not target_format.rich_root_data:
-            raise errors.BadConversionTarget(
-                'Does not support rich root data.', target_format,
-                from_format=self)
-        if (self.supports_tree_reference and
-            not getattr(target_format, 'supports_tree_reference', False)):
-            raise errors.BadConversionTarget(
-                'Does not support nested trees', target_format,
-                from_format=self)
-
     def network_name(self):
         if self._network_name:
             return self._network_name

=== modified file 'bzrlib/repofmt/knitrepo.py'
--- a/bzrlib/repofmt/knitrepo.py	2009-08-14 09:37:57 +0000
+++ b/bzrlib/repofmt/knitrepo.py	2009-08-14 11:11:29 +0000
@@ -424,9 +424,6 @@
         """See RepositoryFormat.get_format_description()."""
         return "Knit repository format 1"
 
-    def check_conversion_target(self, target_format):
-        pass
-
 
 class RepositoryFormatKnit3(RepositoryFormatKnit):
     """Bzr repository knit format 3.

=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2009-08-14 09:37:57 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2009-08-14 11:11:29 +0000
@@ -2529,9 +2529,6 @@
         """See RepositoryFormat.get_format_description()."""
         return "Packs containing knits without subtree support"
 
-    def check_conversion_target(self, target_format):
-        pass
-
 
 class RepositoryFormatKnitPack3(RepositoryFormatPack):
     """A subtrees parameterized Pack repository.
@@ -2647,9 +2644,6 @@
         """See RepositoryFormat.get_format_description()."""
         return "Packs 5 (adds stacking support, requires bzr 1.6)"
 
-    def check_conversion_target(self, target_format):
-        pass
-
 
 class RepositoryFormatKnitPack5RichRoot(RepositoryFormatPack):
     """A repository with rich roots and stacking.
@@ -2771,9 +2765,6 @@
         """See RepositoryFormat.get_format_description()."""
         return "Packs 6 (uses btree indexes, requires bzr 1.9)"
 
-    def check_conversion_target(self, target_format):
-        pass
-
 
 class RepositoryFormatKnitPack6RichRoot(RepositoryFormatPack):
     """A repository with rich roots, no subtrees, stacking and btree indexes.

=== modified file 'bzrlib/repofmt/weaverepo.py'
--- a/bzrlib/repofmt/weaverepo.py	2009-04-09 20:23:07 +0000
+++ b/bzrlib/repofmt/weaverepo.py	2009-08-14 11:11:29 +0000
@@ -319,9 +319,6 @@
         result.chk_bytes = None
         return result
 
-    def check_conversion_target(self, target_format):
-        pass
-
 
 class RepositoryFormat4(PreSplitOutRepositoryFormat):
     """Bzr repository format 4.
@@ -494,9 +491,6 @@
         """See RepositoryFormat.get_format_description()."""
         return "Weave repository format 7"
 
-    def check_conversion_target(self, target_format):
-        pass
-
     def _get_inventories(self, repo_transport, repo, name='inventory'):
         mapper = versionedfile.ConstantMapper(name)
         return versionedfile.ThunkedVersionedFiles(repo_transport,




More information about the bazaar-commits mailing list