Patchwork [1,of,3] gitweb: add information about "linerange" filtering in filelog view

login
register
mail settings
Submitter Denis Laxalde
Date April 13, 2017, 9:05 a.m.
Message ID <9696387c1d02ac29d3c9.1492074319@sh77.tls.logilab.fr>
Download mbox | patch
Permalink /patch/20157/
State Accepted
Headers show

Comments

Denis Laxalde - April 13, 2017, 9:05 a.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1492070398 -7200
#      Thu Apr 13 09:59:58 2017 +0200
# Node ID 9696387c1d02ac29d3c9384ec37419aed2924f53
# Parent  6ce09d2cc2db6aeed0b46da1b26426798d91833c
# Available At http://hg.logilab.org/users/dlaxalde/hg
#              hg pull http://hg.logilab.org/users/dlaxalde/hg -r 9696387c1d02
# EXP-Topic followlines/gitweb
gitweb: add information about "linerange" filtering in filelog view

As for paper style, in 5e6d44511317, we display a "(following lines
<fromline>:<toline> <a href='...'>back to filelog</a>)" message alongside the
file name when "linerange" query parameter is present.

Patch

diff --git a/mercurial/templates/gitweb/filelog.tmpl b/mercurial/templates/gitweb/filelog.tmpl
--- a/mercurial/templates/gitweb/filelog.tmpl
+++ b/mercurial/templates/gitweb/filelog.tmpl
@@ -31,7 +31,10 @@  revisions |
 {nav%filenav}
 </div>
 
-<div class="title" >{file|urlescape}</div>
+<div class="title" >
+  {file|urlescape}{if(linerange,
+' (following lines {linerange}{if(descend, ', descending')} <a href="{url|urlescape}log/{symrev}/{file|urlescape}{sessionvars%urlparameter}">back to filelog</a>)')}
+</div>
 
 <table>
 {entries%filelogentry}