# HG changeset patch # User Yuya Nishihara # Date 2018-04-03 13:55:33 # Node ID 3dc4045db1642df47b0f6b2b9d5c900d85e94300 # Parent 10d3dc8123c5a427be7ea0b40a272d5455e85edb hgweb: wrap {whyunstable} with mappinggenerator This is also a generator of mappings, which needs a wrapper. diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -392,7 +392,7 @@ def succsandmarkers(context, mapping): # teach templater succsandmarkers is switched to (context, mapping) API succsandmarkers._requires = {'repo', 'ctx'} -def whyunstable(context, mapping): +def _whyunstablegen(context, mapping): repo = context.resource(mapping, 'repo') ctx = context.resource(mapping, 'ctx') @@ -402,6 +402,9 @@ def whyunstable(context, mapping): entry['divergentnodes'] = _siblings(entry['divergentnodes']) yield entry +def whyunstable(context, mapping): + return templateutil.mappinggenerator(_whyunstablegen, args=(mapping,)) + whyunstable._requires = {'repo', 'ctx'} def commonentry(repo, ctx):