Mercurial > hg
diff mercurial/templates/gitweb/map @ 29388:f694e20193f2
hgweb: display blamed revision once per block in annotate view
I.e. when a revision blames a block of source lines, only display the
revision link on the first line of the block (this is identified by the
"blockhead" key in annotate context).
This addresses item "Visual grouping of changesets" of the blame improvements
plan (https://www.mercurial-scm.org/wiki/BlamePlan) which states: "Typically
there are block of lines all attributed to the same revision. Instead of
rendering the revision/changeset for every line, we could only render it once
per block."
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Tue, 07 Jun 2016 12:10:01 +0200 |
parents | 6b77adc2c7b5 |
children | 9c37df347485 |
line wrap: on
line diff
--- a/mercurial/templates/gitweb/map Thu Jun 02 16:26:50 2016 +0200 +++ b/mercurial/templates/gitweb/map Tue Jun 07 12:10:01 2016 +0200 @@ -97,8 +97,10 @@ annotateline = ' <tr id="{lineid}" style="font-family:monospace" class="parity{parity}{ifeq(node, originalnode, ' thisrev')}"> <td class="linenr" style="text-align: right;"> - <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}" - title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a> + {if(blockhead, + '<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}" + title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>', + '')} </td> <td><pre><a class="linenr" href="#{lineid}">{linenumber}</a></pre></td> <td><pre>{line|escape}</pre></td>