color: fallback and test label as an effect
authorSean Farley <sean.michael.farley@gmail.com>
Mon, 07 Apr 2014 15:37:27 -0500
changeset 20993 a8db48e997b5
parent 20992 05086b56b564
child 20994 40800668e019
color: fallback and test label as an effect With this changeset, we can now send a color name directly to the label function, e.g. $ hg log -r . -T "{label('red', node|short)}\n"
hgext/color.py
--- a/hgext/color.py	Mon Apr 07 15:33:46 2014 -0500
+++ b/hgext/color.py	Mon Apr 07 15:37:27 2014 -0500
@@ -382,6 +382,8 @@
             s = _styles.get(l, '')
             if s:
                 effects.append(s)
+            elif valideffect(l):
+                effects.append(l)
         effects = ' '.join(effects)
         if effects:
             return '\n'.join([render_effects(s, effects)