Rev 6231: (gz) Stop treating UpToDateFormat as an upgrade failure (Benoit PIERRE) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Tue Oct 25 12:50:34 UTC 2011


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6231 [merge]
revision-id: pqm at pqm.ubuntu.com-20111025125034-c1z0d52n9two1h9m
parent: pqm at pqm.ubuntu.com-20111023184023-0ymq0vcsndal81fs
parent: benoit.pierre at gmail.com-20111023154153-4np4o6pokgftlujz
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2011-10-25 12:50:34 +0000
message:
  (gz) Stop treating UpToDateFormat as an upgrade failure (Benoit PIERRE)
modified:
  bzrlib/tests/blackbox/test_upgrade.py test_upgrade.py-20060120060132-b41e5ed2f886ad28
  bzrlib/upgrade.py              history2weaves.py-20050818063535-e7d319791c19a8b2
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/tests/blackbox/test_upgrade.py'
--- a/bzrlib/tests/blackbox/test_upgrade.py	2011-08-19 19:36:39 +0000
+++ b/bzrlib/tests/blackbox/test_upgrade.py	2011-10-23 13:56:11 +0000
@@ -89,12 +89,13 @@
     def test_upgrade_up_to_date(self):
         self.make_current_format_branch_and_checkout()
         # when up to date we should get a message to that effect
-        (out, err) = self.run_bzr('upgrade current_format_branch', retcode=3)
-        err_msg = ('The branch format %s is already at the most recent format.'
-                   % ('Meta directory format 1'))
-        self.assertEqualDiff('conversion error: %s\nbzr: ERROR: %s\n'
-                             % (err_msg, err_msg),
-                             err)
+        burl = self.get_transport('current_format_branch').local_abspath(".")
+        (out, err) = self.run_bzr('upgrade current_format_branch', retcode=0)
+        self.assertEqual(
+            'Upgrading branch %s/ ...\n'
+            'The branch format %s is already at the most recent format.\n'
+            % (burl, 'Meta directory format 1'),
+            out)
 
     def test_upgrade_up_to_date_checkout_warns_branch_left_alone(self):
         self.make_current_format_branch_and_checkout()
@@ -103,17 +104,13 @@
         # date
         burl = self.get_transport('current_format_branch').local_abspath(".")
         curl = self.get_transport('current_format_checkout').local_abspath(".")
-        (out, err) = self.run_bzr('upgrade current_format_checkout', retcode=3)
+        (out, err) = self.run_bzr('upgrade current_format_checkout', retcode=0)
         self.assertEqual(
             'Upgrading branch %s/ ...\nThis is a checkout.'
             ' The branch (%s/) needs to be upgraded separately.\n'
-            % (curl, burl),
+            'The branch format %s is already at the most recent format.\n'
+            % (curl, burl, 'Meta directory format 1'),
             out)
-        msg = 'The branch format %s is already at the most recent format.' % (
-            'Meta directory format 1')
-        self.assertEqualDiff('conversion error: %s\nbzr: ERROR: %s\n'
-                             % (msg, msg),
-                             err)
 
     def test_upgrade_checkout(self):
         # upgrading a checkout should work

=== modified file 'bzrlib/upgrade.py'
--- a/bzrlib/upgrade.py	2011-10-11 12:01:51 +0000
+++ b/bzrlib/upgrade.py	2011-10-23 13:53:19 +0000
@@ -284,6 +284,10 @@
         try:
             if not dry_run:
                 cv = Convert(control_dir=control_dir, format=format)
+        except errors.UpToDateFormat, ex:
+            ui.ui_factory.note(str(ex))
+            succeeded.append(control_dir)
+            continue
         except Exception, ex:
             trace.warning('conversion error: %s' % ex)
             exceptions.append(ex)

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-10-23 18:40:23 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-10-25 12:50:34 +0000
@@ -65,6 +65,9 @@
 * If sending a crash through Apport fails report the Apport failure to
   bzr.log rather than stderr. (Jonathan Riddell, #766735)
 
+* ``bzr upgrade`` no longer treats 'already up-to-date' exceptions as
+  errors. (Benoît Pierre, #716560).
+
 Documentation
 *************
 




More information about the bazaar-commits mailing list