[PATCH 3 of 5 V2] templater: add parsing rule for key-value pair

Yuya Nishihara yuya at tcha.org
Mon Apr 10 08:19:39 EDT 2017


On Mon, 10 Apr 2017 10:46:29 +0100, Ryan McElroy wrote:
> On 4/8/17 2:06 PM, Yuya Nishihara wrote:
> > # HG changeset patch
> > # User Yuya Nishihara <yuya at tcha.org>
> > # Date 1491220555 -32400
> > #      Mon Apr 03 20:55:55 2017 +0900
> > # Node ID 0a547405070213e075162d45f37a2d82877c61c3
> > # Parent  50cbe5f6c63fb73cdb06f80c9ea5a7e263e0cc84
> > templater: add parsing rule for key-value pair

> > @@ -2668,7 +2680,7 @@ Error in nested template:
> >     hg: parse error at 2: unterminated string
> >     [255]
> >   
> > -  $ hg log -T '{"foo{date|=}"}'
> > +  $ hg log -T '{"foo{date|?}"}'
> >     hg: parse error at 11: syntax error
> >     [255]
> 
> Why remove the |? test? I'd prefer you just add another for |= as 
> opposed to replace the existing test.

This checks a parsing error in inner template, so any kind of parsing
errors should be okay. I just prefer using '?' which can trigger more
obvious error than '='.


More information about the Mercurial-devel mailing list