[PATCH] bookmark: don't allow integers as bookmark/branch/tag names

Mads Kiilerich mads at kiilerich.com
Fri Apr 19 17:25:39 UTC 2013


On 04/19/2013 06:59 PM, Wagner Bruna wrote:
> I noticed this during translation:
>
> Em 05-02-2013 23:57, Durham Goode escreveu:
>> # HG changeset patch
>> # User Durham Goode <durham at fb.com>
>> # Date 1360110173 28800
>> # Node ID 3e4293758d473380c2877d07ead9eaeccff34b65
>> # Parent  c6377e34cb1ed79cb142f01652b0acfa09ef8c1f
>> bookmark: don't allow integers as bookmark/branch/tag names
> (...)
>
>> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
>> --- a/mercurial/scmutil.py
>> +++ b/mercurial/scmutil.py
>> @@ -34,6 +34,11 @@
>>       for c in (':', '\0', '\n', '\r'):
>>           if c in lbl:
>>               raise util.Abort(_("%r cannot be used in a name") % c)
>> +    try:
>> +        int(lbl)
>> +        raise util.Abort(_("a %s cannot have an integer as its name") % kind)
> This message can't be translated, since it'd need to match the unknown
> parameter's particular grammatical rules (for instance, in the Brazilian
> Portuguese translation, 'bookmark' and 'branch' are masculine nouns, but 'tag'
> is feminine; the article at the beginning would need to match both).
>
> But I'm not sure what would be a good message here... Some related translation
> discussions (dealing with the same function!):
>
> http://selenic.com/pipermail/mercurial-devel/2012-October/045542.html
> http://selenic.com/pipermail/mercurial-devel/2012-October/045567.html

So:

http://selenic.com/pipermail/mercurial-devel/2012-October/045567.html
a patch that
1. removed the 'kind' parameter and
2. replaced it with whatever

http://selenic.com/pipermail/mercurial-devel/2012-October/045600.html
suggested using the term 'label'

http://selenic.com/repo/hg//rev/71c1513fd560
the resent and applied patch that
1. did not remove the 'kind' parameter (and thus tricked Durham into 
using it)
2. used 'name' instead of 'label'

I suggest making
a patch for stable that change 'name' to 'label'
a patch for stable that changes the new integer message to use 'label' 
too and thus make the kind parameter unused again
a patch for default after 2.6 that removes the kind parameter

/Mads



More information about the Mercurial-devel mailing list