# HG changeset patch # User Yuya Nishihara # Date 1521376543 -32400 # Node ID 7d94fe3ea0ac5dd91f03b5c705552b64df599ca8 # Parent 47aea60d114d9886dbc89f34c1325420206b082a hgweb: fix summary {tags} and {shortlog} to not forcibly expand template The same sort of bug as the previous patch. In this case, JSON template was wrong. diff -r 47aea60d114d -r 7d94fe3ea0ac mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Sun Mar 18 20:51:39 2018 +0900 +++ b/mercurial/hgweb/webcommands.py Sun Mar 18 21:35:43 2018 +0900 @@ -713,7 +713,7 @@ """ i = reversed(web.repo.tagslist()) - def tagentries(**map): + def tagentries(context): parity = paritygen(web.stripecount) count = 0 for k, n in i: @@ -724,12 +724,12 @@ if count > 10: # limit to 10 tags break - yield web.tmpl.generate('tagentry', { + yield { 'parity': next(parity), 'tag': k, 'node': hex(n), 'date': web.repo[n].date(), - }) + } def bookmarks(**map): parity = paritygen(web.stripecount) @@ -742,7 +742,7 @@ 'date': web.repo[n].date(), 'node': hex(n)} - def changelist(**map): + def changelist(context): parity = paritygen(web.stripecount, offset=start - end) l = [] # build a list in forward order for efficiency revs = [] @@ -752,7 +752,7 @@ ctx = web.repo[i] lm = webutil.commonentry(web.repo, ctx) lm['parity'] = next(parity) - l.append(web.tmpl.generate('shortlogentry', lm)) + l.append(lm) for entry in reversed(l): yield entry @@ -771,10 +771,11 @@ desc=desc, owner=get_contact(web.config) or 'unknown', lastchange=tip.date(), - tags=tagentries, + tags=templateutil.mappinggenerator(tagentries, name='tagentry'), bookmarks=bookmarks, branches=webutil.branchentries(web.repo, web.stripecount, 10), - shortlog=changelist, + shortlog=templateutil.mappinggenerator(changelist, + name='shortlogentry'), node=tip.hex(), symrev='tip', archives=web.archivelist('tip'), diff -r 47aea60d114d -r 7d94fe3ea0ac mercurial/templates/gitweb/summary.tmpl --- a/mercurial/templates/gitweb/summary.tmpl Sun Mar 18 20:51:39 2018 +0900 +++ b/mercurial/templates/gitweb/summary.tmpl Sun Mar 18 21:35:43 2018 +0900 @@ -36,13 +36,13 @@
changes
-{shortlog} +{shortlog%shortlogentry}
...
tags
-{tags} +{tags%tagentry}
...
diff -r 47aea60d114d -r 7d94fe3ea0ac mercurial/templates/monoblue/summary.tmpl --- a/mercurial/templates/monoblue/summary.tmpl Sun Mar 18 20:51:39 2018 +0900 +++ b/mercurial/templates/monoblue/summary.tmpl Sun Mar 18 21:35:43 2018 +0900 @@ -39,7 +39,7 @@

Changes

-{shortlog} +{shortlog%shortlogentry} @@ -47,7 +47,7 @@

Tags

...
-{tags} +{tags%tagentry}
...