From patchwork Fri May 25 13:54:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5, of, 7] hgweb: wrap {topics}es of help with mappinggenerator or mappinglist From: Yuya Nishihara X-Patchwork-Id: 31855 Message-Id: <1aeb71c032cb8e73e868.1527256455@mimosa> To: mercurial-devel@mercurial-scm.org Date: Fri, 25 May 2018 22:54:15 +0900 # HG changeset patch # User Yuya Nishihara # Date 1522842709 -32400 # Wed Apr 04 20:51:49 2018 +0900 # Node ID 1aeb71c032cb8e73e868426b61d27c9ca7b7c826 # Parent 454b7e1cf3ab64286c7991fcd45985eb619d04ee hgweb: wrap {topics}es of help with mappinggenerator or mappinglist The former 'topics' was a generator function, and the latter was a list of mappings. diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -1398,7 +1398,7 @@ def help(web): topicname = web.req.qsparams.get('node') if not topicname: - def topics(**map): + def topics(context): for entries, summary, _doc in helpmod.helptable: yield {'topic': entries[0], 'summary': summary} @@ -1427,7 +1427,7 @@ def help(web): return web.sendtemplate( 'helptopics', - topics=topics, + topics=templateutil.mappinggenerator(topics), earlycommands=earlycommands, othercommands=othercommands, title='Index') @@ -1444,7 +1444,7 @@ def help(web): return web.sendtemplate( 'helptopics', - topics=topics, + topics=templateutil.mappinglist(topics), title=topicname, subindex=True)