Patchwork [6,of,7] hgweb: wrap {earlycommands} and {othercommands} of help with mappinggenerator

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

Comments

Yuya Nishihara - May 25, 2018, 1:54 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1522842796 -32400
#      Wed Apr 04 20:53:16 2018 +0900
# Node ID 772811dd496236017bb0e630b935720da76dbcf0
# Parent  1aeb71c032cb8e73e868426b61d27c9ca7b7c826
hgweb: wrap {earlycommands} and {othercommands} of help with mappinggenerator

They were generators 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
@@ -1417,19 +1417,19 @@  def help(web):
         early.sort()
         other.sort()
 
-        def earlycommands(**map):
+        def earlycommands(context):
             for c, doc in early:
                 yield {'topic': c, 'summary': doc}
 
-        def othercommands(**map):
+        def othercommands(context):
             for c, doc in other:
                 yield {'topic': c, 'summary': doc}
 
         return web.sendtemplate(
             'helptopics',
             topics=templateutil.mappinggenerator(topics),
-            earlycommands=earlycommands,
-            othercommands=othercommands,
+            earlycommands=templateutil.mappinggenerator(earlycommands),
+            othercommands=templateutil.mappinggenerator(othercommands),
             title='Index')
 
     # Render an index of sub-topics.