diff hgext/color.py @ 22464:964dd1c491ca

color: change the debug output format Before, the format was label(labeled text) # single label [label1 label2](labeled text) # multiple Now, it's [labels|labeled text] ..which should make things a bit more clear.
author Matt Mackall <mpm@selenic.com>
date Fri, 19 Sep 2014 12:51:15 -0500
parents 1c4ae0f6a30f
children f8e2aebbb24c
line wrap: on
line diff
--- a/hgext/color.py	Sun Aug 24 17:40:27 2014 -0400
+++ b/hgext/color.py	Fri Sep 19 12:51:15 2014 -0500
@@ -398,13 +398,11 @@
                 *[self.label(str(a), label) for a in args], **opts)
 
     def showlabel(self, msg, label):
-        if ' ' in label:
-            label = '[' + label + ']'
         if label:
             if msg and msg[-1] == '\n':
-                return "%s(%s)\n" % (label, msg[:-1])
+                return "[%s|%s]\n" % (label, msg[:-1])
             else:
-                return "%s(%s)" % (label, msg)
+                return "[%s|%s]" % (label, msg)
         else:
             return msg