Rev 4637: Fix upgrade of branches in repositories. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Aug 24 02:14:42 BST 2009


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

------------------------------------------------------------
revno: 4637 [merge]
revision-id: pqm at pqm.ubuntu.com-20090824011441-ux4sxpyqcsqndc2b
parent: pqm at pqm.ubuntu.com-20090821071831-d3dacehbozpkpy27
parent: robertc at robertcollins.net-20090821021006-ymwdf3kj5wwpg9zz
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2009-08-24 02:14:41 +0100
message:
  Fix upgrade of branches in repositories.
modified:
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/tests/blackbox/test_upgrade.py test_upgrade.py-20060120060132-b41e5ed2f886ad28
=== 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