Template keyword for all "names"

Yuya Nishihara yuya at tcha.org
Tue Jan 12 10:00:40 CST 2016


On Mon, 11 Jan 2016 10:56:04 -0800, Gregory Szorc wrote:
> On Wed, Dec 23, 2015 at 8:38 PM, timeless <timeless at gmail.com> wrote:
> 
> > Would it be possible to do this with just a {namespaces} and a lot of %
> > magic?
> >
> > that would enable something theoretically of the form:
> >
> > {namespaces % "{name}:\t{{name}}\n"}
> >
> 
> I /think/ templatekw._hybrid can be used for this.
> 
> I tried to take a stab at implementing this, but I don't fully grok all the
> magic with _showlist() and _hybrid() :/ Is there any chance someone else
> can take a look before the code freeze so we can get something in 3.7?

Which is preferred?

 a) dict of list: '{namespaces % "{namespace}: {names % "{name} "}\n"}\n'
 b) flat list of (name, namespace): '{names % "{name} ({namespace})\n"}\n'
 c) flat set of names with list of namespaces:
    '{names % "{name} ({join(namespaces, ", ")})\n"}'

(b) won't be used as "{ifcontains(x, names, ...)}" because {names} can't be
a dict.


More information about the Mercurial-devel mailing list