# HG changeset patch # User Yuya Nishihara # Date 1522597279 -32400 # Node ID 16c7a6ac8f94e27557a89695605c4e8e3e27cdcb # Parent 26aed0d561e804e1bee9dec3b2a48b043d0cbfc7 hgweb: drop tmpl argument from webutil.showtag() and showbookmark() It's replaced by a context argument passed to a mappinggenerator. diff -r 26aed0d561e8 -r 16c7a6ac8f94 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Mon Apr 02 00:39:26 2018 +0900 +++ b/mercurial/hgweb/webcommands.py Mon Apr 02 00:41:19 2018 +0900 @@ -295,7 +295,7 @@ for ctx in searchfunc[0](funcarg): count += 1 n = ctx.node() - showtags = webutil.showtag(web.repo, web.tmpl, 'changelogtag', n) + showtags = webutil.showtag(web.repo, 'changelogtag', n) files = webutil.listfilediffs(web.tmpl, ctx.files(), n, web.maxfiles) diff -r 26aed0d561e8 -r 16c7a6ac8f94 mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Mon Apr 02 00:39:26 2018 +0900 +++ b/mercurial/hgweb/webutil.py Mon Apr 02 00:41:19 2018 +0900 @@ -278,11 +278,11 @@ for t in f(node): yield {name: t} -def showtag(repo, tmpl, t1, node=nullid): +def showtag(repo, t1, node=nullid): args = (repo.nodetags, node, 'tag') return templateutil.mappinggenerator(_nodenamesgen, args=args, name=t1) -def showbookmark(repo, tmpl, t1, node=nullid): +def showbookmark(repo, t1, node=nullid): args = (repo.nodebookmarks, node, 'bookmark') return templateutil.mappinggenerator(_nodenamesgen, args=args, name=t1) @@ -437,7 +437,7 @@ repo = web.repo rev = ctx.rev() n = ctx.node() - showtags = showtag(repo, web.tmpl, 'changelogtag', n) + showtags = showtag(repo, 'changelogtag', n) files = listfilediffs(web.tmpl, ctx.files(), n, web.maxfiles) entry = commonentry(repo, ctx) @@ -459,9 +459,8 @@ def changesetentry(web, ctx): '''Obtain a dictionary to be used to render the "changeset" template.''' - showtags = showtag(web.repo, web.tmpl, 'changesettag', ctx.node()) - showbookmarks = showbookmark(web.repo, web.tmpl, 'changesetbookmark', - ctx.node()) + showtags = showtag(web.repo, 'changesettag', ctx.node()) + showbookmarks = showbookmark(web.repo, 'changesetbookmark', ctx.node()) showbranch = nodebranchnodefault(ctx) files = []