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

Matt Nordhoff mnordhoff at mattnordhoff.com
Fri Nov 30 13:09:20 GMT 2007


Alexander Belchenko wrote:
> bb:tweak
> 
> Because your patch misses 1.0 release before merging it in
> someone should tweak NEWS and mentioned version numbers.

Tweak NEWS? What? Move it to a new "in development" section instead? I'd
be happy to do that, once that change hits bzr.dev.

> === 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.

I know, but I was following symbol_versioning using zero_ninetythree.

I almost wrote a patch once for finding "0.19" in the help.

> @@ -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.

But then there'd be an extra space. Also, at least it's not less
readable than the old code.

(Oops, I wrote 99% of this message a couple hours ago but didn't send it.)
-- 



More information about the bazaar mailing list