Patchwork [3,of,8] hgweb: wrap {bookmarks} of summary with mappinggenerator

login
register
mail settings
Submitter Yuya Nishihara
Date May 21, 2018, 12:22 p.m.
Message ID <7da55cdf4a0846788d92.1526905360@mimosa>
Download mbox | patch
Permalink /patch/31770/
State Accepted
Headers show

Comments

Yuya Nishihara - May 21, 2018, 12:22 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1522841044 -32400
#      Wed Apr 04 20:24:04 2018 +0900
# Node ID 7da55cdf4a0846788d92775adfec37de79c7a925
# Parent  45d63bc6a089475a963400047b3c9ee8dd75eeeb
hgweb: wrap {bookmarks} of summary with mappinggenerator

No bare generator of mappings should be put in a template mapping.

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -727,7 +727,7 @@  def summary(web):
                 'date': web.repo[n].date(),
             }
 
-    def bookmarks(**map):
+    def bookmarks(context):
         parity = paritygen(web.stripecount)
         marks = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
         sortkey = lambda b: (web.repo[b[1]].rev(), b[0])
@@ -769,7 +769,7 @@  def summary(web):
         owner=get_contact(web.config) or 'unknown',
         lastchange=tip.date(),
         tags=templateutil.mappinggenerator(tagentries, name='tagentry'),
-        bookmarks=bookmarks,
+        bookmarks=templateutil.mappinggenerator(bookmarks),
         branches=webutil.branchentries(web.repo, web.stripecount, 10),
         shortlog=templateutil.mappinggenerator(changelist,
                                                name='shortlogentry'),