diff hgext/color.py @ 19073:d78d0256198e stable

color: set _colormode to None when mode is unset (issue3895) Previously, colorui assumed that it would only be called when mode wasn't None. 7ae12ce87594 changed that, so now colorui needs to care about whether it should colorize output.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 19 Apr 2013 16:57:10 -0700
parents b7b50a54bec9
children 0250047a365e
line wrap: on
line diff
--- a/hgext/color.py	Fri Apr 19 16:57:20 2013 -0700
+++ b/hgext/color.py	Fri Apr 19 16:57:10 2013 -0700
@@ -398,8 +398,8 @@
         ui.__class__ = colorui
     def colorcmd(orig, ui_, opts, cmd, cmdfunc):
         mode = _modesetup(ui_, opts)
+        colorui._colormode = mode
         if mode:
-            colorui._colormode = mode
             extstyles()
             configstyles(ui_)
         return orig(ui_, opts, cmd, cmdfunc)