templater: pass context to itermaps() for future extension
Unlike show() and tovalue(), a base mapping isn't passed to itermaps()
since it is the function to generate a partial mapping.
--- a/mercurial/templateutil.py Sat Mar 17 21:21:50 2018 +0900
+++ b/mercurial/templateutil.py Sun Mar 18 23:24:50 2018 +0900
@@ -38,7 +38,7 @@
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
- def itermaps(self):
+ def itermaps(self, context):
"""Yield each template mapping"""
@abc.abstractmethod
@@ -88,7 +88,7 @@
if i > 0:
yield ' '
yield self.joinfmt(x)
- def itermaps(self):
+ def itermaps(self, context):
makemap = self._makemap
for x in self._values:
yield makemap(x)
@@ -139,7 +139,7 @@
def tomap(self):
return self._makemap(self._key)
- def itermaps(self):
+ def itermaps(self, context):
yield self.tomap()
def show(self, context, mapping):
@@ -498,7 +498,7 @@
darg, targ = data
d = evalrawexp(context, mapping, darg)
if isinstance(d, wrapped):
- diter = d.itermaps()
+ diter = d.itermaps(context)
else:
try:
diter = iter(d)