Mercurial > hg
diff mercurial/hgweb/webcommands.py @ 38062:17f7b44367bb
hgweb: wrap {fentries} and {dentries} of manifest with mappinggenerator
They were functions returning a generator of mappings.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 04 Apr 2018 20:14:19 +0900 |
parents | d3b4c4769b5c |
children | 3c995af3066e |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Wed Apr 04 20:11:20 2018 +0900 +++ b/mercurial/hgweb/webcommands.py Wed Apr 04 20:14:19 2018 +0900 @@ -556,7 +556,7 @@ if mf and not files and not dirs: raise ErrorResponse(HTTP_NOT_FOUND, 'path not found: ' + path) - def filelist(**map): + def filelist(context): for f in sorted(files): full = files[f] @@ -568,7 +568,7 @@ "size": fctx.size(), "permissions": mf.flags(full)} - def dirlist(**map): + def dirlist(context): for d in sorted(dirs): emptydirs = [] @@ -591,8 +591,8 @@ path=abspath, up=webutil.up(abspath), upparity=next(parity), - fentries=filelist, - dentries=dirlist, + fentries=templateutil.mappinggenerator(filelist), + dentries=templateutil.mappinggenerator(dirlist), archives=web.archivelist(hex(node)), **pycompat.strkwargs(webutil.commonentry(web.repo, ctx)))