Patchwork [2,of,2] hgweb: link to revision by node hash in paper & coal

login
register
mail settings
Submitter Anton Shestakov
Date June 18, 2015, 3:44 p.m.
Message ID <88bdc31166260820d0dc.1434642292@neuro>
Download mbox | patch
Permalink /patch/9702/
State Accepted
Headers show

Comments

Anton Shestakov - June 18, 2015, 3:44 p.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1434618378 -28800
#      Thu Jun 18 17:06:18 2015 +0800
# Node ID 88bdc31166260820d0dc93e13e331300f5fdeadc
# Parent  bcbcb8fe6183fc93f63335fe7b693ca1f2b11174
hgweb: link to revision by node hash in paper & coal

Unlike other styles, paper and coal had only one link to current revision: in
the sidebar. Since those links now use symbolic revisions after 3bb6f5f478a7,
it's nice to have a link that allows going from /rev/tip to /rev/<tip hash>,
for instance. Let's make the node hash in the page header that new link.
Matt Mackall - June 19, 2015, 4:07 a.m.
On Thu, 2015-06-18 at 23:44 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1434618378 -28800
> #      Thu Jun 18 17:06:18 2015 +0800
> # Node ID 88bdc31166260820d0dc93e13e331300f5fdeadc
> # Parent  bcbcb8fe6183fc93f63335fe7b693ca1f2b11174
> hgweb: link to revision by node hash in paper & coal

These are queued for default, thanks.

Patch

diff --git a/mercurial/templates/paper/changeset.tmpl b/mercurial/templates/paper/changeset.tmpl
--- a/mercurial/templates/paper/changeset.tmpl
+++ b/mercurial/templates/paper/changeset.tmpl
@@ -31,7 +31,10 @@ 
 <div class="main">
 
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>changeset {rev}:{node|short} {changesetbranch%changelogbranchname} {changesettag} {changesetbookmark}</h3>
+<h3>
+ changeset {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+ {changesetbranch%changelogbranchname}{changesettag}{changesetbookmark}
+</h3>
 
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
diff --git a/mercurial/templates/paper/fileannotate.tmpl b/mercurial/templates/paper/fileannotate.tmpl
--- a/mercurial/templates/paper/fileannotate.tmpl
+++ b/mercurial/templates/paper/fileannotate.tmpl
@@ -37,7 +37,10 @@ 
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>annotate {file|escape} @ {rev}:{node|short} {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}</h3>
+<h3>
+ annotate {file|escape} @ {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+ {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}
+</h3>
 
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
diff --git a/mercurial/templates/paper/filecomparison.tmpl b/mercurial/templates/paper/filecomparison.tmpl
--- a/mercurial/templates/paper/filecomparison.tmpl
+++ b/mercurial/templates/paper/filecomparison.tmpl
@@ -36,7 +36,10 @@ 
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>comparison {file|escape} @ {rev}:{node|short} {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}</h3>
+<h3>
+ comparison {file|escape} @ {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+ {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}
+</h3>
 
 <form class="search" action="{url|urlescape}log">
 <p>{sessionvars%hiddenformentry}</p>
diff --git a/mercurial/templates/paper/filediff.tmpl b/mercurial/templates/paper/filediff.tmpl
--- a/mercurial/templates/paper/filediff.tmpl
+++ b/mercurial/templates/paper/filediff.tmpl
@@ -36,7 +36,10 @@ 
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>diff {file|escape} @ {rev}:{node|short} {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}</h3>
+<h3>
+ diff {file|escape} @ {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+ {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}
+</h3>
 
 <form class="search" action="{url|urlescape}log">
 <p>{sessionvars%hiddenformentry}</p>
diff --git a/mercurial/templates/paper/filerevision.tmpl b/mercurial/templates/paper/filerevision.tmpl
--- a/mercurial/templates/paper/filerevision.tmpl
+++ b/mercurial/templates/paper/filerevision.tmpl
@@ -36,7 +36,10 @@ 
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>view {file|escape} @ {rev}:{node|short} {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}</h3>
+<h3>
+ view {file|escape} @ {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+ {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}
+</h3>
 
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
diff --git a/mercurial/templates/paper/manifest.tmpl b/mercurial/templates/paper/manifest.tmpl
--- a/mercurial/templates/paper/manifest.tmpl
+++ b/mercurial/templates/paper/manifest.tmpl
@@ -30,7 +30,10 @@ 
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>directory {path|escape} @ {rev}:{node|short} {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}</h3>
+<h3>
+ directory {path|escape} @ {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+ {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}
+</h3>
 
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -867,7 +867,10 @@  Logs and changes
   <div class="main">
   
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>changeset 0:2ef0ac749a14  <span class="tag">1.0</span>  <span class="tag">anotherthing</span> </h3>
+  <h3>
+   changeset 0:<a href="/rev/2ef0ac749a14">2ef0ac749a14</a>
+   <span class="tag">1.0</span> <span class="tag">anotherthing</span> 
+  </h3>
   
   <form class="search" action="/log">
   
@@ -1296,7 +1299,10 @@  File-related
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>view foo @ 1:a4f92ed23982 </h3>
+  <h3>
+   view foo @ 1:<a href="/rev/a4f92ed23982">a4f92ed23982</a>
+   
+  </h3>
   
   <form class="search" action="/log">
   
@@ -1420,7 +1426,10 @@  File-related
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>view foo @ 2:1d22e65f027e <span class="branchname">stable</span> </h3>
+  <h3>
+   view foo @ 2:<a href="/rev/1d22e65f027e">1d22e65f027e</a>
+   <span class="branchname">stable</span> 
+  </h3>
   
   <form class="search" action="/log">
   
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
@@ -71,7 +71,10 @@  manifest with descending (paper)
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>directory / @ 0:c9f45f7a1659 <span class="tag">tip</span> </h3>
+  <h3>
+   directory / @ 0:<a href="/rev/c9f45f7a1659">c9f45f7a1659</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   
@@ -187,7 +190,10 @@  manifest with descending (coal)
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>directory / @ 0:c9f45f7a1659 <span class="tag">tip</span> </h3>
+  <h3>
+   directory / @ 0:<a href="/rev/c9f45f7a1659?style=coal">c9f45f7a1659</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   <input type="hidden" name="style" value="coal" />
diff --git a/tests/test-hgweb-diffs.t b/tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t
+++ b/tests/test-hgweb-diffs.t
@@ -79,7 +79,10 @@  revision
   <div class="main">
   
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>changeset 0:0cd96de13884   </h3>
+  <h3>
+   changeset 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
+   
+  </h3>
   
   <form class="search" action="/log">
   
@@ -249,7 +252,10 @@  diff removed file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>diff b @ 1:559edbd9ed20 <span class="tag">tip</span> </h3>
+  <h3>
+   diff b @ 1:<a href="/rev/559edbd9ed20">559edbd9ed20</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -351,7 +357,10 @@  revision
   <div class="main">
   
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>changeset 0:0cd96de13884   </h3>
+  <h3>
+   changeset 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
+   
+  </h3>
   
   <form class="search" action="/log">
   
@@ -525,7 +534,10 @@  diff modified file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>diff a @ 1:559edbd9ed20 <span class="tag">tip</span> </h3>
+  <h3>
+   diff a @ 1:<a href="/rev/559edbd9ed20">559edbd9ed20</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -628,7 +640,10 @@  comparison new file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>comparison a @ 0:0cd96de13884 </h3>
+  <h3>
+   comparison a @ 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
+   
+  </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -755,7 +770,10 @@  comparison existing file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>comparison a @ 2:d73db4d812ff <span class="tag">tip</span> </h3>
+  <h3>
+   comparison a @ 2:<a href="/rev/d73db4d812ff">d73db4d812ff</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -884,7 +902,10 @@  comparison removed file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>comparison a @ 3:20e80271eb7a <span class="tag">tip</span> </h3>
+  <h3>
+   comparison a @ 3:<a href="/rev/20e80271eb7a">20e80271eb7a</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -1019,7 +1040,10 @@  comparison not-modified file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>comparison e @ 5:41d9fc4a6ae1 <span class="tag">tip</span> </h3>
+  <h3>
+   comparison e @ 5:<a href="/rev/41d9fc4a6ae1">41d9fc4a6ae1</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   <p></p>
diff --git a/tests/test-hgweb-empty.t b/tests/test-hgweb-empty.t
--- a/tests/test-hgweb-empty.t
+++ b/tests/test-hgweb-empty.t
@@ -422,7 +422,10 @@  Some tests for hgweb in an empty reposit
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>directory / @ -1:000000000000 <span class="tag">tip</span> </h3>
+  <h3>
+   directory / @ -1:<a href="/rev/000000000000">000000000000</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   
diff --git a/tests/test-hgweb-removed.t b/tests/test-hgweb-removed.t
--- a/tests/test-hgweb-removed.t
+++ b/tests/test-hgweb-removed.t
@@ -60,7 +60,10 @@  revision
   <div class="main">
   
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>changeset 1:c78f6c5cbea9  <span class="tag">tip</span>  </h3>
+  <h3>
+   changeset 1:<a href="/rev/c78f6c5cbea9">c78f6c5cbea9</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   
@@ -185,7 +188,10 @@  diff removed file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>diff a @ 1:c78f6c5cbea9 <span class="tag">tip</span> </h3>
+  <h3>
+   diff a @ 1:<a href="/rev/c78f6c5cbea9">c78f6c5cbea9</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   <p></p>
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
@@ -68,6 +68,7 @@  Set up the repo
   <li><a href="/graph/tip?style=paper">graph</a></li>
   <li><a href="/rev/tip?style=paper">changeset</a></li>
   <a href="/archive/tip.zip">zip</a>
+   directory / @ 2:<a href="/rev/9d8c40cba617?style=paper">9d8c40cba617</a>
     <td class="name"><a href="/file/tip/?style=paper">[up]</a></td>
   <a href="/file/tip/dir?style=paper">
   <a href="/file/tip/dir/?style=paper">
@@ -84,6 +85,7 @@  Set up the repo
    <li><a href="/raw-rev/xyzzy?style=paper">raw</a></li>
    <li><a href="/file/xyzzy?style=paper">browse</a></li>
   <a href="/archive/xyzzy.zip">zip</a>
+   changeset 1:<a href="/rev/a7c1559b7bba?style=paper">a7c1559b7bba</a>
    <td class="author"><a href="/rev/43c799df6e75?style=paper">43c799df6e75</a> </td>
    <td class="author"> <a href="/rev/9d8c40cba617?style=paper">9d8c40cba617</a></td>
    <td class="files"><a href="/file/a7c1559b7bba/foo?style=paper">foo</a> </td>
@@ -118,6 +120,7 @@  Set up the repo
   <li><a href="/graph/xyzzy?style=paper">graph</a></li>
   <li><a href="/rev/xyzzy?style=paper">changeset</a></li>
   <a href="/archive/xyzzy.zip">zip</a>
+   directory / @ 1:<a href="/rev/a7c1559b7bba?style=paper">a7c1559b7bba</a>
     <td class="name"><a href="/file/xyzzy/?style=paper">[up]</a></td>
   <a href="/file/xyzzy/dir?style=paper">
   <a href="/file/xyzzy/dir/?style=paper">
@@ -134,6 +137,7 @@  Set up the repo
   <li><a href="/annotate/xyzzy/foo?style=paper">annotate</a></li>
   <li><a href="/log/xyzzy/foo?style=paper">file log</a></li>
   <li><a href="/raw-file/xyzzy/foo">raw</a></li>
+   view foo @ 1:<a href="/rev/a7c1559b7bba?style=paper">a7c1559b7bba</a>
    <td class="author"><a href="/file/43c799df6e75/foo?style=paper">43c799df6e75</a> </td>
    <td class="author"><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
 
@@ -170,6 +174,7 @@  Set up the repo
   <li><a href="/comparison/xyzzy/foo?style=paper">comparison</a></li>
   <li><a href="/log/xyzzy/foo?style=paper">file log</a></li>
   <li><a href="/raw-annotate/xyzzy/foo">raw</a></li>
+   annotate foo @ 1:<a href="/rev/a7c1559b7bba?style=paper">a7c1559b7bba</a>
    <td class="author"><a href="/file/43c799df6e75/foo?style=paper">43c799df6e75</a> </td>
    <td class="author"><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
   <a href="/annotate/43c799df6e75/foo?style=paper#l1"
@@ -186,6 +191,7 @@  Set up the repo
   <li><a href="/annotate/xyzzy/foo?style=paper">annotate</a></li>
   <li><a href="/log/xyzzy/foo?style=paper">file log</a></li>
   <li><a href="/raw-file/xyzzy/foo">raw</a></li>
+   diff foo @ 1:<a href="/rev/a7c1559b7bba?style=paper">a7c1559b7bba</a>
    <td><a href="/file/43c799df6e75/foo?style=paper">43c799df6e75</a> </td>
    <td><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
 
@@ -200,6 +206,7 @@  Set up the repo
   <li><a href="/annotate/xyzzy/foo?style=paper">annotate</a></li>
   <li><a href="/log/xyzzy/foo?style=paper">file log</a></li>
   <li><a href="/raw-file/xyzzy/foo">raw</a></li>
+   comparison foo @ 1:<a href="/rev/a7c1559b7bba?style=paper">a7c1559b7bba</a>
    <td><a href="/file/43c799df6e75/foo?style=paper">43c799df6e75</a> </td>
    <td><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
 
@@ -236,6 +243,7 @@  Set up the repo
   <li><a href="/graph/tip?style=coal">graph</a></li>
   <li><a href="/rev/tip?style=coal">changeset</a></li>
   <a href="/archive/tip.zip">zip</a>
+   directory / @ 2:<a href="/rev/9d8c40cba617?style=coal">9d8c40cba617</a>
     <td class="name"><a href="/file/tip/?style=coal">[up]</a></td>
   <a href="/file/tip/dir?style=coal">
   <a href="/file/tip/dir/?style=coal">
@@ -252,6 +260,7 @@  Set up the repo
    <li><a href="/raw-rev/xyzzy?style=coal">raw</a></li>
    <li><a href="/file/xyzzy?style=coal">browse</a></li>
   <a href="/archive/xyzzy.zip">zip</a>
+   changeset 1:<a href="/rev/a7c1559b7bba?style=coal">a7c1559b7bba</a>
    <td class="author"><a href="/rev/43c799df6e75?style=coal">43c799df6e75</a> </td>
    <td class="author"> <a href="/rev/9d8c40cba617?style=coal">9d8c40cba617</a></td>
    <td class="files"><a href="/file/a7c1559b7bba/foo?style=coal">foo</a> </td>
@@ -286,6 +295,7 @@  Set up the repo
   <li><a href="/graph/xyzzy?style=coal">graph</a></li>
   <li><a href="/rev/xyzzy?style=coal">changeset</a></li>
   <a href="/archive/xyzzy.zip">zip</a>
+   directory / @ 1:<a href="/rev/a7c1559b7bba?style=coal">a7c1559b7bba</a>
     <td class="name"><a href="/file/xyzzy/?style=coal">[up]</a></td>
   <a href="/file/xyzzy/dir?style=coal">
   <a href="/file/xyzzy/dir/?style=coal">
@@ -302,6 +312,7 @@  Set up the repo
   <li><a href="/annotate/xyzzy/foo?style=coal">annotate</a></li>
   <li><a href="/log/xyzzy/foo?style=coal">file log</a></li>
   <li><a href="/raw-file/xyzzy/foo">raw</a></li>
+   view foo @ 1:<a href="/rev/a7c1559b7bba?style=coal">a7c1559b7bba</a>
    <td class="author"><a href="/file/43c799df6e75/foo?style=coal">43c799df6e75</a> </td>
    <td class="author"><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
 
@@ -338,6 +349,7 @@  Set up the repo
   <li><a href="/comparison/xyzzy/foo?style=coal">comparison</a></li>
   <li><a href="/log/xyzzy/foo?style=coal">file log</a></li>
   <li><a href="/raw-annotate/xyzzy/foo">raw</a></li>
+   annotate foo @ 1:<a href="/rev/a7c1559b7bba?style=coal">a7c1559b7bba</a>
    <td class="author"><a href="/file/43c799df6e75/foo?style=coal">43c799df6e75</a> </td>
    <td class="author"><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
   <a href="/annotate/43c799df6e75/foo?style=coal#1"
@@ -354,6 +366,7 @@  Set up the repo
   <li><a href="/annotate/xyzzy/foo?style=coal">annotate</a></li>
   <li><a href="/log/xyzzy/foo?style=coal">file log</a></li>
   <li><a href="/raw-file/xyzzy/foo">raw</a></li>
+   diff foo @ 1:<a href="/rev/a7c1559b7bba?style=coal">a7c1559b7bba</a>
    <td><a href="/file/43c799df6e75/foo?style=coal">43c799df6e75</a> </td>
    <td><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
 
@@ -368,6 +381,7 @@  Set up the repo
   <li><a href="/annotate/xyzzy/foo?style=coal">annotate</a></li>
   <li><a href="/log/xyzzy/foo?style=coal">file log</a></li>
   <li><a href="/raw-file/xyzzy/foo">raw</a></li>
+   comparison foo @ 1:<a href="/rev/a7c1559b7bba?style=coal">a7c1559b7bba</a>
    <td><a href="/file/43c799df6e75/foo?style=coal">43c799df6e75</a> </td>
    <td><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
 
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -262,7 +262,10 @@  try bad style
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>directory / @ 0:2ef0ac749a14 <span class="tag">tip</span> </h3>
+  <h3>
+   directory / @ 0:<a href="/rev/2ef0ac749a14">2ef0ac749a14</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -105,7 +105,10 @@  hgweb filerevision, html
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>view primes.py @ 0:853dcd4de2a6 <span class="tag">tip</span> </h3>
+  <h3>
+   view primes.py @ 0:<a href="/rev/853dcd4de2a6">853dcd4de2a6</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">
   
@@ -236,7 +239,10 @@  hgweb fileannotate, html
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>annotate primes.py @ 0:853dcd4de2a6 <span class="tag">tip</span> </h3>
+  <h3>
+   annotate primes.py @ 0:<a href="/rev/853dcd4de2a6">853dcd4de2a6</a>
+   <span class="tag">tip</span> 
+  </h3>
   
   <form class="search" action="/log">