Comments
Patch
@@ -407,8 +407,8 @@ class colorui(uimod.ui):
*[self.label(str(a), label) for a in args], **opts)
def showlabel(self, msg, label):
- if label:
- if msg and msg[-1] == '\n':
+ if label and msg:
+ if msg[-1] == '\n':
return "[%s|%s]\n" % (label, msg[:-1])
else:
return "[%s|%s]" % (label, msg)
@@ -152,6 +152,11 @@ Make sure ui.formatted=False works
[log.date|date: Thu Jan 01 00:00:00 1970 +0000]
[log.summary|summary: initial checkin]
+Labels on empty strings should not be displayed, labels on custom
+templates should be.
+
+ $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}'
+ [my.label|test]
$ touch modified added unknown ignored
$ hg add added
$ hg remove removed