Patchwork [03,of,11] gitweb: add "more" and "less" navigation links in filelog template

login
register
mail settings
Submitter Denis Laxalde
Date Feb. 22, 2017, 3:09 p.m.
Message ID <0a725b74eeb2a8eca6d1.1487776197@sh77.tls.logilab.fr>
Download mbox | patch
Permalink /patch/18709/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Denis Laxalde - Feb. 22, 2017, 3:09 p.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1487761757 -3600
#      Wed Feb 22 12:09:17 2017 +0100
# Node ID 0a725b74eeb2a8eca6d1d82ba8ec8c2d188e8684
# Parent  af5922c52aef6f494cb7c7e9914f1ba987916ea2
# EXP-Topic linerange-log/hgweb-filelog
gitweb: add "more" and "less" navigation links in filelog template
Yuya Nishihara - Feb. 23, 2017, 3:03 p.m.
On Wed, 22 Feb 2017 16:09:57 +0100, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde@logilab.fr>
> # Date 1487761757 -3600
> #      Wed Feb 22 12:09:17 2017 +0100
> # Node ID 0a725b74eeb2a8eca6d1d82ba8ec8c2d188e8684
> # Parent  af5922c52aef6f494cb7c7e9914f1ba987916ea2
> # EXP-Topic linerange-log/hgweb-filelog
> gitweb: add "more" and "less" navigation links in filelog template

Queued the first 3 patches, thanks. I need more time to review the other
patches, hopefully tomorrow.

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
@@ -38,6 +38,8 @@  revisions |
 </table>
 
 <div class="page_nav">
+<a href="{url|urlescape}log/{symrev}/{file|urlescape}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}log/{symrev}/{file|urlescape}{morevars%urlparameter}">more</a>
 {nav%filenav}
 </div>
 
diff --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t
--- a/tests/test-hgweb-symrev.t
+++ b/tests/test-hgweb-symrev.t
@@ -616,6 +616,8 @@  Set up the repo
   <a href="/file/43c799df6e75/foo?style=gitweb">file</a> |
   <a href="/diff/43c799df6e75/foo?style=gitweb">diff</a> |
   <a href="/annotate/43c799df6e75/foo?style=gitweb">annotate</a>
+  <a href="/log/xyzzy/foo?revcount=30&style=gitweb">less</a>
+  <a href="/log/xyzzy/foo?revcount=120&style=gitweb">more</a>
   <a href="/log/43c799df6e75/foo?style=gitweb">(0)</a> <a href="/log/tip/foo?style=gitweb">tip</a> 
 
   $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=gitweb' | egrep $REVLINKS