[PATCH 2 of 5] dispatch: catch InterventionRequired and print the message with no prefix
raf at durin42.com
Sat Feb 9 05:51:10 CST 2013
On Feb 9, 2013, at 11:43 AM, Kevin Bullock <kbullock+mercurial at ringworld.org> wrote:
> On 9 Feb 2013, at 11:39 AM, Mads Kiilerich wrote:
>> On 02/08/2013 11:49 PM, Augie Fackler wrote:
>>> # HG changeset patch
>>> # User Augie Fackler <raf at durin42.com>
>>> # Date 1360362504 21600
>>> # Node ID 1c4102a7ec7c80a1baa98ccaf8c867ea0fd520a7
>>> # Parent 4d997c5075c446963b6ac65155f2129c73257b6f
>>> dispatch: catch InterventionRequired and print the message with no prefix
>>> diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
>>> --- a/mercurial/dispatch.py
>>> +++ b/mercurial/dispatch.py
>>> @@ -151,6 +151,8 @@
>>> commands.help_(ui, inst.args, unknowncmd=True)
>>> except error.UnknownCommand:
>>> commands.help_(ui, 'shortlist')
>>> + except error.InterventionRequired, inst:
>>> + ui.warn("%s\n" % inst)
>> I find it annoying that we have several exception types where we just display the message without giving any hint of the exception type. Many of the messages would make much more sense if we also showed the exception type.
>> So I suggest using a prefix here, just like we do for abort.
>> Perhaps something like 'interrupted:' - I think that would could give a consistent hint that something important but not fatal happened. (The exception could perhaps also be called something with Interrupt.)
> I kinda like that idea. Not totally sold on 'interrupted', but having something that consistently reinforces that a process can be picked up again with a --continue option is nice.
Open to suggestions on that - I wanted a prefix but couldn't come up with one that was clear and suitably pithy.
> pacem in terris / мир / शान्ति / سَلاَم / 平和
> Kevin R. Bullock
More information about the Mercurial-devel