changeset 25603:1cac419ab831

hgweb: don't dereference symbolic revision in spartan style Let's make spartan templates use symbolic revision in navigation links. The majority of links (log, filelog, annotate, etc) still use node hashes, and many pages also have permanent link to current node hash (i.e. you can go from /rev/tip to /rev/<tip hash> without manual url editing), so it's safe to update navigation.
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 16 Jun 2015 11:52:10 +0800
parents 85fb416f2fa7
children 0cdcbc477cac
files mercurial/templates/spartan/changelog.tmpl mercurial/templates/spartan/changeset.tmpl mercurial/templates/spartan/fileannotate.tmpl mercurial/templates/spartan/filediff.tmpl mercurial/templates/spartan/filelog.tmpl mercurial/templates/spartan/filerevision.tmpl mercurial/templates/spartan/graph.tmpl mercurial/templates/spartan/manifest.tmpl mercurial/templates/spartan/map mercurial/templates/spartan/shortlog.tmpl tests/test-hgweb-descend-empties.t tests/test-hgweb-filelog.t tests/test-hgweb-symrev.t
diffstat 13 files changed, 108 insertions(+), 108 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/spartan/changelog.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/changelog.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -8,11 +8,11 @@
 <body>
 
 <div class="buttons">
-<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a>
 <a href="{url|urlescape}graph{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/{node|short}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}file/{symrev}{sessionvars%urlparameter}">files</a>
 {archives%archiveentry}
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <a type="application/rss+xml" href="{url|urlescape}rss-log">rss</a>
--- a/mercurial/templates/spartan/changeset.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/changeset.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -4,13 +4,13 @@
 <body>
 
 <div class="buttons">
-<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url|urlescape}shortlog/{rev}{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}graph{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/{node|short}{sessionvars%urlparameter}">files</a>
-<a href="{url|urlescape}raw-rev/{node|short}">raw</a>
+<a href="{url|urlescape}file/{symrev}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}raw-rev/{symrev}">raw</a>
 {archives%archiveentry}
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
--- a/mercurial/templates/spartan/fileannotate.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/fileannotate.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -4,16 +4,16 @@
 <body>
 
 <div class="buttons">
-<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url|urlescape}shortlog/{rev}{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}graph{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/{node|short}{sessionvars%urlparameter}">changeset</a>
-<a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
-<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
-<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
-<a href="{url|urlescape}raw-annotate/{node|short}/{file|urlescape}">raw</a>
+<a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a>
+<a href="{url|urlescape}file/{symrev}{path|urlescape}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}file/{symrev}/{file|urlescape}{sessionvars%urlparameter}">file</a>
+<a href="{url|urlescape}log/{symrev}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+<a href="{url|urlescape}raw-annotate/{symrev}/{file|urlescape}">raw</a>
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
--- a/mercurial/templates/spartan/filediff.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/filediff.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -4,16 +4,16 @@
 <body>
 
 <div class="buttons">
-<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url|urlescape}shortlog/{rev}{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}graph{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/{node|short}{sessionvars%urlparameter}">changeset</a>
-<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
-<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
-<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
-<a href="{url|urlescape}raw-diff/{node|short}/{file|urlescape}">raw</a>
+<a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a>
+<a href="{url|urlescape}file/{symrev}/{file|urlescape}{sessionvars%urlparameter}">file</a>
+<a href="{url|urlescape}log/{symrev}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+<a href="{url|urlescape}annotate/{symrev}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+<a href="{url|urlescape}raw-diff/{symrev}/{file|urlescape}">raw</a>
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
--- a/mercurial/templates/spartan/filelog.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/filelog.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -13,8 +13,8 @@
 <a href="{url|urlescape}graph{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/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
-<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+<a href="{url|urlescape}file/{symrev}/{file|urlescape}{sessionvars%urlparameter}">file</a>
+<a href="{url|urlescape}annotate/{symrev}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <a type="application/rss+xml" href="{url|urlescape}rss-log/tip/{file|urlescape}">rss</a>
 <a type="application/atom+xml" href="{url|urlescape}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}">atom</a>
--- a/mercurial/templates/spartan/filerevision.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/filerevision.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -4,16 +4,16 @@
 <body>
 
 <div class="buttons">
-<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url|urlescape}shortlog/{rev}{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}graph{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/{node|short}{sessionvars%urlparameter}">changeset</a>
-<a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
-<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
-<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
-<a href="{url|urlescape}raw-file/{node|short}/{file|urlescape}">raw</a>
+<a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a>
+<a href="{url|urlescape}file/{symrev}{path|urlescape}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}log/{symrev}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+<a href="{url|urlescape}annotate/{symrev}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+<a href="{url|urlescape}raw-file/{symrev}/{file|urlescape}">raw</a>
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
--- a/mercurial/templates/spartan/graph.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/graph.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -13,7 +13,7 @@
 <a href="{url|urlescape}shortlog{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/{node|short}/{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}file/{symrev}/{sessionvars%urlparameter}">files</a>
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
--- a/mercurial/templates/spartan/manifest.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/manifest.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -4,12 +4,12 @@
 <body>
 
 <div class="buttons">
-<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url|urlescape}shortlog/{rev}{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}graph{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/{node|short}{sessionvars%urlparameter}">changeset</a>
+<a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a>
 {archives%archiveentry}
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
@@ -21,7 +21,7 @@
   <td><tt>drwxr-xr-x</tt>&nbsp;
   <td>&nbsp;
   <td>&nbsp;
-  <td><a href="{url|urlescape}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a>
+  <td><a href="{url|urlescape}file/{symrev}{up|urlescape}{sessionvars%urlparameter}">[up]</a>
 </tr>
 {dentries%direntry}
 {fentries%fileentry}
--- a/mercurial/templates/spartan/map	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/map	Tue Jun 16 11:52:10 2015 +0800
@@ -31,8 +31,8 @@
     <td>&nbsp;
     <td>&nbsp;
     <td>
-      <a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}/</a>
-      <a href="{url|urlescape}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}file/{symrev}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}/</a>
+      <a href="{url|urlescape}file/{symrev}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">
         {emptydirs|urlescape}
       </a>'
 
@@ -41,7 +41,7 @@
     <td><tt>{permissions|permissions}</tt>&nbsp;
     <td align=right><tt class="date">{date|isodate}</tt>&nbsp;
     <td align=right><tt>{size}</tt>&nbsp;
-    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>'
+    <td><a href="{url|urlescape}file/{symrev}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>'
 
 filerevision = filerevision.tmpl
 fileannotate = fileannotate.tmpl
@@ -183,7 +183,7 @@
     </td>
   </tr>'
 index = index.tmpl
-archiveentry = '<a href="{url|urlescape}archive/{node|short}{extension|urlescape}">{type|escape}</a> '
+archiveentry = '<a href="{url|urlescape}archive/{symrev}{extension|urlescape}">{type|escape}</a> '
 notfound = notfound.tmpl
 error = error.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
--- a/mercurial/templates/spartan/shortlog.tmpl	Tue Jun 16 02:07:25 2015 +0800
+++ b/mercurial/templates/spartan/shortlog.tmpl	Tue Jun 16 11:52:10 2015 +0800
@@ -8,11 +8,11 @@
 <body>
 
 <div class="buttons">
-<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a>
 <a href="{url|urlescape}graph{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/{node|short}/{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}file/{symrev}/{sessionvars%urlparameter}">files</a>
 {archives%archiveentry}
 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <a type="application/rss+xml" href="{url|urlescape}rss-log">rss</a>
--- a/tests/test-hgweb-descend-empties.t	Tue Jun 16 02:07:25 2015 +0800
+++ b/tests/test-hgweb-descend-empties.t	Tue Jun 16 11:52:10 2015 +0800
@@ -500,12 +500,12 @@
   <body>
   
   <div class="buttons">
-  <a href="/log/0?style=spartan">changelog</a>
-  <a href="/shortlog/0?style=spartan">shortlog</a>
+  <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="/tags?style=spartan">tags</a>
   <a href="/branches?style=spartan">branches</a>
-  <a href="/rev/c9f45f7a1659?style=spartan">changeset</a>
+  <a href="/rev/tip?style=spartan">changeset</a>
   
   <a href="/help?style=spartan">help</a>
   </div>
@@ -517,7 +517,7 @@
     <td><tt>drwxr-xr-x</tt>&nbsp;
     <td>&nbsp;
     <td>&nbsp;
-    <td><a href="/file/c9f45f7a1659/?style=spartan">[up]</a>
+    <td><a href="/file/tip/?style=spartan">[up]</a>
   </tr>
   
   <tr class="parity1">
@@ -525,8 +525,8 @@
   <td>&nbsp;
   <td>&nbsp;
   <td>
-  <a href="/file/c9f45f7a1659/a1?style=spartan">a1/</a>
-  <a href="/file/c9f45f7a1659/a1/a2/a3/a4?style=spartan">
+  <a href="/file/tip/a1?style=spartan">a1/</a>
+  <a href="/file/tip/a1/a2/a3/a4?style=spartan">
   a2/a3/a4
   </a>
   <tr class="parity0">
@@ -534,8 +534,8 @@
   <td>&nbsp;
   <td>&nbsp;
   <td>
-  <a href="/file/c9f45f7a1659/b1?style=spartan">b1/</a>
-  <a href="/file/c9f45f7a1659/b1/b2/b3?style=spartan">
+  <a href="/file/tip/b1?style=spartan">b1/</a>
+  <a href="/file/tip/b1/b2/b3?style=spartan">
   b2/b3
   </a>
   <tr class="parity1">
@@ -543,8 +543,8 @@
   <td>&nbsp;
   <td>&nbsp;
   <td>
-  <a href="/file/c9f45f7a1659/d1?style=spartan">d1/</a>
-  <a href="/file/c9f45f7a1659/d1/d2?style=spartan">
+  <a href="/file/tip/d1?style=spartan">d1/</a>
+  <a href="/file/tip/d1/d2?style=spartan">
   d2
   </a>
   
--- a/tests/test-hgweb-filelog.t	Tue Jun 16 02:07:25 2015 +0800
+++ b/tests/test-hgweb-filelog.t	Tue Jun 16 11:52:10 2015 +0800
@@ -674,8 +674,8 @@
   <a href="/graph?style=spartan">graph</a>
   <a href="/tags?style=spartan">tags</a>
   <a href="/branches?style=spartan">branches</a>
-  <a href="/file/46c1a66bd8fc/c?style=spartan">file</a>
-  <a href="/annotate/46c1a66bd8fc/c?style=spartan">annotate</a>
+  <a href="/file/tip/c?style=spartan">file</a>
+  <a href="/annotate/tip/c?style=spartan">annotate</a>
   <a href="/help?style=spartan">help</a>
   <a type="application/rss+xml" href="/rss-log/tip/c">rss</a>
   <a type="application/atom+xml" href="/atom-log/tip/c" title="Atom feed for test:c">atom</a>
--- a/tests/test-hgweb-symrev.t	Tue Jun 16 02:07:25 2015 +0800
+++ b/tests/test-hgweb-symrev.t	Tue Jun 16 11:52:10 2015 +0800
@@ -806,8 +806,8 @@
 (De)referencing symbolic revisions (spartan)
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=spartan' | egrep $REVLINKS
-  <a href="/log/2?style=spartan">changelog</a>
-  <a href="/file/9d8c40cba617/?style=spartan">files</a>
+  <a href="/log/tip?style=spartan">changelog</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>
     <td class="node"><a href="/rev/9d8c40cba617?style=spartan">third</a></td>
@@ -816,8 +816,8 @@
   navigate: <small class="navigate"><a href="/shortlog/43c799df6e75?style=spartan">(0)</a> <a href="/shortlog/tip?style=spartan">tip</a> </small>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?style=spartan' | egrep $REVLINKS
-  <a href="/shortlog/2?style=spartan">shortlog</a>
-  <a href="/file/9d8c40cba617?style=spartan">files</a>
+  <a href="/shortlog/tip?style=spartan">shortlog</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>
     <td class="node"><a href="/rev/9d8c40cba617?style=spartan">9d8c40cba617</a></td>
@@ -832,7 +832,7 @@
   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="/file/9d8c40cba617/?style=spartan">files</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>
 
@@ -843,15 +843,15 @@
   <a href="/shortlog/9d8c40cba617?style=spartan" class="open">default</a>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=spartan' | egrep $REVLINKS
-  <a href="/log/2?style=spartan">changelog</a>
-  <a href="/shortlog/2?style=spartan">shortlog</a>
-  <a href="/rev/9d8c40cba617?style=spartan">changeset</a>
-  <a href="/archive/9d8c40cba617.zip">zip</a> 
+  <a href="/log/tip?style=spartan">changelog</a>
+  <a href="/shortlog/tip?style=spartan">shortlog</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>
-    <td><a href="/file/9d8c40cba617/?style=spartan">[up]</a>
-  <a href="/file/9d8c40cba617/dir?style=spartan">dir/</a>
-  <a href="/file/9d8c40cba617/dir/?style=spartan">
-  <td><a href="/file/9d8c40cba617/foo?style=spartan">foo</a>
+    <td><a href="/file/tip/?style=spartan">[up]</a>
+  <a href="/file/tip/dir?style=spartan">dir/</a>
+  <a href="/file/tip/dir/?style=spartan">
+  <td><a href="/file/tip/foo?style=spartan">foo</a>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=spartan&rev=all()' | egrep $REVLINKS
   <a href="/archive/tip.zip">zip</a> 
@@ -870,29 +870,29 @@
     <td class="files"><a href="/diff/43c799df6e75/dir/bar?style=spartan">dir/bar</a> <a href="/diff/43c799df6e75/foo?style=spartan">foo</a> </td>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=spartan' | egrep $REVLINKS
-  <a href="/log/1?style=spartan">changelog</a>
-  <a href="/shortlog/1?style=spartan">shortlog</a>
-  <a href="/file/a7c1559b7bba?style=spartan">files</a>
-  <a href="/raw-rev/a7c1559b7bba">raw</a>
-  <a href="/archive/a7c1559b7bba.zip">zip</a> 
+  <a href="/log/xyzzy?style=spartan">changelog</a>
+  <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
+  <a href="/file/xyzzy?style=spartan">files</a>
+  <a href="/raw-rev/xyzzy">raw</a>
+  <a href="/archive/xyzzy.zip">zip</a> 
    <td class="changeset"><a href="/rev/a7c1559b7bba?style=spartan">a7c1559b7bba</a></td>
   <td class="parent"><a href="/rev/43c799df6e75?style=spartan">43c799df6e75</a></td>
   <td class="child"><a href="/rev/9d8c40cba617?style=spartan">9d8c40cba617</a></td>
    <td class="files"><a href="/file/a7c1559b7bba/foo?style=spartan">foo</a> </td>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=spartan' | egrep $REVLINKS
-  <a href="/log/1?style=spartan">changelog</a>
-  <a href="/file/a7c1559b7bba/?style=spartan">files</a>
-  <a href="/archive/tip.zip">zip</a> 
+  <a href="/log/xyzzy?style=spartan">changelog</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>
     <td class="node"><a href="/rev/a7c1559b7bba?style=spartan">second</a></td>
     <td class="node"><a href="/rev/43c799df6e75?style=spartan">first</a></td>
   navigate: <small class="navigate"><a href="/shortlog/43c799df6e75?style=spartan">(0)</a> <a href="/shortlog/tip?style=spartan">tip</a> </small>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy?style=spartan' | egrep $REVLINKS
-  <a href="/shortlog/1?style=spartan">shortlog</a>
-  <a href="/file/a7c1559b7bba?style=spartan">files</a>
-  <a href="/archive/tip.zip">zip</a> 
+  <a href="/shortlog/xyzzy?style=spartan">shortlog</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>
     <td class="node"><a href="/rev/a7c1559b7bba?style=spartan">a7c1559b7bba</a></td>
     <th class="files"><a href="/file/a7c1559b7bba?style=spartan">files</a>:</th>
@@ -903,29 +903,29 @@
   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="/file/a7c1559b7bba/?style=spartan">files</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>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=spartan' | egrep $REVLINKS
-  <a href="/log/1?style=spartan">changelog</a>
-  <a href="/shortlog/1?style=spartan">shortlog</a>
-  <a href="/rev/a7c1559b7bba?style=spartan">changeset</a>
-  <a href="/archive/a7c1559b7bba.zip">zip</a> 
+  <a href="/log/xyzzy?style=spartan">changelog</a>
+  <a href="/shortlog/xyzzy?style=spartan">shortlog</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>
-    <td><a href="/file/a7c1559b7bba/?style=spartan">[up]</a>
-  <a href="/file/a7c1559b7bba/dir?style=spartan">dir/</a>
-  <a href="/file/a7c1559b7bba/dir/?style=spartan">
-  <td><a href="/file/a7c1559b7bba/foo?style=spartan">foo</a>
+    <td><a href="/file/xyzzy/?style=spartan">[up]</a>
+  <a href="/file/xyzzy/dir?style=spartan">dir/</a>
+  <a href="/file/xyzzy/dir/?style=spartan">
+  <td><a href="/file/xyzzy/foo?style=spartan">foo</a>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=spartan' | egrep $REVLINKS
-  <a href="/log/1?style=spartan">changelog</a>
-  <a href="/shortlog/1?style=spartan">shortlog</a>
-  <a href="/rev/a7c1559b7bba?style=spartan">changeset</a>
-  <a href="/file/a7c1559b7bba/?style=spartan">files</a>
-  <a href="/log/a7c1559b7bba/foo?style=spartan">revisions</a>
-  <a href="/annotate/a7c1559b7bba/foo?style=spartan">annotate</a>
-  <a href="/raw-file/a7c1559b7bba/foo">raw</a>
+  <a href="/log/xyzzy?style=spartan">changelog</a>
+  <a href="/shortlog/xyzzy?style=spartan">shortlog</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>
+  <a href="/annotate/xyzzy/foo?style=spartan">annotate</a>
+  <a href="/raw-file/xyzzy/foo">raw</a>
    <td><a href="/rev/a7c1559b7bba?style=spartan">a7c1559b7bba</a></td>
   <a href="/file/43c799df6e75/foo?style=spartan">
   <td><a href="/file/9d8c40cba617/foo?style=spartan">9d8c40cba617</a></td>
@@ -933,8 +933,8 @@
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy/foo?style=spartan' | egrep $REVLINKS
      href="/atom-log/tip/foo" title="Atom feed for test:foo">
      href="/rss-log/tip/foo" title="RSS feed for test:foo">
-  <a href="/file/a7c1559b7bba/foo?style=spartan">file</a>
-  <a href="/annotate/a7c1559b7bba/foo?style=spartan">annotate</a>
+  <a href="/file/xyzzy/foo?style=spartan">file</a>
+  <a href="/annotate/xyzzy/foo?style=spartan">annotate</a>
   <a type="application/rss+xml" href="/rss-log/tip/foo">rss</a>
   <a type="application/atom+xml" href="/atom-log/tip/foo" title="Atom feed for test:foo">atom</a>
   <p>navigate: <small class="navigate"><a href="/log/43c799df6e75/foo?style=spartan">(0)</a> <a href="/log/tip/foo?style=spartan">tip</a> </small></p>
@@ -948,13 +948,13 @@
      <a href="/annotate/43c799df6e75/foo?style=spartan">(annotate)</a>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=spartan' | egrep $REVLINKS
-  <a href="/log/1?style=spartan">changelog</a>
-  <a href="/shortlog/1?style=spartan">shortlog</a>
-  <a href="/rev/a7c1559b7bba?style=spartan">changeset</a>
-  <a href="/file/a7c1559b7bba/?style=spartan">files</a>
-  <a href="/file/a7c1559b7bba/foo?style=spartan">file</a>
-  <a href="/log/a7c1559b7bba/foo?style=spartan">revisions</a>
-  <a href="/raw-annotate/a7c1559b7bba/foo">raw</a>
+  <a href="/log/xyzzy?style=spartan">changelog</a>
+  <a href="/shortlog/xyzzy?style=spartan">shortlog</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>
+  <a href="/log/xyzzy/foo?style=spartan">revisions</a>
+  <a href="/raw-annotate/xyzzy/foo">raw</a>
    <td><a href="/rev/a7c1559b7bba?style=spartan">a7c1559b7bba</a></td>
   <a href="/annotate/43c799df6e75/foo?style=spartan">
   <td><a href="/annotate/9d8c40cba617/foo?style=spartan">9d8c40cba617</a></td>
@@ -962,13 +962,13 @@
   <a href="/annotate/a7c1559b7bba/foo?style=spartan#l2"
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=spartan' | egrep $REVLINKS
-  <a href="/log/1?style=spartan">changelog</a>
-  <a href="/shortlog/1?style=spartan">shortlog</a>
-  <a href="/rev/a7c1559b7bba?style=spartan">changeset</a>
-  <a href="/file/a7c1559b7bba/foo?style=spartan">file</a>
-  <a href="/log/a7c1559b7bba/foo?style=spartan">revisions</a>
-  <a href="/annotate/a7c1559b7bba/foo?style=spartan">annotate</a>
-  <a href="/raw-diff/a7c1559b7bba/foo">raw</a>
+  <a href="/log/xyzzy?style=spartan">changelog</a>
+  <a href="/shortlog/xyzzy?style=spartan">shortlog</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>
+  <a href="/annotate/xyzzy/foo?style=spartan">annotate</a>
+  <a href="/raw-diff/xyzzy/foo">raw</a>
    <td class="revision"><a href="/rev/a7c1559b7bba?style=spartan">a7c1559b7bba</a></td>
   <td class="parent"><a href="/rev/43c799df6e75?style=spartan">43c799df6e75</a></td>
   <td class="child"><a href="/rev/9d8c40cba617?style=spartan">9d8c40cba617</a></td>