Patchwork [5,of,7] hgweb: wrap {topics}es of help with mappinggenerator or mappinglist

login
register
mail settings
Submitter Yuya Nishihara
Date May 25, 2018, 1:54 p.m.
Message ID <1aeb71c032cb8e73e868.1527256455@mimosa>
Download mbox | patch
Permalink /patch/31855/
State Accepted
Headers show

Comments

Yuya Nishihara - May 25, 2018, 1:54 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# 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.

Patch

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)