diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -26,14 +26,11 @@ from . import ( # "{get(extras, key)}" class _hybrid(object): - def __init__(self, gen, values, makemap, joinfmt=None): + def __init__(self, gen, values, makemap, joinfmt): self.gen = gen self.values = values self._makemap = makemap - if joinfmt: - self.joinfmt = joinfmt - else: - self.joinfmt = lambda x: x.values()[0] + self.joinfmt = joinfmt def __iter__(self): return self.gen def itermaps(self): @@ -53,7 +50,7 @@ def showlist(name, values, plural=None, if not element: element = name f = _showlist(name, values, plural, separator, **args) - return _hybrid(f, values, lambda x: {element: x}) + return _hybrid(f, values, lambda x: {element: x}, lambda d: d[element]) def _showlist(name, values, plural=None, separator=' ', **args): '''expand set of values.