hgweb: wrap {parents} of {annotate} with mappinggenerator
authorYuya Nishihara <yuya@tcha.org>
Wed, 04 Apr 2018 20:29:58 +0900
changeset 38138 8e9ce73ceb15
parent 38137 3e6253438bf9
child 38139 d32f07069dd1
hgweb: wrap {parents} of {annotate} with mappinggenerator It's a generator of at most two mappings, which has to be wrapped.
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Wed Apr 04 20:28:51 2018 +0900
+++ b/mercurial/hgweb/webcommands.py	Wed Apr 04 20:29:58 2018 +0900
@@ -929,7 +929,7 @@
     # TODO there are still redundant operations within basefilectx.parents()
     # and from the fctx.annotate() call itself that could be cached.
     parentscache = {}
-    def parents(f):
+    def parents(context, f):
         rev = f.rev()
         if rev not in parentscache:
             parentscache[rev] = []
@@ -967,7 +967,7 @@
                    "node": f.hex(),
                    "rev": rev,
                    "author": f.user(),
-                   "parents": parents(f),
+                   "parents": templateutil.mappinggenerator(parents, args=(f,)),
                    "desc": f.description(),
                    "extra": f.extra(),
                    "file": f.path(),