hgweb: link to revision by node hash in gitweb & monoblue
authorAnton Shestakov <av6@dwimlabs.net>
Thu, 18 Jun 2015 16:14:10 +0800
changeset 25616 e0073dcec588
parent 25615 dc707fb35550
child 25617 63be46407a50
hgweb: link to revision by node hash in gitweb & monoblue This allows going from /rev/tip to /rev/<tip hash> with ease.
mercurial/templates/gitweb/changeset.tmpl
mercurial/templates/monoblue/changeset.tmpl
tests/test-hgweb-symrev.t
--- a/mercurial/templates/gitweb/changeset.tmpl	Tue Jun 16 23:14:45 2015 -0400
+++ b/mercurial/templates/gitweb/changeset.tmpl	Thu Jun 18 16:14:10 2015 +0800
@@ -35,7 +35,10 @@
 <tr><td>author</td><td>{author|obfuscate}</td></tr>
 <tr><td></td><td class="date age">{date|rfc822date}</td></tr>
 {branch%changesetbranch}
-<tr><td>changeset {rev}</td><td style="font-family:monospace">{node|short}</td></tr>
+<tr>
+ <td>changeset {rev}</td>
+ <td style="font-family:monospace"><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+</tr>
 {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)}
 {child%changesetchild}
 </table></div>
--- a/mercurial/templates/monoblue/changeset.tmpl	Tue Jun 16 23:14:45 2015 -0400
+++ b/mercurial/templates/monoblue/changeset.tmpl	Thu Jun 18 16:14:10 2015 +0800
@@ -48,7 +48,7 @@
         <dd>{date|rfc822date}</dd>
         {branch%changesetbranch}
         <dt>changeset {rev}</dt>
-        <dd>{node|short}</dd>
+        <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
         {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)}
         {child%changesetchild}
     </dl>
--- a/tests/test-hgweb-symrev.t	Tue Jun 16 23:14:45 2015 -0400
+++ b/tests/test-hgweb-symrev.t	Thu Jun 18 16:14:10 2015 +0800
@@ -474,6 +474,7 @@
   <a href="/file/xyzzy?style=gitweb">files</a> |
   <a href="/raw-rev/xyzzy">raw</a>  | <a href="/archive/xyzzy.zip">zip</a>  |
   <a class="title" href="/raw-rev/a7c1559b7bba">second <span class="logtags"><span class="bookmarktag" title="xyzzy">xyzzy</span> </span></a>
+   <td style="font-family:monospace"><a class="list" href="/rev/a7c1559b7bba?style=gitweb">a7c1559b7bba</a></td>
   <a class="list" href="/rev/43c799df6e75?style=gitweb">43c799df6e75</a>
   <a class="list" href="/rev/9d8c40cba617?style=gitweb">9d8c40cba617</a>
   <td><a class="list" href="/diff/a7c1559b7bba/foo?style=gitweb">foo</a></td>
@@ -691,6 +692,7 @@
           <li><a href="/raw-rev/xyzzy">raw</a></li>
           <li><a href="/archive/xyzzy.zip">zip</a></li>
       <h3 class="changeset"><a href="/raw-rev/a7c1559b7bba">second <span class="logtags"><span class="bookmarktag" title="xyzzy">xyzzy</span> </span></a></h3>
+          <dd><a href="/rev/a7c1559b7bba?style=monoblue">a7c1559b7bba</a></dd>
   <dd><a href="/rev/43c799df6e75?style=monoblue">43c799df6e75</a></dd>
   <dd><a href="/rev/9d8c40cba617?style=monoblue">9d8c40cba617</a></dd>
   <td><a href="/diff/a7c1559b7bba/foo?style=monoblue">foo</a></td>