Mercurial > hg
changeset 18388:083daee1b749
hgweb: simplify return value creation in for navgen
We now have access to better syntax allowing a clearer version.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 14 Jan 2013 16:52:35 +0100 |
parents | 39616410aa32 |
children | 82572533bc00 |
files | mercurial/hgweb/webutil.py |
diffstat | 1 files changed, 3 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py Thu Jan 10 18:55:50 2013 +0100 +++ b/mercurial/hgweb/webutil.py Mon Jan 14 16:52:35 2013 +0100 @@ -70,13 +70,9 @@ except error.RepoError: pass - def gen(l): - def f(**map): - for label, node in l: - yield {"label": label, "node": node} - return f - - return (dict(before=gen(navbefore), after=gen(navafter)),) + data = lambda i: {"label": i[0], "node": i[1]} + return ({'before': lambda **map: (data(i) for i in navbefore), + 'after': lambda **map: (data(i) for i in navafter)},) def _siblings(siblings=[], hiderev=None): siblings = [s for s in siblings if s.node() != nullid]