Mercurial > hg
changeset 38134:edacd831afab
hgweb: wrap {entries}* of bookmarks with mappinggenerator
They were functions returning a generator of mappings. The laziness is
handled by the mappinggenerator class.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 04 Apr 2018 20:19:51 +0900 |
parents | dce718404ce6 |
children | 5e94d07b290a |
files | mercurial/hgweb/webcommands.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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):