[PATCH 2 of 2] formatter: lookuptemplate make -Tlist exit without an error

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Dec 10 14:52:11 CST 2015



On 12/09/2015 06:31 PM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1449685780 0
> #      Wed Dec 09 18:29:40 2015 +0000
> # Node ID 4420c4fda75e7eb246cd6ed04620f61507bd7f45
> # Parent  2f84f71b9b546f121e9f94771e268b3b0cef0956
> formatter: lookuptemplate make -Tlist exit without an error
>
> diff --git a/mercurial/formatter.py b/mercurial/formatter.py
> --- a/mercurial/formatter.py
> +++ b/mercurial/formatter.py
> @@ -179,7 +179,7 @@
>
>       if tmpl == 'list':
>           ui.write(_("available styles: %s\n") % templater.stylelist())
> -        raise error.Abort(_("specify a template"))
> +        raise error.EarlyNormalExit(_("templates listed"))

using exception in random code to denote normal execution flow scares 
me. Given that yuya have other feedback I'm dropping this series from 
patchwork.


>
>       # perhaps it's a path to a map or a template
>       if ('/' in tmpl or '\\' in tmpl) and os.path.isfile(tmpl):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list