mercurial/templateutil.py
changeset 37502 40c7347f6848
parent 37499 75c13343cf38
child 38224 61cecab0cc20
--- a/mercurial/templateutil.py	Thu Mar 15 21:09:37 2018 +0900
+++ b/mercurial/templateutil.py	Sat Mar 17 23:34:38 2018 +0900
@@ -200,7 +200,14 @@
         return self.join(context, mapping, self._defaultsep)
 
     def tovalue(self, context, mapping):
-        return list(self.itermaps(context))
+        knownres = context.knownresourcekeys()
+        items = []
+        for nm in self.itermaps(context):
+            # drop internal resources (recursively) which shouldn't be displayed
+            lm = context.overlaymap(mapping, nm)
+            items.append({k: unwrapvalue(context, lm, v)
+                          for k, v in nm.iteritems() if k not in knownres})
+        return items
 
 class mappinggenerator(_mappingsequence):
     """Wrapper for generator of template mappings