hgweb: shorten all the URLs in the standard templates
A URL like this:
http://www.selenic.com/hg/?cmd=changeset;node=
5010207c35273ac1331cae44c253dd41fa07cb7f
is now presented as:
http://www.selenic.com/hg/?cs=
5010207c352
(though the old style still works, of course)
--- a/templates/changelog.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/changelog.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -7,8 +7,8 @@
<div class="buttons">
<a href="?cmd=tags">tags</a>
-<a href="?cmd=manifest;manifest=#manifest#;path=/">manifest</a>
-<a type="application/rss+xml" href="?cmd=changelog;style=rss">rss</a>
+<a href="?mf=#manifest|short#;path=/">manifest</a>
+<a type="application/rss+xml" href="?style=rss">rss</a>
</div>
<h2>changelog for #repo|escape#</h2>
--- a/templates/changelogentry-rss.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/changelogentry-rss.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -1,6 +1,6 @@
<item>
<title>#desc|firstline|escape#</title>
- <link>#url#?cmd=changeset;node=#node#</link>
+ <link>#url#?cs=#node|short#</link>
<description><![CDATA[#desc|escape|addbreaks#]]></description>
<author>#author|obfuscate#</author>
<pubDate>#date|rfc822date#</pubDate>
--- a/templates/changelogentry.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/changelogentry.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -5,7 +5,7 @@
</tr>
<tr>
<th class="changesetRev">changeset #rev#:</th>
- <td class="changesetNode"><a href="?cmd=changeset;node=#node#">#node|short#</a></td>
+ <td class="changesetNode"><a href="?cs=#node|short#">#node|short#</a></td>
</tr>
#parent#
#changelogtag#
@@ -18,7 +18,7 @@
<td class="date">#date|date#</td>
</tr>
<tr>
- <th class="files"><a href="?cmd=manifest;manifest=#manifest#;path=/">files</a>:</th>
+ <th class="files"><a href="?mf=#manifest|short#;path=/">files</a>:</th>
<td class="files">#files#</td>
</tr>
</table>
--- a/templates/changeset.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/changeset.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -4,10 +4,10 @@
<body>
<div class="buttons">
-<a href="?cmd=changelog;rev=#rev#">changelog</a>
+<a href="?cl=#rev#">changelog</a>
<a href="?cmd=tags">tags</a>
-<a href="?cmd=manifest;manifest=#manifest#;path=/">manifest</a>
-<a href="?cmd=changeset;node=#node#;style=raw">raw</a>
+<a href="?mf=#manifest|short#">manifest</a>
+<a href="?cs=#node|short#;style=raw">raw</a>
#archives%archiveentry#
</div>
@@ -16,7 +16,7 @@
<table id="changesetEntry">
<tr>
<th class="changeset">changeset #rev#:</th>
- <td class="changeset"><a href="?cmd=changeset;node=#node#">#node|short#</a></td>
+ <td class="changeset"><a href="?cs=#node|short#">#node|short#</a></td>
</tr>
#parent#
#changesettag#
--- a/templates/fileannotate.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/fileannotate.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -4,12 +4,12 @@
<body>
<div class="buttons">
-<a href="?cmd=changelog;rev=#rev#">changelog</a>
-<a href="?cmd=tags">tags</a>
-<a href="?cmd=changeset;node=#node#">changeset</a>
-<a href="?cmd=manifest;manifest=#manifest#;path=#path#">manifest</a>
-<a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
-<a href="?cmd=filelog;file=#file#;filenode=#filenode#">revisions</a>
+<a href="?cl=#rev#">changelog</a>
+<a href="?tags=">tags</a>
+<a href="?cs=#node|short#">changeset</a>
+<a href="?mf=#manifest|short#;path=#path#">manifest</a>
+<a href="?f=#filenode|short#;file=#file#">file</a>
+<a href="?fl=#filenode|short#;file=#file#">revisions</a>
</div>
<h2>Annotate #file#</h2>
@@ -17,7 +17,7 @@
<table>
<tr>
<td class="metatag">changeset #rev#:</td>
- <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
+ <td><a href="?cs=#node|short#">#node|short#</a></td></tr>
#parent#
<tr>
<td class="metatag">author:</td>
--- a/templates/filediff.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/filediff.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -4,13 +4,13 @@
<body>
<div class="buttons">
-<a href="?cmd=changelog;rev=#rev#">changelog</a>
-<a href="?cmd=tags">tags</a>
-<a href="?cmd=changeset;node=#node#">changeset</a>
-<a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
-<a href="?cmd=filelog;file=#file#;filenode=#filenode#">revisions</a>
-<a href="?cmd=annotate;file=#file#;filenode=#filenode#">annotate</a>
-<a href="?cmd=filediff;file=#file#;node=#node#;style=raw">raw</a>
+<a href="?cl=#rev#">changelog</a>
+<a href="?tags=">tags</a>
+<a href="?cs=#node|short#">changeset</a>
+<a href="?f=#filenode|short#;file=#file#">file</a>
+<a href="?fl=#filenode|short#;file=#file#">revisions</a>
+<a href="?fa=#filenode|short#;file=#file#">annotate</a>
+<a href="?fd=#node|short#;file=#file#;style=raw">raw</a>
</div>
<h2>#file#</h2>
@@ -18,7 +18,7 @@
<table id="filediffEntry">
<tr>
<th class="revision">revision #rev#:</th>
- <td class="revision"><a href="?cmd=changeset;node=#node#">#node|short#</a></td>
+ <td class="revision"><a href="?cs=#node|short#">#node|short#</a></td>
</tr>
#parent#
</table>
--- a/templates/filelog.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/filelog.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -1,17 +1,17 @@
#header#
<title>#repo|escape#: #file# history</title>
<link rel="alternate" type="application/rss+xml"
- href="?cmd=filelog;file=#file#;filenode=0;style=rss" title="RSS feed for #repo|escape#:#file#">
+ href="?fl=0;file=#file#;style=rss" title="RSS feed for #repo|escape#:#file#">
</head>
</head>
<body>
<div class="buttons">
-<a href="?cmd=changelog">changelog</a>
-<a href="?cmd=tags">tags</a>
-<a href="?cmd=file;file=#file#;filenode=#filenode#">file</a>
-<a href="?cmd=annotate;file=#file#;filenode=#filenode#">annotate</a>
-<a type="application/rss+xml" href="?cmd=filelog;file=#file#;filenode=0;style=rss">rss</a>
+<a href="?cl=#node|short#">changelog</a>
+<a href="?tags=">tags</a>
+<a href="?f=#filenode|short#;file=#file#">file</a>
+<a href="?fa=#filenode|short#;file=#file#">annotate</a>
+<a type="application/rss+xml" href="?fl=0;file=#file#;style=rss">rss</a>
</div>
<h2>#file# revision history</h2>
--- a/templates/filelogentry-rss.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/filelogentry-rss.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -1,6 +1,6 @@
<item>
<title>#desc|firstline|escape#</title>
- <link>#url#?cmd=file;file=#file#;filenode=#filenode#</link>
+ <link>#url#?f=#filenode|short#;file=#file#</link>
<description><![CDATA[#desc|escape|addbreaks#]]></description>
<author>#author|obfuscate#</author>
<pubDate>#date|rfc822date#</pubDate>>
--- a/templates/filelogentry.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/filelogentry.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -1,12 +1,12 @@
<table class="parity#parity#" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right" width="15%"><b>#date|age# ago: </b></td>
- <td><b><a href="?cmd=changeset;node=#node#">#desc|firstline|escape#</a></b></td></tr>
+ <td><b><a href="?cs=#node|short#">#desc|firstline|escape#</a></b></td></tr>
<tr>
<td align="right">revision #filerev#: </td>
- <td><a href="?cmd=file;file=#file#;filenode=#filenode#">#filenode|short#</a>
-<a href="?cmd=filediff;file=#file#;node=#node#">(diff)</a>
-<a href="?cmd=annotate;file=#file#;filenode=#filenode#">(annotate)</a>
+ <td><a href="?f=#filenode|short#;file=#file#">#filenode|short#</a>
+<a href="?fd=#node|short#;file=#file#">(diff)</a>
+<a href="?fa=#filenode|short#;file=#file#">(annotate)</a>
</td></tr>
<tr>
<td align="right">author: </td>
--- a/templates/filerevision.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/filerevision.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -4,13 +4,13 @@
<body>
<div class="buttons">
-<a href="?cmd=changelog;rev=#rev#">changelog</a>
-<a href="?cmd=tags">tags</a>
-<a href="?cmd=changeset;node=#node#">changeset</a>
-<a href="?cmd=manifest;manifest=#manifest#;path=#path#">manifest</a>
-<a href="?cmd=filelog;file=#file#;filenode=#filenode#">revisions</a>
-<a href="?cmd=annotate;file=#file#;filenode=#filenode#">annotate</a>
-<a href="?cmd=file;file=#file#;filenode=#filenode#;style=raw">raw</a>
+<a href="?cl=#rev#">changelog</a>
+<a href="?tags=">tags</a>
+<a href="?cs=#node|short#">changeset</a>
+<a href="?mf=#manifest|short#;path=#path#">manifest</a>
+<a href="?fl=#filenode|short#;file=#file#">revisions</a>
+<a href="?fa=#filenode|short#;file=#file#">annotate</a>
+<a href="?f=#node|short#;file=#file#;style=raw">raw</a>
</div>
<h2>#file#</h2>
@@ -18,7 +18,7 @@
<table>
<tr>
<td class="metatag">changeset #rev#:</td>
- <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
+ <td><a href="?cs=#node|short#">#node|short#</a></td></tr>
#parent#
<tr>
<td class="metatag">author:</td>
--- a/templates/manifest.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/manifest.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -4,9 +4,9 @@
<body>
<div class="buttons">
-<a href="?cmd=changelog;rev=#rev#">changelog</a>
-<a href="?cmd=tags">tags</a>
-<a href="?cmd=changeset;node=#node#">changeset</a>
+<a href="?cl=#rev#">changelog</a>
+<a href="?tags=">tags</a>
+<a href="?cs=#node|short#">changeset</a>
</div>
<h2>manifest for changeset #node|short#: #path#</h2>
@@ -14,7 +14,7 @@
<table cellpadding="0" cellspacing="0">
<tr class="parity1">
<td><tt>drwxr-xr-x</tt>
- <td><a href="?cmd=manifest;manifest=#manifest#;path=#up#">[up]</a>
+ <td><a href="?mf=#manifest|short#;path=#up#">[up]</a>
#dentries%manifestdirentry#
#fentries%manifestfileentry#
</table>
--- a/templates/map Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/map Tue Oct 18 23:08:35 2005 -0700
@@ -3,39 +3,39 @@
footer = footer.tmpl
search = search.tmpl
changelog = changelog.tmpl
-naventry = "<a href="?cmd=changelog;rev=#rev#">#label#</a> "
-filedifflink = "<a href="?cmd=filediff;node=#node#;file=#file#">#file#</a> "
-filenodelink = "<a href="?cmd=file;filenode=#filenode#;file=#file#">#file#</a> "
+naventry = "<a href="?cl=#rev#">#label#</a> "
+filedifflink = "<a href="?fd=#node|short#;file=#file#">#file#</a> "
+filenodelink = "<a href="?f=#filenode|short#;file=#file#">#file#</a> "
fileellipses = "..."
changelogentry = changelogentry.tmpl
searchentry = changelogentry.tmpl
changeset = changeset.tmpl
manifest = manifest.tmpl
manifestdirentry = "<tr class="parity#parity#"><td><tt>drwxr-xr-x</tt> <td><a href="?cmd=manifest;manifest=#manifest#;path=#path#">#basename#/</a>"
-manifestfileentry = "<tr class="parity#parity#"><td><tt>#permissions|permissions#</tt> <td><a href="?cmd=file;filenode=#filenode#;file=#file#">#basename#</a>"
+manifestfileentry = "<tr class="parity#parity#"><td><tt>#permissions|permissions#</tt> <td><a href="?f=#filenode|short#;file=#file#">#basename#</a>"
filerevision = filerevision.tmpl
fileannotate = fileannotate.tmpl
filediff = filediff.tmpl
filelog = filelog.tmpl
fileline = "<div class="parity#parity#"><span class="lineno">#linenumber#</span>#line|escape#</div>"
filelogentry = filelogentry.tmpl
-annotateline = "<tr class="parity#parity#"><td class="annotate"><a href="?cmd=changeset;node=#node#">#author|obfuscate#@#rev#</a></td><td><pre>#line|escape#</pre></td></tr>"
+annotateline = "<tr class="parity#parity#"><td class="annotate"><a href="?cs=#node|short#">#author|obfuscate#@#rev#</a></td><td><pre>#line|escape#</pre></td></tr>"
difflineplus = "<span class="plusline">#line|escape#</span>"
difflineminus = "<span class="minusline">#line|escape#</span>"
difflineat = "<span class="atline">#line|escape#</span>"
diffline = "#line|escape#"
-changelogparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>"
-changesetparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>"
-filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file#;filenode=#node#">#node|short#</a></td></tr>"
-fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#">#node|short#</a></td></tr>"
+changelogparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
+changesetparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
+filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
+fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?fa=#filenode|short#;file=#file#">#node|short#</a></td></tr>"
tags = tags.tmpl
-tagentry = "<li class="tagEntry parity#parity#"><span class="node">#node#</span> <a href="?cmd=changeset;node=#node#">#tag#</a></li>"
+tagentry = "<li class="tagEntry parity#parity#"><span class="node">#node#</span> <a href="?cs=#node|short#">#tag#</a></li>"
diffblock = "<pre class="parity#parity#">#lines#</pre>"
changelogtag = "<tr><th class="tag">tag:</th><td class="tag">#tag#</td></tr>"
changesettag = "<tr><th class="tag">tag:</th><td class="tag">#tag#</td></tr>"
-filediffparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>"
-filelogparent = "<tr><td align="right">parent #rev#: </td><td><a href="?cmd=file;file=#file#;filenode=#node#">#node|short#</a></td></tr>"
-indexentry = "<tr class="parity#parity#"><td><a href="#url#">#name#</a></td><td>#shortdesc#</td><td>#contact|obfuscate#</td><td>#lastupdate|age# ago</td><td><a href="#url#?cmd=changelog;style=rss">RSS</a></td></tr>"
+filediffparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
+filelogparent = "<tr><td align="right">parent #rev#: </td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
+indexentry = "<tr class="parity#parity#"><td><a href="#url#">#name#</a></td><td>#shortdesc#</td><td>#contact|obfuscate#</td><td>#lastupdate|age# ago</td><td><a href="#url#?cl=tip;style=rss">RSS</a></td></tr>"
index = index.tmpl
-archiveentry = "<a href="?cmd=archive;node=#node#;type=#type#">#type#</a> "
+archiveentry = "<a href="?ca=#node|short#;type=#type#">#type#</a> "
notfound = notfound.tmpl
--- a/templates/search.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/search.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -4,9 +4,9 @@
<body>
<div class="buttons">
-<a href="?cmd=changelog;rev=#rev#">changelog</a>
-<a href="?cmd=tags">tags</a>
-<a href="?cmd=manifest;manifest=#manifest#;path=/">manifest</a>
+<a href="?cl=#rev#">changelog</a>
+<a href="?tags=">tags</a>
+<a href="?mf=#manifest|short#;path=/">manifest</a>
</div>
<h2>searching for #query|escape#</h2>
--- a/templates/tags.tmpl Tue Oct 18 23:05:30 2005 -0700
+++ b/templates/tags.tmpl Tue Oct 18 23:08:35 2005 -0700
@@ -4,8 +4,8 @@
<body>
<div class="buttons">
-<a href="?cmd=changelog;rev=#rev#">changelog</a>
-<a href="?cmd=manifest;manifest=#manifest#;path=/">manifest</a>
+<a href="?cl=#rev#">changelog</a>
+<a href="?mf=#manifest|short#;path=/">manifest</a>
</div>
<h2>tags:</h2>