[MERGE][#172612] bzr commit: don't print the revision number twice
Alexander Belchenko
bialix at ukr.net
Fri Nov 30 13:22:20 GMT 2007
Matt Nordhoff пишет:
> 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.
Yes, please.
>> === 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.
So bzrlib need to have the way to use named constants instead of fixed
strings for this purpose. Want to file a bug?
>
>> @@ -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.
No. If you create location string *without* space as prefix as I show you:
location = 'to: ' + unescape_for_display(location, 'utf-8')
you won't have any extra space in resulting message.
More information about the bazaar
mailing list