changeset 37953:4237d07fad2c

hgweb: use template context to render {files} of changelist entries This is a preferred way to process nested templates.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 03 Apr 2018 23:33:54 +0900
parents 028d7c24f2e5
children 9482498b96b0
files mercurial/hgweb/webutil.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py	Tue Apr 03 23:32:16 2018 +0900
+++ b/mercurial/hgweb/webutil.py	Tue Apr 03 23:33:54 2018 +0900
@@ -509,15 +509,15 @@
         archives=web.archivelist(ctx.hex()),
         **pycompat.strkwargs(commonentry(web.repo, ctx)))
 
-def _listfilediffsgen(context, tmpl, files, node, max):
+def _listfilediffsgen(context, files, node, max):
     for f in files[:max]:
-        yield tmpl.generate('filedifflink', {'node': hex(node), 'file': f})
+        yield context.process('filedifflink', {'node': hex(node), 'file': f})
     if len(files) > max:
-        yield tmpl.generate('fileellipses', {})
+        yield context.process('fileellipses', {})
 
 def listfilediffs(tmpl, files, node, max):
     return templateutil.mappedgenerator(_listfilediffsgen,
-                                        args=(tmpl, files, node, max))
+                                        args=(files, node, max))
 
 def diffs(web, ctx, basectx, files, style, linerange=None,
           lineidprefix=''):