[PATCH] spartan: don't drop current revision in log/graph links

Anton Shestakov av6 at dwimlabs.net
Wed Jul 15 13:28:28 CDT 2015


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1436637061 -28800
#      Sun Jul 12 01:51:01 2015 +0800
# Node ID f1893d1ddc92e4c0f8dfdb9a9521a32365109c61
# Parent  6d805d15ba0927324c4bb068e6df10d69fc90e80
spartan: don't drop current revision in log/graph links

Just to be consistent with log and shortlog links, graph links should have a
revision context too. And the same goes for the graph page, where it's log and
shortlog links that should have context.

diff --git a/mercurial/templates/spartan/changelog.tmpl b/mercurial/templates/spartan/changelog.tmpl
--- a/mercurial/templates/spartan/changelog.tmpl
+++ b/mercurial/templates/spartan/changelog.tmpl
@@ -9,7 +9,7 @@
 
 <div class="buttons">
 <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
 <a href="{url|urlescape}file/{symrev}{sessionvars%urlparameter}">files</a>
diff --git a/mercurial/templates/spartan/changeset.tmpl b/mercurial/templates/spartan/changeset.tmpl
--- a/mercurial/templates/spartan/changeset.tmpl
+++ b/mercurial/templates/spartan/changeset.tmpl
@@ -6,7 +6,7 @@
 <div class="buttons">
 <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a>
 <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
 <a href="{url|urlescape}file/{symrev}{sessionvars%urlparameter}">files</a>
diff --git a/mercurial/templates/spartan/fileannotate.tmpl b/mercurial/templates/spartan/fileannotate.tmpl
--- a/mercurial/templates/spartan/fileannotate.tmpl
+++ b/mercurial/templates/spartan/fileannotate.tmpl
@@ -6,7 +6,7 @@
 <div class="buttons">
 <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a>
 <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
 <a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a>
diff --git a/mercurial/templates/spartan/filediff.tmpl b/mercurial/templates/spartan/filediff.tmpl
--- a/mercurial/templates/spartan/filediff.tmpl
+++ b/mercurial/templates/spartan/filediff.tmpl
@@ -6,7 +6,7 @@
 <div class="buttons">
 <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a>
 <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
 <a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a>
diff --git a/mercurial/templates/spartan/filerevision.tmpl b/mercurial/templates/spartan/filerevision.tmpl
--- a/mercurial/templates/spartan/filerevision.tmpl
+++ b/mercurial/templates/spartan/filerevision.tmpl
@@ -6,7 +6,7 @@
 <div class="buttons">
 <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a>
 <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
 <a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a>
diff --git a/mercurial/templates/spartan/graph.tmpl b/mercurial/templates/spartan/graph.tmpl
--- a/mercurial/templates/spartan/graph.tmpl
+++ b/mercurial/templates/spartan/graph.tmpl
@@ -9,8 +9,8 @@
 <body>
 
 <div class="buttons">
-<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a>
-<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
 <a href="{url|urlescape}file/{symrev}/{sessionvars%urlparameter}">files</a>
diff --git a/mercurial/templates/spartan/manifest.tmpl b/mercurial/templates/spartan/manifest.tmpl
--- a/mercurial/templates/spartan/manifest.tmpl
+++ b/mercurial/templates/spartan/manifest.tmpl
@@ -6,7 +6,7 @@
 <div class="buttons">
 <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a>
 <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
 <a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a>
diff --git a/mercurial/templates/spartan/shortlog.tmpl b/mercurial/templates/spartan/shortlog.tmpl
--- a/mercurial/templates/spartan/shortlog.tmpl
+++ b/mercurial/templates/spartan/shortlog.tmpl
@@ -9,7 +9,7 @@
 
 <div class="buttons">
 <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a>
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
 <a href="{url|urlescape}file/{symrev}/{sessionvars%urlparameter}">files</a>
diff --git a/tests/test-hgweb-descend-empties.t b/tests/test-hgweb-descend-empties.t
--- a/tests/test-hgweb-descend-empties.t
+++ b/tests/test-hgweb-descend-empties.t
@@ -508,7 +508,7 @@ manifest with descending (spartan)
   <div class="buttons">
   <a href="/log/tip?style=spartan">changelog</a>
   <a href="/shortlog/tip?style=spartan">shortlog</a>
-  <a href="/graph?style=spartan">graph</a>
+  <a href="/graph/tip?style=spartan">graph</a>
   <a href="/tags?style=spartan">tags</a>
   <a href="/branches?style=spartan">branches</a>
   <a href="/rev/tip?style=spartan">changeset</a>
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
@@ -847,6 +847,7 @@ Set up the repo
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=spartan' | egrep $REVLINKS
   <a href="/log/tip?style=spartan">changelog</a>
+  <a href="/graph/tip?style=spartan">graph</a>
   <a href="/file/tip/?style=spartan">files</a>
   <a href="/archive/tip.zip">zip</a> 
   navigate: <small class="navigate"><a href="/shortlog/43c799df6e75?style=spartan">(0)</a> <a href="/shortlog/tip?style=spartan">tip</a> </small>
@@ -857,6 +858,7 @@ Set up the repo
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?style=spartan' | egrep $REVLINKS
   <a href="/shortlog/tip?style=spartan">shortlog</a>
+  <a href="/graph/tip?style=spartan">graph</a>
   <a href="/file/tip?style=spartan">files</a>
   <a href="/archive/tip.zip">zip</a> 
   navigate: <small class="navigate"><a href="/log/43c799df6e75?style=spartan">(0)</a>  <a href="/log/tip?style=spartan">tip</a> </small>
@@ -872,6 +874,8 @@ Set up the repo
   navigate: <small class="navigate"><a href="/log/43c799df6e75?style=spartan">(0)</a>  <a href="/log/tip?style=spartan">tip</a> </small>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph?style=spartan' | egrep $REVLINKS
+  <a href="/log/tip?style=spartan">changelog</a>
+  <a href="/shortlog/tip?style=spartan">shortlog</a>
   <a href="/file/tip/?style=spartan">files</a>
   navigate: <small class="navigate"><a href="/graph/43c799df6e75?style=spartan">(0)</a> <a href="/graph/tip?style=spartan">tip</a> </small>
   navigate: <small class="navigate"><a href="/graph/43c799df6e75?style=spartan">(0)</a> <a href="/graph/tip?style=spartan">tip</a> </small>
@@ -885,6 +889,7 @@ Set up the repo
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=spartan' | egrep $REVLINKS
   <a href="/log/tip?style=spartan">changelog</a>
   <a href="/shortlog/tip?style=spartan">shortlog</a>
+  <a href="/graph/tip?style=spartan">graph</a>
   <a href="/rev/tip?style=spartan">changeset</a>
   <a href="/archive/tip.zip">zip</a> 
   <h2><a href="/">Mercurial</a>  / files for changeset <a href="/rev/9d8c40cba617">9d8c40cba617</a>: /</h2>
@@ -912,6 +917,7 @@ Set up the repo
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
+  <a href="/graph/xyzzy?style=spartan">graph</a>
   <a href="/file/xyzzy?style=spartan">files</a>
   <a href="/raw-rev/xyzzy">raw</a>
   <a href="/archive/xyzzy.zip">zip</a> 
@@ -922,6 +928,7 @@ Set up the repo
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
+  <a href="/graph/xyzzy?style=spartan">graph</a>
   <a href="/file/xyzzy/?style=spartan">files</a>
   <a href="/archive/xyzzy.zip">zip</a> 
   navigate: <small class="navigate"><a href="/shortlog/43c799df6e75?style=spartan">(0)</a> <a href="/shortlog/tip?style=spartan">tip</a> </small>
@@ -931,6 +938,7 @@ Set up the repo
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
+  <a href="/graph/xyzzy?style=spartan">graph</a>
   <a href="/file/xyzzy?style=spartan">files</a>
   <a href="/archive/xyzzy.zip">zip</a> 
   navigate: <small class="navigate"><a href="/log/43c799df6e75?style=spartan">(0)</a>  <a href="/log/tip?style=spartan">tip</a> </small>
@@ -943,6 +951,8 @@ Set up the repo
   navigate: <small class="navigate"><a href="/log/43c799df6e75?style=spartan">(0)</a>  <a href="/log/tip?style=spartan">tip</a> </small>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/xyzzy?style=spartan' | egrep $REVLINKS
+  <a href="/log/xyzzy?style=spartan">changelog</a>
+  <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
   <a href="/file/xyzzy/?style=spartan">files</a>
   navigate: <small class="navigate"><a href="/graph/43c799df6e75?style=spartan">(0)</a> <a href="/graph/tip?style=spartan">tip</a> </small>
   navigate: <small class="navigate"><a href="/graph/43c799df6e75?style=spartan">(0)</a> <a href="/graph/tip?style=spartan">tip</a> </small>
@@ -950,6 +960,7 @@ Set up the repo
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
+  <a href="/graph/xyzzy?style=spartan">graph</a>
   <a href="/rev/xyzzy?style=spartan">changeset</a>
   <a href="/archive/xyzzy.zip">zip</a> 
   <h2><a href="/">Mercurial</a>  / files for changeset <a href="/rev/a7c1559b7bba">a7c1559b7bba</a>: /</h2>
@@ -961,6 +972,7 @@ Set up the repo
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
+  <a href="/graph/xyzzy?style=spartan">graph</a>
   <a href="/rev/xyzzy?style=spartan">changeset</a>
   <a href="/file/xyzzy/?style=spartan">files</a>
   <a href="/log/xyzzy/foo?style=spartan">revisions</a>
@@ -990,6 +1002,7 @@ Set up the repo
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
+  <a href="/graph/xyzzy?style=spartan">graph</a>
   <a href="/rev/xyzzy?style=spartan">changeset</a>
   <a href="/file/xyzzy/?style=spartan">files</a>
   <a href="/file/xyzzy/foo?style=spartan">file</a>
@@ -1004,6 +1017,7 @@ Set up the repo
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
+  <a href="/graph/xyzzy?style=spartan">graph</a>
   <a href="/rev/xyzzy?style=spartan">changeset</a>
   <a href="/file/xyzzy/foo?style=spartan">file</a>
   <a href="/log/xyzzy/foo?style=spartan">revisions</a>


More information about the Mercurial-devel mailing list