hgweb: use "nonempty" filter in templates for the changelog message
authorRocco Rutte <pdmef@gmx.net>
Mon, 20 Apr 2009 12:10:04 +0200
changeset 8235 89bc3946c8f3
parent 8234 27dbe534397b
child 8236 9f53e203a09b
hgweb: use "nonempty" filter in templates for the changelog message At least subversion allows empty commit logs which, after conversion, show up as empty fields in hgweb and don't allow selecting the changeset. Using "nonempty" as filter, "(none)" is used to get clickable links for empty commit messages.
templates/atom/changelogentry.tmpl
templates/gitweb/changelogentry.tmpl
templates/gitweb/changeset.tmpl
templates/gitweb/fileannotate.tmpl
templates/gitweb/filerevision.tmpl
templates/gitweb/graph.tmpl
templates/gitweb/map
templates/monoblue/changelogentry.tmpl
templates/monoblue/changeset.tmpl
templates/monoblue/fileannotate.tmpl
templates/monoblue/filerevision.tmpl
templates/monoblue/graph.tmpl
templates/monoblue/map
templates/paper/changeset.tmpl
templates/paper/fileannotate.tmpl
templates/paper/filediff.tmpl
templates/paper/filelogentry.tmpl
templates/paper/filerevision.tmpl
templates/paper/graph.tmpl
templates/paper/shortlogentry.tmpl
templates/rss/changelogentry.tmpl
templates/rss/filelogentry.tmpl
templates/spartan/changelogentry.tmpl
templates/spartan/changeset.tmpl
templates/spartan/fileannotate.tmpl
templates/spartan/filelogentry.tmpl
templates/spartan/filerevision.tmpl
templates/spartan/graph.tmpl
templates/spartan/shortlogentry.tmpl
tests/test-hgweb-commands.out
tests/test-hgweb-empty.out
--- a/templates/atom/changelogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/atom/changelogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,5 +1,5 @@
  <entry>
-  <title>#desc|strip|firstline|strip|escape#</title>
+  <title>#desc|strip|firstline|strip|escape|nonempty#</title>
   <id>{urlbase}{url}#changeset-{node}</id>
   <link href="{urlbase}{url}rev/{node}"/>
   <author>
@@ -10,7 +10,7 @@
   <published>#date|rfc3339date#</published>
   <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">
-    <pre xml:space="preserve">#desc|escape#</pre>
+    <pre xml:space="preserve">#desc|escape|nonempty#</pre>
    </div>
   </content>
  </entry>
--- a/templates/gitweb/changelogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/gitweb/changelogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,5 +1,5 @@
 <div>
-<a class="title" href="{url}rev/#node|short#{sessionvars%urlparameter}"><span class="age">#date|age# ago</span>#desc|strip|firstline|escape#<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
+<a class="title" href="{url}rev/#node|short#{sessionvars%urlparameter}"><span class="age">#date|age# ago</span>#desc|strip|firstline|escape|nonempty#<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
 </div>
 <div class="title_text">
 <div class="log_link">
@@ -8,7 +8,7 @@
 <i>#author|obfuscate# [#date|rfc822date#] rev #rev#</i><br/>
 </div>
 <div class="log_body">
-#desc|strip|escape|addbreaks#
+#desc|strip|escape|addbreaks|nonempty#
 <br/>
 <br/>
 </div>
--- a/templates/gitweb/changeset.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/gitweb/changeset.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -16,7 +16,7 @@
 </div>
 
 <div>
-<a class="title" href="{url}raw-rev/#node|short#">#desc|strip|escape|firstline# <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
+<a class="title" href="{url}raw-rev/#node|short#">#desc|strip|escape|firstline|nonempty# <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
 </div>
 <div class="title_text">
 <table cellspacing="0">
@@ -29,7 +29,7 @@
 </table></div>
 
 <div class="page_body">
-#desc|strip|escape|addbreaks#
+#desc|strip|escape|addbreaks|nonempty#
 </div>
 <div class="list_head"></div>
 <div class="title_text">
--- a/templates/gitweb/fileannotate.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/gitweb/fileannotate.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -49,7 +49,7 @@
 </div>
 
 <div class="page_path">
-{desc|strip|escape|addbreaks}
+{desc|strip|escape|addbreaks|nonempty}
 </div>
 <div class="page_body">
 <table>
--- a/templates/gitweb/filerevision.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/gitweb/filerevision.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -49,7 +49,7 @@
 </div>
 
 <div class="page_path">
-{desc|strip|escape|addbreaks}
+{desc|strip|escape|addbreaks|nonempty}
 </div>
 
 <div class="page_body">
--- a/templates/gitweb/graph.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/gitweb/graph.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -78,7 +78,10 @@
 	item = item.replace(/_PARITY/, 'parity' + parity);
 	item = item.replace(/_NODEID/, cur[0]);
 	item = item.replace(/_NODEID/, cur[0]);
-	item = item.replace(/_DESC/, cur[3]);
+	if (cur[3] != '')
+	    item = item.replace(/_DESC/, cur[3]);
+	else
+	    item = item.replace(/_DESC/, '(none)');
 	item = item.replace(/_USER/, cur[4]);
 	item = item.replace(/_DATE/, cur[5]);
 	
--- a/templates/gitweb/map	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/gitweb/map	Mon Apr 20 12:10:04 2009 +0200
@@ -56,8 +56,8 @@
 tagtag = '<span class="tagtag" title="{name}">{name}</span> '
 branchtag = '<span class="branchtag" title="{name}">{name}</span> '
 inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> '
-shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author|person#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b> <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">files</a></td></tr>'
-filelogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>'
+shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author|person#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape|nonempty#</b> <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">files</a></td></tr>'
+filelogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape|nonempty#</b></a></td><td class="link"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>'
 archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> '
 indexentry = '<tr class="parity{parity}"><td><a class="list" href="{url}{sessionvars%urlparameter}"><b>{name|escape}</b></a></td><td>{description}</td><td>{contact|obfuscate}</td><td class="age">{lastchange|age} ago</td><td class="indexlinks">{archives%indexarchiveentry}</td><td><div class="rss_logo"><a href="{url}rss-log">RSS</a> <a href="{url}atom-log">Atom</a></div></td></tr>\n'
 indexarchiveentry = ' <a href="{url}archive/{node|short}{extension}">{type|escape}</a> '
--- a/templates/monoblue/changelogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/monoblue/changelogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,6 +1,6 @@
-<h3 class="changelog"><a class="title" href="{url}rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape#<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3>
+<h3 class="changelog"><a class="title" href="{url}rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape|nonempty#<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3>
 <ul class="changelog-entry">
     <li class="age">#date|age# ago</li>
     <li>by <span class="name">#author|obfuscate#</span> <span class="revdate">[#date|rfc822date#] rev #rev#</span></li>
-    <li class="description">#desc|strip|escape|addbreaks#</li>
+    <li class="description">#desc|strip|escape|addbreaks|nonempty#</li>
 </ul>
--- a/templates/monoblue/changeset.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/monoblue/changeset.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -34,7 +34,7 @@
 
     <h2 class="no-link no-border">changeset</h2>
 
-    <h3 class="changeset"><a href="{url}raw-rev/#node|short#">#desc|strip|escape|firstline# <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3>
+    <h3 class="changeset"><a href="{url}raw-rev/#node|short#">#desc|strip|escape|firstline|nonempty# <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3>
     <p class="changeset-age"><span>#date|age# ago</span></p>
 
     <dl class="overview">
@@ -49,7 +49,7 @@
         #child%changesetchild#
     </dl>
 
-    <p class="description">#desc|strip|escape|addbreaks#</p>
+    <p class="description">#desc|strip|escape|addbreaks|nonempty#</p>
 
     <table>
     #files#
--- a/templates/monoblue/fileannotate.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/monoblue/fileannotate.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -53,7 +53,7 @@
         <dd>#permissions|permissions#</dd>
     </dl>
 
-    <p class="description">{desc|strip|escape|addbreaks}</p>
+    <p class="description">{desc|strip|escape|addbreaks|nonempty}</p>
 
     <table class="annotated">
     {annotate%annotateline}
--- a/templates/monoblue/filerevision.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/monoblue/filerevision.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -53,7 +53,7 @@
         <dd>#permissions|permissions#</dd>
     </dl>
 
-    <p class="description">{desc|strip|escape|addbreaks}</p>
+    <p class="description">{desc|strip|escape|addbreaks|nonempty}</p>
 
     <div class="source">
     #text%fileline#
--- a/templates/monoblue/graph.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/monoblue/graph.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -75,7 +75,10 @@
         item = item.replace(/_PARITY/, 'parity' + parity);
         item = item.replace(/_NODEID/, cur[0]);
         item = item.replace(/_NODEID/, cur[0]);
-        item = item.replace(/_DESC/, cur[3]);
+        if (cur[3] != '')
+            item = item.replace(/_DESC/, cur[3]);
+        else
+            item = item.replace(/_DESC/, '(none)');
         item = item.replace(/_USER/, cur[4]);
         item = item.replace(/_DATE/, cur[5]);
 
--- a/templates/monoblue/map	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/monoblue/map	Mon Apr 20 12:10:04 2009 +0200
@@ -55,8 +55,8 @@
 tagtag = '<span class="tagtag" title="{name}">{name}</span> '
 branchtag = '<span class="branchtag" title="{name}">{name}</span> '
 inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> '
-shortlogentry = '<tr class="parity#parity#"><td class="nowrap">#date|age# ago</td><td>#author|person#</td><td><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape# <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></td><td class="nowrap"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">files</a></td></tr>'
-filelogentry = '<tr class="parity#parity#"><td class="nowrap">#date|age# ago</td><td><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape#</a></td><td class="nowrap"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>'
+shortlogentry = '<tr class="parity#parity#"><td class="nowrap">#date|age# ago</td><td>#author|person#</td><td><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape|nonempty# <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></td><td class="nowrap"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">files</a></td></tr>'
+filelogentry = '<tr class="parity#parity#"><td class="nowrap">#date|age# ago</td><td><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape|nonempty#</a></td><td class="nowrap"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>'
 archiveentry = '<li><a href="{url}archive/{node|short}{extension}">#type|escape#</a></li>'
 indexentry = '<tr class="parity{parity}"><td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td><td>{description}</td><td>{contact|obfuscate}</td><td>{lastchange|age} ago</td><td class="indexlinks">{archives%indexarchiveentry}</td><td><div class="rss_logo"><a href="{url}rss-log">RSS</a> <a href="{url}atom-log">Atom</a></div></td></tr>\n'
 indexarchiveentry = '<a href="{url}archive/{node|short}{extension}">{type|escape}</a> '
--- a/templates/paper/changeset.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/paper/changeset.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -35,7 +35,7 @@
 files, or words in the commit message</div>
 </form>
 
-<div class="description">{desc|strip|escape|addbreaks}</div>
+<div class="description">{desc|strip|escape|addbreaks|nonempty}</div>
 
 <table id="changesetEntry">
 <tr>
--- a/templates/paper/fileannotate.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/paper/fileannotate.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -39,7 +39,7 @@
 files, or words in the commit message</div>
 </form>
 
-<div class="description">{desc|strip|escape|addbreaks}</div>
+<div class="description">{desc|strip|escape|addbreaks|nonempty}</div>
 
 <table id="changesetEntry">
 <tr>
--- a/templates/paper/filediff.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/paper/filediff.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -38,7 +38,7 @@
 files, or words in the commit message</div>
 </form>
 
-<div class="description">{desc|strip|escape|addbreaks}</div>
+<div class="description">{desc|strip|escape|addbreaks|nonempty}</div>
 
 <table id="changesetEntry">
 <tr>
--- a/templates/paper/filelogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/paper/filelogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,5 +1,5 @@
  <tr class="parity{parity}">
   <td class="age">{date|age}</td>
   <td class="author">{author|person}</td>
-  <td class="description"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}</td>
+  <td class="description"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}</td>
  </tr>
--- a/templates/paper/filerevision.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/paper/filerevision.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -38,7 +38,7 @@
 files, or words in the commit message</div>
 </form>
 
-<div class="description">{desc|strip|escape|addbreaks}</div>
+<div class="description">{desc|strip|escape|addbreaks|nonempty}</div>
 
 <table id="changesetEntry">
 <tr>
--- a/templates/paper/graph.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/paper/graph.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -86,7 +86,10 @@
 	item = item.replace(/_PARITY/, 'parity' + parity);
 	item = item.replace(/_NODEID/, cur[0]);
 	item = item.replace(/_NODEID/, cur[0]);
-	item = item.replace(/_DESC/, cur[3]);
+	if (cur[3] != '')
+	    item = item.replace(/_DESC/, cur[3]);
+	else
+	    item = item.replace(/_DESC/, '(none)');
 	item = item.replace(/_USER/, cur[4]);
 	item = item.replace(/_DATE/, cur[5]);
 
--- a/templates/paper/shortlogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/paper/shortlogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,5 +1,5 @@
  <tr class="parity{parity}">
   <td class="age">{date|age}</td>
   <td class="author">{author|person}</td>
-  <td class="description"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}</td>
+  <td class="description"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}</td>
  </tr>
--- a/templates/rss/changelogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/rss/changelogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,7 +1,7 @@
 <item>
     <title>#desc|strip|firstline|strip|escape#</title>
     <guid isPermaLink="true">{urlbase}{url}rev/{node|short}</guid>
-    <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
+    <description><![CDATA[#desc|strip|escape|addbreaks|nonempty#]]></description>
     <author>#author|obfuscate#</author>
     <pubDate>#date|rfc822date#</pubDate>
 </item>
--- a/templates/rss/filelogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/rss/filelogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,7 +1,7 @@
 <item>
     <title>#desc|strip|firstline|strip|escape#</title>
     <link>{urlbase}{url}log{#node|short#}/{file|urlescape}</link>
-    <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
+    <description><![CDATA[#desc|strip|escape|addbreaks|nonempty#]]></description>
     <author>#author|obfuscate#</author>
     <pubDate>#date|rfc822date#</pubDate>
 </item>
--- a/templates/spartan/changelogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/spartan/changelogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,7 +1,7 @@
 <table class="logEntry parity#parity#">
  <tr>
   <th class="age">#date|age# ago:</th>
-  <th class="firstline">#desc|strip|firstline|escape#</th>
+  <th class="firstline">#desc|strip|firstline|escape|nonempty#</th>
  </tr>
  <tr>
   <th class="revision">changeset #rev#:</th>
--- a/templates/spartan/changeset.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/spartan/changeset.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -13,7 +13,7 @@
 #archives%archiveentry#
 </div>
 
-<h2>changeset: #desc|strip|escape|firstline#</h2>
+<h2>changeset: #desc|strip|escape|firstline|nonempty#</h2>
 
 <table id="changesetEntry">
 <tr>
@@ -37,7 +37,7 @@
 </tr>
 <tr>
  <th class="description">description:</th>
- <td class="description">#desc|strip|escape|addbreaks#</td>
+ <td class="description">#desc|strip|escape|addbreaks|nonempty#</td>
 </tr>
 </table>
 
--- a/templates/spartan/fileannotate.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/spartan/fileannotate.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -36,7 +36,7 @@
 </tr>
 <tr>
   <td class="metatag">description:</td>
-  <td>{desc|strip|escape|addbreaks}</td>
+  <td>{desc|strip|escape|addbreaks|nonempty}</td>
 </tr>
 </table>
 
--- a/templates/spartan/filelogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/spartan/filelogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -1,7 +1,7 @@
 <table class="logEntry parity#parity#">
  <tr>
   <th class="age">#date|age# ago:</th>
-  <th class="firstline"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape#</a></th>
+  <th class="firstline"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape|nonempty#</a></th>
  </tr>
  <tr>
   <th class="revision">revision #filerev#:</td>
--- a/templates/spartan/filerevision.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/spartan/filerevision.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -34,7 +34,7 @@
  <td>#permissions|permissions#</td></tr>
 <tr>
   <td class="metatag">description:</td>
-  <td>{desc|strip|escape|addbreaks}</td>
+  <td>{desc|strip|escape|addbreaks|nonempty}</td>
 </tr>
 </table>
 
--- a/templates/spartan/graph.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/spartan/graph.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -70,7 +70,10 @@
 	item = item.replace(/_PARITY/, 'parity' + parity);
 	item = item.replace(/_NODEID/, cur[0]);
 	item = item.replace(/_NODEID/, cur[0]);
-	item = item.replace(/_DESC/, cur[3]);
+	if (cur[3] != '')
+	    item = item.replace(/_DESC/, cur[3]);
+	else
+	    item = item.replace(/_DESC/, '(none)');
 	item = item.replace(/_USER/, cur[4]);
 	item = item.replace(/_DATE/, cur[5]);
 	
--- a/templates/spartan/shortlogentry.tmpl	Mon Apr 20 11:34:15 2009 +0200
+++ b/templates/spartan/shortlogentry.tmpl	Mon Apr 20 12:10:04 2009 +0200
@@ -2,6 +2,6 @@
  <tr>
   <td class="age">#date|age#</td>
   <td class="author">#author|person#</td>
-  <td class="node"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape#</a></td>
+  <td class="node"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#desc|strip|firstline|escape|nonempty#</a></td>
  </tr>
 </table>
Binary file tests/test-hgweb-commands.out has changed
--- a/tests/test-hgweb-empty.out	Mon Apr 20 11:34:15 2009 +0200
+++ b/tests/test-hgweb-empty.out	Mon Apr 20 12:10:04 2009 +0200
@@ -230,7 +230,10 @@
 	item = item.replace(/_PARITY/, 'parity' + parity);
 	item = item.replace(/_NODEID/, cur[0]);
 	item = item.replace(/_NODEID/, cur[0]);
-	item = item.replace(/_DESC/, cur[3]);
+	if (cur[3] != '')
+	    item = item.replace(/_DESC/, cur[3]);
+	else
+	    item = item.replace(/_DESC/, '(none)');
 	item = item.replace(/_USER/, cur[4]);
 	item = item.replace(/_DATE/, cur[5]);