Patchwork [3,of,7] hgweb: wrap {nodes} of graph with mappinggenerator

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

Comments

Yuya Nishihara - May 25, 2018, 1:54 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1522842480 -32400
#      Wed Apr 04 20:48:00 2018 +0900
# Node ID 84207009ae46b829c61e9fcc5f5cd6d91ab90188
# Parent  7758a9a1f49b02dea023ab970e65af1874e6d636
hgweb: wrap {nodes} of graph with mappinggenerator

It was a generator of mappings, which shouldn't be put in template mappings.

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1330,7 +1330,7 @@  def graph(web):
                    'vertex': vtx,
                    'edges': edges}
 
-    def nodes():
+    def nodes(context):
         parity = paritygen(web.stripecount)
         for row, (id, type, ctx, vtx, edges) in enumerate(tree):
             entry = webutil.commonentry(web.repo, ctx)
@@ -1367,7 +1367,7 @@  def graph(web):
         changesets=count,
         nextentry=templateutil.mappinglist(nextentry),
         jsdata=templateutil.mappinggenerator(jsdata),
-        nodes=lambda **x: nodes(),
+        nodes=templateutil.mappinggenerator(nodes),
         node=ctx.hex(),
         changenav=changenav)