changeset 375:b29219389b00

Show nice short hashes in hgweb -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Show nice short hashes in hgweb manifest hash: c73a8e32a823af7ea7440d1db2b0c022a4366bb5 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCsQpkywK+sNU5EO8RAmSIAJ40aYEFBi07drKuPLuofXNaUkEFtgCghC9g mG8mmhucbBe4hcZWL0AdG8I= =Khp7 -----END PGP SIGNATURE-----
author mpm@selenic.com
date Wed, 15 Jun 2005 21:13:08 -0800
parents f07d00fcd281
children e5d769afd3ef
files mercurial/hgweb.py templates/changelogentry.tmpl templates/changeset.tmpl templates/fileannotate.tmpl templates/filediff.tmpl templates/filelogentry.tmpl templates/filerevision.tmpl templates/manifest.tmpl templates/map
diffstat 9 files changed, 19 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Wed Jun 15 21:12:28 2005 -0800
+++ b/mercurial/hgweb.py	Wed Jun 15 21:13:08 2005 -0800
@@ -129,6 +129,7 @@
             "date": (lambda x: time.asctime(time.gmtime(x))),
             "addbreaks": nl2br,
             "obfuscate": obfuscate,
+            "short": (lambda x: x[:12]),
             "firstline": (lambda x: x.splitlines(1)[0]),
             "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--")
             }
--- a/templates/changelogentry.tmpl	Wed Jun 15 21:12:28 2005 -0800
+++ b/templates/changelogentry.tmpl	Wed Jun 15 21:13:08 2005 -0800
@@ -5,7 +5,7 @@
  <td><b>#desc|firstline|escape#</b></td></tr>
 <tr>
  <td align="right">changeset #rev#:&nbsp;</td>
- <td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>
+ <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
 #parent1#
 #parent2#
 <tr>
--- a/templates/changeset.tmpl	Wed Jun 15 21:12:28 2005 -0800
+++ b/templates/changeset.tmpl	Wed Jun 15 21:13:08 2005 -0800
@@ -1,5 +1,5 @@
 #header#
-<title>#repo|escape#: changeset #node#</title>
+<title>#repo|escape#: changeset #node|short#</title>
 </head>
 <body>
 
@@ -15,12 +15,12 @@
 <table>
 <tr>
  <td class="metatag">changeset #rev#:</td>
- <td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>
+ <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
 #parent1#
 #parent2#
 <tr>
  <td class="metatag">manifest:</td>
- <td><a href="?cmd=manifest;manifest=#manifest#;path=/">#manifest#</a></td></tr>
+ <td><a href="?cmd=manifest;manifest=#manifest#;path=/">#manifest|short#</a></td></tr>
 <tr>
  <td class="metatag">author:</td>
  <td>#author|obfuscate#</td></tr>
--- a/templates/fileannotate.tmpl	Wed Jun 15 21:12:28 2005 -0800
+++ b/templates/fileannotate.tmpl	Wed Jun 15 21:13:08 2005 -0800
@@ -12,17 +12,17 @@
 <a href="?cmd=filelog;file=#file#;filenode=#filenode#">revisions</a>
 </div>
 
-<h2>Annotate #file# (#filenode#)</h2>
+<h2>Annotate #file# (#filenode|short#)</h2>
 
 <table>
 <tr>
  <td class="metatag">changeset #rev#:</td>
- <td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>
+ <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
 #parent1#
 #parent2#
 <tr>
  <td class="metatag">manifest:</td>
- <td><a href="?cmd=manifest;manifest=#manifest#;path=/">#manifest#</a></td></tr>
+ <td><a href="?cmd=manifest;manifest=#manifest#;path=/">#manifest|short#</a></td></tr>
 <tr>
  <td class="metatag">author:</td>
  <td>#author|obfuscate#</td></tr>
--- a/templates/filediff.tmpl	Wed Jun 15 21:12:28 2005 -0800
+++ b/templates/filediff.tmpl	Wed Jun 15 21:13:08 2005 -0800
@@ -18,10 +18,10 @@
 <table>
 <tr>
  <td class="metatag">revision #rev#:</td>
- <td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>
+ <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
 <tr>
  <td class="metatag">parent #p1rev#:</td>
- <td><a href="?cmd=changeset;node=#p1#">#p1#</a></td></tr>
+ <td><a href="?cmd=changeset;node=#p1#">#p1|short#</a></td></tr>
 </table>
 
 <pre>
--- a/templates/filelogentry.tmpl	Wed Jun 15 21:12:28 2005 -0800
+++ b/templates/filelogentry.tmpl	Wed Jun 15 21:13:08 2005 -0800
@@ -4,7 +4,7 @@
  <td><b><a href="?cmd=changeset;node=#node#">#desc|firstline|escape#</a></b></td></tr>
 <tr>
  <td align="right">revision #filerev#:&nbsp;</td>
- <td><a href="?cmd=file;file=#file#;filenode=#filenode#">#filenode#</a>
+ <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></tr>
--- a/templates/filerevision.tmpl	Wed Jun 15 21:12:28 2005 -0800
+++ b/templates/filerevision.tmpl	Wed Jun 15 21:13:08 2005 -0800
@@ -13,17 +13,17 @@
 <a href="?cmd=file;file=#file#;filenode=#filenode#;style=raw">raw</a>
 </div>
 
-<h2>#file# (revision #filenode#)</h2>
+<h2>#file# (revision #filenode|short#)</h2>
 
 <table>
 <tr>
  <td class="metatag">changeset #rev#:</td>
- <td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>
+ <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
 #parent1#
 #parent2#
 <tr>
  <td class="metatag">manifest:</td>
- <td><a href="?cmd=manifest;manifest=#manifest#;path=/">#manifest#</a></td></tr>
+ <td><a href="?cmd=manifest;manifest=#manifest#;path=/">#manifest|short#</a></td></tr>
 <tr>
  <td class="metatag">author:</td>
  <td>#author|obfuscate#</td></tr>
--- a/templates/manifest.tmpl	Wed Jun 15 21:12:28 2005 -0800
+++ b/templates/manifest.tmpl	Wed Jun 15 21:13:08 2005 -0800
@@ -1,5 +1,5 @@
 #header#
-<title>#repo|escape#: manifest #manifest#</title>
+<title>#repo|escape#: manifest #manifest|short#</title>
 </head>
 <body>
 
@@ -9,7 +9,7 @@
 <a href="?cmd=changeset;node=#node#">changeset</a>
 </div>
 
-<h2>manifest: #path#</h2>
+<h2>manifest #manifest|short#: #path#</h2>
 
 <table cellpadding="0" cellspacing="0">
 <tr class="parity1">
--- a/templates/map	Wed Jun 15 21:12:28 2005 -0800
+++ b/templates/map	Wed Jun 15 21:13:08 2005 -0800
@@ -21,10 +21,10 @@
 difflineminus = "<span class="minusline">#line|escape#</span>"
 difflineat = "<span class="atline">#line|escape#</span>"
 diffline = "#line|escape#"
-changelogparent = "<tr><td align="right">parent:&nbsp;</td><td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>"
+changelogparent = "<tr><td align="right">parent:&nbsp;</td><td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>"
 changesetparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>"
-filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file#;filenode=#node#">#node#</a></td></tr>"
-fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#">#node#</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>"
 tags = tags.tmpl
 tagentry = "<div class="parity#parity#"><tt>#node#</tt> <a href="?cmd=changeset;node=#node#">#tag#</a><br /></div>"
 diffblock = "<div class="parity#parity#">#lines#</div>"