diff mercurial/ui.py @ 31106:a185b903bda3

color: have the 'ui' object carry the '_colormode' directly Before this changeset, the value was carried by the class to work around limitation of the extensions initialisation. Now that the initialisation is cleanly handled in 'dispatch', we can drop this work around.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 21 Feb 2017 18:22:07 +0100
parents 0c003943134f
children fbce78c58f1e
line wrap: on
line diff
--- a/mercurial/ui.py	Tue Feb 21 18:20:12 2017 +0100
+++ b/mercurial/ui.py	Tue Feb 21 18:22:07 2017 +0100
@@ -128,8 +128,6 @@
     raise error.SignalInterrupt
 
 class ui(object):
-    # color mode: see mercurial/color.py for possible value
-    _colormode = None
     def __init__(self, src=None):
         """Create a fresh new ui object if no src given
 
@@ -157,6 +155,8 @@
         self.insecureconnections = False
         # Blocked time
         self.logblockedtimes = False
+        # color mode: see mercurial/color.py for possible value
+        self._colormode = None
 
         if src:
             self.fout = src.fout
@@ -173,6 +173,8 @@
             self.environ = src.environ
             self.callhooks = src.callhooks
             self.insecureconnections = src.insecureconnections
+            self._colormode = src._colormode
+
             self.fixconfig()
 
             self.httppasswordmgrdb = src.httppasswordmgrdb