diff mercurial/templates/map-cmdline.default @ 24637:c1cb6523e968

templates-default: do not show description or summary if empty changeset_printer shows description only if ctx.description().strip() is not empty. The default template should do the same way.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 27 Mar 2015 22:12:53 +0900
parents 6136704b975d
children 9b1a8ce1f03b
line wrap: on
line diff
--- a/mercurial/templates/map-cmdline.default	Mon Apr 06 10:51:53 2015 -0700
+++ b/mercurial/templates/map-cmdline.default	Fri Mar 27 22:12:53 2015 +0900
@@ -58,8 +58,8 @@
 user = '{label("log.user",
                "user:        {author}")}\n'
 
-summary = '{label("log.summary",
-                  "summary:     {desc|firstline}")}\n'
+summary = '{if(desc|strip, "{label('log.summary',
+                                   'summary:     {desc|firstline}')}\n")}'
 
 ldate = '{label("log.date",
                 "date:        {date|date}")}\n'
@@ -67,7 +67,7 @@
 extra = '{label("ui.debug log.extra",
                 "extra:       {key}={value|stringescape}")}\n'
 
-description = '{label("ui.note log.description",
-                       "description:")}
-               {label("ui.note log.description",
-                       "{desc|strip}")}\n\n'
+description = '{if(desc|strip, "{label('ui.note log.description',
+                                       'description:')}
+                                {label('ui.note log.description',
+                                       '{desc|strip}')}\n\n")}'