[PATCH] summary: Clarify output for the commit summary

Martin Geisler mg at lazybytes.net
Mon Oct 19 08:01:40 CDT 2009


Mads Kiilerich <mads at kiilerich.com> writes:

> On 10/19/2009 02:14 PM, David Soria Parra wrote:
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -2907,7 +2907,7 @@
>>           if st[i]:
>>               t.append('%d %s' % (len(st[i]), l))
>>
>> -    t = ', '.join(t)
>> +    t = ', '.join(t) + _(' files')
>>
>>       if len(parents)>  1:
>>           t += _(' (merge)')
>
> Such fragments are hard to translate, especially to languages with 
> different word orderings.
>
> Mercurial has no occurences of "+ _(", and until last night no 
> occurences of "+= _(".
>
> Try to use "_('%s files', ..." instead.

I'm actually just about to push David's change but with strings such as

+    labels = [_('%d modified files'), _('%d added files'),
+              _('%d removed files'), _('%d deleted files'),
+              _('%d unknown files'), _('%d ignored files'),
+              _('%d unresolved files')]

instead. I think it looks much better to have

  2 modified files, 3 unknown files

instead of

  2 modified, 3 unknown files

That also matches the output of 'hg status' more closely.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


More information about the Mercurial-devel mailing list