hgweb: wrap {entries}* of bookmarks with mappinggenerator
authorYuya Nishihara <yuya@tcha.org>
Wed, 04 Apr 2018 20:19:51 +0900
changeset 38134 edacd831afab
parent 38133 dce718404ce6
child 38135 5e94d07b290a
hgweb: wrap {entries}* of bookmarks with mappinggenerator They were functions returning a generator of mappings. The laziness is handled by the mappinggenerator class.
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Wed May 23 03:13:04 2018 +0530
+++ b/mercurial/hgweb/webcommands.py	Wed Apr 04 20:19:51 2018 +0900
@@ -648,7 +648,7 @@
     i = sorted(i, key=sortkey, reverse=True)
     parity = paritygen(web.stripecount)
 
-    def entries(latestonly, **map):
+    def entries(context, latestonly):
         t = i
         if latestonly:
             t = i[:1]
@@ -667,8 +667,8 @@
         'bookmarks',
         node=hex(web.repo.changelog.tip()),
         lastchange=[{'date': web.repo[latestrev].date()}],
-        entries=lambda **x: entries(latestonly=False, **x),
-        latestentry=lambda **x: entries(latestonly=True, **x))
+        entries=templateutil.mappinggenerator(entries, args=(False,)),
+        latestentry=templateutil.mappinggenerator(entries, args=(True,)))
 
 @webcommand('branches')
 def branches(web):