[MERGE][#172612] bzr commit: don't print the revision number twice

Alexander Belchenko bialix at ukr.net
Fri Nov 30 11:15:23 GMT 2007


bb:tweak

Because your patch misses 1.0 release before merging it in
someone should tweak NEWS and mentioned version numbers.

=== modified file 'NEWS'
--- NEWS	2007-11-29 18:41:01 +0000
+++ NEWS	2007-11-30 02:53:49 +0000
@@ -62,6 +62,9 @@

    IMPROVEMENTS:

+   * ``bzr commit`` now doesn't print the revision number twice. (Matt
+     Nordhoff, #172612)
+
     * ``bzr send`` now doesn't require the target e-mail address to be
       specified on the command line if an interactive e-mail client is 
used.
       (LukУЁХЁ LalinskУН)
@@ -193,6 +196,9 @@

    API BREAKS:

+   * Deprecate not passing a ``location`` argument to commit reporters'
+     ``started`` methods. (Matt Nordhoff)
+
     * ``osutils.backup_file`` is deprecated. Actually it's not used in 
bzrlib
       during very long time. (Alexander Belchenko)

^-- NEWS should be updated to post 1.0.

=== modified file 'bzrlib/commit.py'
--- bzrlib/commit.py	2007-11-27 20:35:02 +0000
+++ bzrlib/commit.py	2007-11-30 02:43:40 +0000
@@ -91,6 +91,10 @@
      """I report on progress of a commit."""

      def started(self, revno, revid, location=None):
+        if location is None:
+            symbol_versioning.warn("As of bzr 0.93 you must pass a 
location "
+                                   "to started.", DeprecationWarning,
+                                   stacklevel=2)
          pass

^-- It's a bit strange (;-D) but our 0.93 eventually becomes 1.0, and
your patch most likely will be merged to 1.1, so this warning should
be updated appropriately.

@@ -133,10 +137,15 @@

      def started(self, revno, rev_id, location=None):
          if location is not None:
-            location = ' to "' + unescape_for_display(location, 
'utf-8') + '"'
+            location = ' to: ' + unescape_for_display(location, 'utf-8')
          else:
+            # When started was added, location was only made optional by
+            # accident.  Matt Nordhoff 20071129
+            symbol_versioning.warn("As of bzr 0.93 you must pass a 
location "
+                                   "to started.", DeprecationWarning,
+                                   stacklevel=2)
              location = ''
-        self._note('Committing revision %d%s.', revno, location)
+        self._note('Committing%s', location)

^-- I'd prefer to use:
location = 'to: ' + unescape_for_display(location, 'utf-8')
and then
self._note('Committing %s', location)

it's more readable IMO.

Alexander.





More information about the bazaar mailing list