hgweb: wrap {annotate} with mappinggenerator
authorYuya Nishihara <yuya@tcha.org>
Wed, 04 Apr 2018 20:28:51 +0900
changeset 38137 3e6253438bf9
parent 38136 e4a43d261715
child 38138 8e9ce73ceb15
hgweb: wrap {annotate} with mappinggenerator No bare generator of mappings should be put in a template mapping.
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Wed Apr 04 20:24:04 2018 +0900
+++ b/mercurial/hgweb/webcommands.py	Wed Apr 04 20:28:51 2018 +0900
@@ -943,7 +943,7 @@
         for p in parentscache[rev]:
             yield p
 
-    def annotate(**map):
+    def annotate(context):
         if fctx.isbinary():
             mt = (mimetypes.guess_type(fctx.path())[0]
                   or 'application/octet-stream')
@@ -986,7 +986,7 @@
     return web.sendtemplate(
         'fileannotate',
         file=f,
-        annotate=annotate,
+        annotate=templateutil.mappinggenerator(annotate),
         path=webutil.up(f),
         symrev=webutil.symrevorshortnode(web.req, fctx),
         rename=webutil.renamelink(fctx),