[PATCH] ui: replace regexp pattern with sequence of choices

Steve Borho steve at borho.org
Fri May 1 09:36:52 CDT 2009


On Fri, May 1, 2009 at 1:38 AM, Peter Arrenbrecht
<peter.arrenbrecht at gmail.com> wrote:
> On Thu, Apr 30, 2009 at 6:57 PM, Steve Borho <steve at borho.org> wrote:
>> # HG changeset patch
>> # User Steve Borho <steve at borho.org>
>> # Date 1241104532 18000
>> # Node ID 473594b6e19989048f62dff71ce726a45de8d150
>> # Parent  344751cd8cb88bac208d630f4825068a3170c92f
>> ui: replace regexp pattern with sequence of choices
>>
>> Use ampersands (&) to delineate the response char in each choice.
>> ui.prompt() responses are now explicitly case insensitive.  GUIs
>> that subclass ui can generate dialogs from the full choice names.
>>
>> diff -r 344751cd8cb8 -r 473594b6e199 hgext/record.py
>> --- a/hgext/record.py   Sun Apr 26 16:50:44 2009 -0500
>> +++ b/hgext/record.py   Thu Apr 30 10:15:32 2009 -0500
>> @@ -282,8 +282,16 @@
>>         if resp_file[0] is not None:
>>             return resp_file[0]
>>         while True:
>> -            choices = _('[Ynsfdaq?]')
>> -            r = (ui.prompt("%s %s " % (query, choices), '(?i)%s?$' % choices)
>> +            resps = _('[Ynsfdaq?]')
>> +            choices = (_('&Yes, record this change'),
>> +                    _('&No, skip this change'),
>> +                    _('&Skip remaining cnages to this file'),
>
> ^Typo: "changes"

Patrick caught that and fixed it before pushing.

--
Steve Borho



More information about the Mercurial-devel mailing list