# HG changeset patch # User Yuya Nishihara # Date 2018-04-04 11:29:58 # Node ID 8e9ce73ceb151348d20a443f9157b0d804350637 # Parent 3e6253438bf94495c228432c5b08e0fa8ac75474 hgweb: wrap {parents} of {annotate} with mappinggenerator It's a generator of at most two mappings, which has to be wrapped. diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -929,7 +929,7 @@ def annotate(web): # TODO there are still redundant operations within basefilectx.parents() # and from the fctx.annotate() call itself that could be cached. parentscache = {} - def parents(f): + def parents(context, f): rev = f.rev() if rev not in parentscache: parentscache[rev] = [] @@ -967,7 +967,7 @@ def annotate(web): "node": f.hex(), "rev": rev, "author": f.user(), - "parents": parents(f), + "parents": templateutil.mappinggenerator(parents, args=(f,)), "desc": f.description(), "extra": f.extra(), "file": f.path(),