[PATCH 4 of 8] hgweb: wrap {annotate} with mappinggenerator
Yuya Nishihara
yuya at tcha.org
Mon May 21 12:22:41 UTC 2018
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1522841331 -32400
# Wed Apr 04 20:28:51 2018 +0900
# Node ID 6970d3a9c6a4ee333a1a10abccfa40a8771af471
# Parent 7da55cdf4a0846788d92775adfec37de79c7a925
hgweb: wrap {annotate} with mappinggenerator
No bare generator of mappings should be put in a template mapping.
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -943,7 +943,7 @@ def annotate(web):
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 @@ def annotate(web):
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),
More information about the Mercurial-devel
mailing list