[PATCH 2 of 2] hgweb: Use "nonempty" filter in templates for the changelog message

Rocco Rutte pdmef at gmx.net
Sun Apr 5 05:44:06 CDT 2009


# HG changeset patch
# User Rocco Rutte <pdmef at gmx.net>
# Date 1238927968 -7200
# Node ID ec9c1d61457d113903953f41c6fcbb745de468b5
# Parent  f5750b18bc83001b096bef156c2d81c7b9823df9
hgweb: Use "nonempty" filter in templates for the changelog message

Subversion allows empty commit logs which, after conversion, show up as
empty fields in hgweb and mostly don't allow selecting the
changeset. Using "nonempty" as filter, "(none)" is now printed instead.

It needs to be implemented using the filter because otherwise we'd
pollute the raw templates with bogus "(none)" messages.

diff --git a/templates/atom/changelogentry.tmpl b/templates/atom/changelogentry.tmpl
--- a/templates/atom/changelogentry.tmpl
+++ b/templates/atom/changelogentry.tmpl
@@ -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>
diff --git a/templates/gitweb/changelogentry.tmpl b/templates/gitweb/changelogentry.tmpl
--- a/templates/gitweb/changelogentry.tmpl
+++ b/templates/gitweb/changelogentry.tmpl
@@ -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>
diff --git a/templates/gitweb/changeset.tmpl b/templates/gitweb/changeset.tmpl
--- a/templates/gitweb/changeset.tmpl
+++ b/templates/gitweb/changeset.tmpl
@@ -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">
diff --git a/templates/gitweb/fileannotate.tmpl b/templates/gitweb/fileannotate.tmpl
--- a/templates/gitweb/fileannotate.tmpl
+++ b/templates/gitweb/fileannotate.tmpl
@@ -49,7 +49,7 @@ annotate |
 </div>
 
 <div class="page_path">
-{desc|strip|escape|addbreaks}
+{desc|strip|escape|addbreaks|nonempty}
 </div>
 <div class="page_body">
 <table>
diff --git a/templates/gitweb/filerevision.tmpl b/templates/gitweb/filerevision.tmpl
--- a/templates/gitweb/filerevision.tmpl
+++ b/templates/gitweb/filerevision.tmpl
@@ -49,7 +49,7 @@ file |
 </div>
 
 <div class="page_path">
-{desc|strip|escape|addbreaks}
+{desc|strip|escape|addbreaks|nonempty}
 </div>
 
 <div class="page_body">
diff --git a/templates/gitweb/graph.tmpl b/templates/gitweb/graph.tmpl
--- a/templates/gitweb/graph.tmpl
+++ b/templates/gitweb/graph.tmpl
@@ -78,7 +78,10 @@ graph.vertex = function(x, y, color, par
 	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]);
 	
diff --git a/templates/gitweb/map b/templates/gitweb/map
--- a/templates/gitweb/map
+++ b/templates/gitweb/map
@@ -56,8 +56,8 @@ graph = graph.tmpl
 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> '
diff --git a/templates/monoblue/changelogentry.tmpl b/templates/monoblue/changelogentry.tmpl
--- a/templates/monoblue/changelogentry.tmpl
+++ b/templates/monoblue/changelogentry.tmpl
@@ -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>
diff --git a/templates/monoblue/changeset.tmpl b/templates/monoblue/changeset.tmpl
--- a/templates/monoblue/changeset.tmpl
+++ b/templates/monoblue/changeset.tmpl
@@ -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#
diff --git a/templates/monoblue/fileannotate.tmpl b/templates/monoblue/fileannotate.tmpl
--- a/templates/monoblue/fileannotate.tmpl
+++ b/templates/monoblue/fileannotate.tmpl
@@ -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}
diff --git a/templates/monoblue/filerevision.tmpl b/templates/monoblue/filerevision.tmpl
--- a/templates/monoblue/filerevision.tmpl
+++ b/templates/monoblue/filerevision.tmpl
@@ -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#
diff --git a/templates/monoblue/graph.tmpl b/templates/monoblue/graph.tmpl
--- a/templates/monoblue/graph.tmpl
+++ b/templates/monoblue/graph.tmpl
@@ -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]);
 
diff --git a/templates/monoblue/map b/templates/monoblue/map
--- a/templates/monoblue/map
+++ b/templates/monoblue/map
@@ -55,8 +55,8 @@ shortlog = shortlog.tmpl
 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> '
diff --git a/templates/paper/changeset.tmpl b/templates/paper/changeset.tmpl
--- a/templates/paper/changeset.tmpl
+++ b/templates/paper/changeset.tmpl
@@ -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>
diff --git a/templates/paper/fileannotate.tmpl b/templates/paper/fileannotate.tmpl
--- a/templates/paper/fileannotate.tmpl
+++ b/templates/paper/fileannotate.tmpl
@@ -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>
diff --git a/templates/paper/filediff.tmpl b/templates/paper/filediff.tmpl
--- a/templates/paper/filediff.tmpl
+++ b/templates/paper/filediff.tmpl
@@ -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>
diff --git a/templates/paper/filelogentry.tmpl b/templates/paper/filelogentry.tmpl
--- a/templates/paper/filelogentry.tmpl
+++ b/templates/paper/filelogentry.tmpl
@@ -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>
diff --git a/templates/paper/filerevision.tmpl b/templates/paper/filerevision.tmpl
--- a/templates/paper/filerevision.tmpl
+++ b/templates/paper/filerevision.tmpl
@@ -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>
diff --git a/templates/paper/graph.tmpl b/templates/paper/graph.tmpl
--- a/templates/paper/graph.tmpl
+++ b/templates/paper/graph.tmpl
@@ -86,7 +86,10 @@ graph.vertex = function(x, y, color, par
 	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]);
 
diff --git a/templates/paper/shortlogentry.tmpl b/templates/paper/shortlogentry.tmpl
--- a/templates/paper/shortlogentry.tmpl
+++ b/templates/paper/shortlogentry.tmpl
@@ -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>
diff --git a/templates/rss/changelogentry.tmpl b/templates/rss/changelogentry.tmpl
--- a/templates/rss/changelogentry.tmpl
+++ b/templates/rss/changelogentry.tmpl
@@ -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>
diff --git a/templates/rss/filelogentry.tmpl b/templates/rss/filelogentry.tmpl
--- a/templates/rss/filelogentry.tmpl
+++ b/templates/rss/filelogentry.tmpl
@@ -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>
diff --git a/templates/spartan/changelogentry.tmpl b/templates/spartan/changelogentry.tmpl
--- a/templates/spartan/changelogentry.tmpl
+++ b/templates/spartan/changelogentry.tmpl
@@ -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>
diff --git a/templates/spartan/changeset.tmpl b/templates/spartan/changeset.tmpl
--- a/templates/spartan/changeset.tmpl
+++ b/templates/spartan/changeset.tmpl
@@ -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>
 
diff --git a/templates/spartan/fileannotate.tmpl b/templates/spartan/fileannotate.tmpl
--- a/templates/spartan/fileannotate.tmpl
+++ b/templates/spartan/fileannotate.tmpl
@@ -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>
 
diff --git a/templates/spartan/filelogentry.tmpl b/templates/spartan/filelogentry.tmpl
--- a/templates/spartan/filelogentry.tmpl
+++ b/templates/spartan/filelogentry.tmpl
@@ -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>
diff --git a/templates/spartan/filerevision.tmpl b/templates/spartan/filerevision.tmpl
--- a/templates/spartan/filerevision.tmpl
+++ b/templates/spartan/filerevision.tmpl
@@ -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>
 
diff --git a/templates/spartan/graph.tmpl b/templates/spartan/graph.tmpl
--- a/templates/spartan/graph.tmpl
+++ b/templates/spartan/graph.tmpl
@@ -70,7 +70,10 @@ graph.vertex = function(x, y, color, par
 	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]);
 	
diff --git a/templates/spartan/shortlogentry.tmpl b/templates/spartan/shortlogentry.tmpl
--- a/templates/spartan/shortlogentry.tmpl
+++ b/templates/spartan/shortlogentry.tmpl
@@ -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>
diff --git a/tests/test-hgweb-commands.out b/tests/test-hgweb-commands.out
index e32a78485342f8c548bec6855c6d2794f113ba54..752fda8197b049ba09e48c002a8e2cd37cc95c3f
GIT binary patch
literal 24288
zc%1D#ZIB$rb@>C%EhJIEP(^H0tx-;Ql5Tfq_rCA;7KytvlB2KaPGCtnAG15XyQ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#u8VfpY%ICtrZWXlG8+P3g(iVr`p)-NUwK*dmYsH4^T2PUIZeeB#G8<wqoVLI)
zMsjr*?*#-?7~V5R%4$tFR)7`Nbo|C8%83>&LmP+WCFA{ILTj?6QYndMA`LO72szXO
zq6eW;5DsK!Es&3}SJE7s1&8?Lon+Fg)hv_jlvDV7QKv{vwV@;(BMM3p%n71AqZZi#
zMgj&^?Km!PyHdt4QQ_}X;!#M5+lU at fvGeSKZDtjvn;Wgy<*hc+KN#zV`r}ko@}^~j
zZ6q27R^@t0HN0lXALH1NTpx+Fu;bmrJezeKA0LJevw-#NxHk>mtWsFKOrRj88L<N#
z5suSFI!+7mj0jT?`dzIP`Ecf1i6 at LL!;ch)HNt7)JZ9C%6!6IIw75M*a04gJl2YUW
zU1`X$eB)<E79N-p*DLEo5f~pPeC+%!V=4MY3c$JA)YjUhlGj(@OUvbQqTMCY$cXQj
zB=m%iwgD$Cw1N}FHO0Q4P1qM~aDIptTSC)|Hl2;xAunwI5?O$(eVf>##<H_+IXVlU
zgnffjUj*mV6{rmW0==Qr5PR2=k!sPgj0U=`t{c)UgpQFx+`qEwV<fF)hQI_PNC8j7
z*e15c5m(%DU<Eq30nMx^%0q-XkHRog;8=qVa<Iof5~5 at 1NUAEt+CK_mwt38&6U&C_
zjtsJ?t%LmpCP at Z&FOjmQJ5YYFU;wc&fOLf->M;107V6^MWchr$$@GyUhmOpU>4TGp
NjvkzyJ~BO(`ai%N(Ru&?

diff --git a/tests/test-hgweb-empty.out b/tests/test-hgweb-empty.out
--- a/tests/test-hgweb-empty.out
+++ b/tests/test-hgweb-empty.out
@@ -230,7 +230,10 @@ graph.vertex = function(x, y, color, par
 	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]);
 


More information about the Mercurial-devel mailing list