hgweb: wrap {branches} and {entries} of branches with mappinggenerator
authorYuya Nishihara <yuya@tcha.org>
Mon, 02 Apr 2018 00:46:33 +0900
changeset 37913 89db78126f7f
parent 37912 16c7a6ac8f94
child 37914 10d3dc8123c5
hgweb: wrap {branches} and {entries} of branches with mappinggenerator Bare generator of mappings shouldn't be put in a template mapping because its type can't be determined without consuming it.
mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py	Mon Apr 02 00:41:19 2018 +0900
+++ b/mercurial/hgweb/webutil.py	Mon Apr 02 00:46:33 2018 +0900
@@ -292,7 +292,7 @@
     parity = paritygen(stripecount)
     sortkey = lambda item: (not item[1], item[0].rev())
 
-    def entries(**map):
+    def entries(context):
         count = 0
         if not tips:
             for tag, hs, tip, closed in repo.branchmap().iterbranches():
@@ -315,7 +315,7 @@
                 'date': ctx.date()
             }
 
-    return entries
+    return templateutil.mappinggenerator(entries)
 
 def cleanpath(repo, path):
     path = path.lstrip('/')