monoblue: provide links to branches, tags and bookmarks by name
authorAnton Shestakov <av6@dwimlabs.net>
Sat, 26 Sep 2015 17:24:12 +0800
changeset 26391 f206543d8380
parent 26390 0f0cda81e9b0
child 26392 127b59787fd5
monoblue: provide links to branches, tags and bookmarks by name This is adapted from cd842821db2c, that was added to paper for 3.5 release. It adds another way to refer to branches, tags and bookmarks in urls: by name. It's still possible to navigate to a specific changeset hash, but now you can get more descriptive urls straight from /summary page, for example. branchentry template (and so the whole branches table on /summary and /branches) lost the column that had a plain changeset hash, because tags and bookmarks don't have this column and also because there is already a way to address branch by its changeset hash (changeset link just next to it). Maybe we can instead bring this column with a plain changeset hash to tags and bookmarks, but this, more terse, new look feels fine.
mercurial/templates/monoblue/map
tests/test-hgweb-symrev.t
--- a/mercurial/templates/monoblue/map	Sat Sep 26 17:15:58 2015 +0800
+++ b/mercurial/templates/monoblue/map	Sat Sep 26 17:24:12 2015 +0800
@@ -173,7 +173,7 @@
 tagentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
-    <td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{tag|escape}</a></td>
+    <td><a href="{url|urlescape}rev/{tag|revescape}{sessionvars%urlparameter}">{tag|escape}</a></td>
     <td class="nowrap">
       <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
       <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
@@ -184,7 +184,7 @@
 bookmarkentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
-    <td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{bookmark|escape}</a></td>
+    <td><a href="{url|urlescape}rev/{bookmark|revescape}{sessionvars%urlparameter}">{bookmark|escape}</a></td>
     <td class="nowrap">
       <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
       <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
@@ -195,8 +195,7 @@
 branchentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
-    <td><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
-    <td class="{status}">{branch|escape}</td>
+    <td class="{status}"><a href="{url|urlescape}shortlog/{branch|revescape}{sessionvars%urlparameter}">{branch|escape}</a></td>
     <td class="nowrap">
       <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
       <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
--- a/tests/test-hgweb-symrev.t	Sat Sep 26 17:15:58 2015 +0800
+++ b/tests/test-hgweb-symrev.t	Sat Sep 26 17:24:12 2015 +0800
@@ -649,11 +649,11 @@
   <a href="/rev/43c799df6e75?style=monoblue">
   <a href="/rev/43c799df6e75?style=monoblue">changeset</a> |
   <a href="/file/43c799df6e75?style=monoblue">files</a>
-  <td><a href="/rev/a7c1559b7bba?style=monoblue">xyzzy</a></td>
+  <td><a href="/rev/xyzzy?style=monoblue">xyzzy</a></td>
   <a href="/rev/a7c1559b7bba?style=monoblue">changeset</a> |
   <a href="/log/a7c1559b7bba?style=monoblue">changelog</a> |
   <a href="/file/a7c1559b7bba?style=monoblue">files</a>
-  <td><a href="/shortlog/9d8c40cba617?style=monoblue">9d8c40cba617</a></td>
+  <td class="open"><a href="/shortlog/default?style=monoblue">default</a></td>
   <a href="/rev/9d8c40cba617?style=monoblue">changeset</a> |
   <a href="/log/9d8c40cba617?style=monoblue">changelog</a> |
   <a href="/file/9d8c40cba617?style=monoblue">files</a>
@@ -689,19 +689,19 @@
           | <a href="/graph/43c799df6e75?style=monoblue">(0)</a> <a href="/graph/tip?style=monoblue">tip</a> 
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'tags?style=monoblue' | egrep $REVLINKS
-  <td><a href="/rev/9d8c40cba617?style=monoblue">tip</a></td>
+  <td><a href="/rev/tip?style=monoblue">tip</a></td>
   <a href="/rev/9d8c40cba617?style=monoblue">changeset</a> |
   <a href="/log/9d8c40cba617?style=monoblue">changelog</a> |
   <a href="/file/9d8c40cba617?style=monoblue">files</a>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'bookmarks?style=monoblue' | egrep $REVLINKS
-  <td><a href="/rev/a7c1559b7bba?style=monoblue">xyzzy</a></td>
+  <td><a href="/rev/xyzzy?style=monoblue">xyzzy</a></td>
   <a href="/rev/a7c1559b7bba?style=monoblue">changeset</a> |
   <a href="/log/a7c1559b7bba?style=monoblue">changelog</a> |
   <a href="/file/a7c1559b7bba?style=monoblue">files</a>
 
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'branches?style=monoblue' | egrep $REVLINKS
-  <td><a href="/shortlog/9d8c40cba617?style=monoblue">9d8c40cba617</a></td>
+  <td class="open"><a href="/shortlog/default?style=monoblue">default</a></td>
   <a href="/rev/9d8c40cba617?style=monoblue">changeset</a> |
   <a href="/log/9d8c40cba617?style=monoblue">changelog</a> |
   <a href="/file/9d8c40cba617?style=monoblue">files</a>