hgweb: wrap {entries}* of bookmarks with mappinggenerator
They were functions returning a generator of mappings. The laziness is
handled by the mappinggenerator class.
--- 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):