# HG changeset patch # User Yuya Nishihara # Date 1522597166 -32400 # Node ID 26aed0d561e804e1bee9dec3b2a48b043d0cbfc7 # Parent ec03f3aa2d14a53b370c36290d8c765c7ccaf72b hgweb: wrap {changelogtag}, {changesettag}, and {changesetbookmark} These can't be hybrid lists as they've associated with named template, 't1'. diff -r ec03f3aa2d14 -r 26aed0d561e8 mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Mon Apr 02 00:29:31 2018 +0900 +++ b/mercurial/hgweb/webutil.py Mon Apr 02 00:39:26 2018 +0900 @@ -274,15 +274,17 @@ branches.append(branch) return templateutil.hybridlist(branches, name='name') +def _nodenamesgen(context, f, node, name): + for t in f(node): + yield {name: t} + def showtag(repo, tmpl, t1, node=nullid): - for t in repo.nodetags(node): - lm = {'tag': t} - yield tmpl.generate(t1, lm) + args = (repo.nodetags, node, 'tag') + return templateutil.mappinggenerator(_nodenamesgen, args=args, name=t1) def showbookmark(repo, tmpl, t1, node=nullid): - for t in repo.nodebookmarks(node): - lm = {'bookmark': t} - yield tmpl.generate(t1, lm) + args = (repo.nodebookmarks, node, 'bookmark') + return templateutil.mappinggenerator(_nodenamesgen, args=args, name=t1) def branchentries(repo, stripecount, limit=0): tips = []