On Mon, May 21, 2018 at 5:22 AM, Yuya Nishihara <y...@tcha.org> wrote:
> # HG changeset patch > # User Yuya Nishihara <y...@tcha.org> > # Date 1522840791 -32400 > # Wed Apr 04 20:19:51 2018 +0900 > # Node ID 56e8ac64a7a3d529a596778d16ffc442a87f96e6 > # Parent 9bf0bd4d7a2e44be4b15f8e1d51eb6d562e509e8 > hgweb: wrap {entries}* of bookmarks with mappinggenerator > Queued this series. Thanks. > > They were functions returning a generator of mappings. The laziness is > handled by the mappinggenerator class. > > diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands. > py > --- a/mercurial/hgweb/webcommands.py > +++ b/mercurial/hgweb/webcommands.py > @@ -648,7 +648,7 @@ def bookmarks(web): > 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 @@ def bookmarks(web): > '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): > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel >
_______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel