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

Durham Goode durham at fb.com
Fri Apr 19 12:51:59 CDT 2013


On 4/19/13 10:25 AM, "Mads Kiilerich" <mads at kiilerich.com> wrote:

>On 04/19/2013 06:59 PM, Wagner Bruna wrote:
>> I noticed this during translation:
>>
>>> +    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
>
>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

Matt's comment in that original thread is to not remove the 'kinds'
parameter since it might be used in the future.  I'll just add a comment
in the function saying not to use it in ui output.  Matt's comment also
mentions the kind of label is implicit, so actually mentioning 'branch,
bookmark, or tag' isn't necessary.

I'll submit a patch for stable to change it to "cannot use an integer as a
label"

Durham



More information about the Mercurial-devel mailing list