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

timeless timeless at gmail.com
Thu Dec 10 11:46:00 CST 2015


If those two are equivalent, we should split them.

If I'm asking `log -T list`, I'm asking for a list of styles, not a log.

If I ask for `log -T nosuch`, and nosuch doesn't exist, then that's an error.

I'm happy to write the code to split these cases.

On Thu, Dec 10, 2015 at 10:49 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> On Wed, 09 Dec 2015 12:31:25 -0600, 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"))
>
> I think it's acceptable to exit with an error because "log -Tlist" is
> equivalent to the deprecated "log --style nosuch" option. And the log command
> doesn't finish its job.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list