--- a/mercurial/templatekw.py Sun Apr 24 19:15:34 2016 +0900
+++ b/mercurial/templatekw.py Tue Apr 04 22:19:02 2017 +0900
@@ -35,8 +35,6 @@
self.values = values
self._makemap = makemap
self.joinfmt = joinfmt
- def __iter__(self):
- return self.gen
def itermaps(self):
makemap = self._makemap
for x in self.values:
@@ -50,6 +48,13 @@
raise AttributeError(name)
return getattr(self.values, name)
+def unwraphybrid(thing):
+ """Return an object which can be stringified possibly by using a legacy
+ template"""
+ if not util.safehasattr(thing, 'gen'):
+ return thing
+ return thing.gen
+
def showlist(name, values, plural=None, element=None, separator=' ', **args):
if not element:
element = name