Rev 4635: Fix regression in upgrade introduced with the change to upgrade in rev 4622. in http://bazaar.launchpad.net/~lifeless/bzr/upgrade

Robert Collins robertc at robertcollins.net
Fri Aug 21 03:10:09 BST 2009


At http://bazaar.launchpad.net/~lifeless/bzr/upgrade

------------------------------------------------------------
revno: 4635
revision-id: robertc at robertcollins.net-20090821021006-ymwdf3kj5wwpg9zz
parent: pqm at pqm.ubuntu.com-20090820135727-pz56lf0l0tj6rbrn
committer: Robert Collins <robertc at robertcollins.net>
branch nick: upgrade
timestamp: Fri 2009-08-21 12:10:06 +1000
message:
  Fix regression in upgrade introduced with the change to upgrade in rev 4622.
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2009-08-18 05:18:52 +0000
+++ b/bzrlib/bzrdir.py	2009-08-21 02:10:06 +0000
@@ -129,8 +129,16 @@
         return True
 
     def check_conversion_target(self, target_format):
+        """Check that a bzrdir as a whole can be converted to a new format."""
+        # The only current restriction is that the repository content can be 
+        # fetched compatibly with the target.
         target_repo_format = target_format.repository_format
-        self.open_repository()._format.check_conversion_target(target_repo_format)
+        try:
+            self.open_repository()._format.check_conversion_target(
+                target_repo_format)
+        except errors.NoRepositoryPresent:
+            # No repo, no problem.
+            pass
 
     @staticmethod
     def _check_supported(format, allow_unsupported,

=== modified file 'bzrlib/tests/blackbox/test_upgrade.py'
--- a/bzrlib/tests/blackbox/test_upgrade.py	2009-08-14 08:57:57 +0000
+++ b/bzrlib/tests/blackbox/test_upgrade.py	2009-08-21 02:10:06 +0000
@@ -184,7 +184,7 @@
         self.assertEqual('', err)
 
 
-class UpgradeRecommendedTests(TestCaseInTempDir):
+class UpgradeRecommendedTests(TestCaseWithTransport):
 
     def test_recommend_upgrade_wt4(self):
         # using a deprecated format gives a warning
@@ -200,3 +200,9 @@
         out, err = self.run_bzr('revno a')
         if err.find('upgrade') > -1:
             self.fail("message shouldn't suggest upgrade:\n%s" % err)
+
+    def test_upgrade_shared_repo(self):
+        repo = self.make_repository('repo', format='2a', shared=True)
+        branch = self.make_branch_and_tree('repo/branch', format="pack-0.92")
+        self.get_transport('repo/branch/.bzr/repository').delete_tree('.')
+        out, err = self.run_bzr(['upgrade'], working_dir='repo/branch')




More information about the bazaar-commits mailing list