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

timeless timeless at gmail.com
Tue Dec 15 11:21:13 CST 2015


> 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.
So, this isn't what happens -- at all.
First of all, they're already split up. Second, nosuch is not an
error, and the reason is that:

-T and --style are not equivalent.

Here's what happens for both (with the above patch applied):

[timeless at gcc2-power8 crew]$ hg log --style foeey; echo $?; hg log
--style list; echo $?; hg log -Tlist; echo $?; hg log -Tlisto -r .;
echo $?
abort: style 'foeey' not found
(available styles: bisect, changelog, compact, default, phases, status, xml)
255
abort: style 'list' not found
(available styles: bisect, changelog, compact, default, phases, status, xml)
255
available styles: bisect, changelog, compact, default, phases, status, xml
0
listo
0

Specifically, -T takes strings and will use them as templates, and it
will succeed (return 0)

Augie was ok w/ me making -Tlist not be an error, and I'm still
confident it's the right behavior given the intent of -Tlist.

On Fri, Dec 11, 2015 at 8:30 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> On Thu, 10 Dec 2015 12:46:00 -0500, timeless wrote:
>> 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.
>
> It sounds strange to me that "log -T $valid_template" shows log, but
> "log -T list" doesn't and both exit with 0. So I consider "list" as the
> special style name to error out.


More information about the Mercurial-devel mailing list