[PATCH 2 of 5] dispatch: catch InterventionRequired and print the message with no prefix

Mads Kiilerich mads at kiilerich.com
Sat Feb 9 05:39:00 CST 2013


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[0], 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.)

>       except util.Abort, inst:
>           ui.warn(_("abort: %s\n") % inst)
>           if inst.hint:

/Mads



More information about the Mercurial-devel mailing list