[PATCH 9 of 9] template: use template-engine for obsfate
Yuya Nishihara
yuya at tcha.org
Wed Jul 12 09:33:50 EDT 2017
On Tue, 11 Jul 2017 12:44:52 -0700, Jun Wu wrote:
> Excerpts from Yuya Nishihara's message of 2017-07-12 00:06:13 +0900:
> > Well, I don't have expertise in the obsolete thingy, though I'm (unfortunately)
> > a template expert.
> >
> > Guessing from the PATCH 4, which has the following functions,
> >
> > obsfatedata: ctx => [succs, ...] => [(succs, markers), ...]
> >
> > maybe we'll want a template function which converts 'succs' to 'markers' ?
> > Let's call it 'relatedmarkers' here.
> >
> > relatedmarkers: succs => [marker, ...] (where marker is a _hybrid dict)
> >
> > Then, a part of {obsfate} could probably be written as:
> >
> > {successorsets % "{relatedmarkers(successorset)
> > % "{get(marker, "verb")} ..."}"}
>
> Is "get" necessary?
Maybe no. Good catch.
> It seems "%" is changing the "binding" here, so I wonder
> if it's possible to do something like:
>
> "{successorgroups %
> "{markers %
> "{user} did {operation} on {predecessors} and got {successors}"}"}"
I'm not sure if we need markers(node) or markers([node, ...]). markers(node)
can be a template keyword bound to the current ctx,
{successorgroups % "{groups % "{markers % ...}"}"}
but markers([node, ...]) can't because there's no concept of the current set
of nodes.
{successorgroups % "{markers(groups) % ...}"}
More information about the Mercurial-devel
mailing list