diff mercurial/color.py @ 31120:c1997c5d1ae3

color: handle 'ui.plain()' directly in mode setup If 'ui.plain()' is set we should not colorize. We move that logic into the function that determine and setup the color mode. As all other code respect the resulting mode this will be equivalent.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 21 Feb 2017 17:51:43 +0100
parents 9021a94a7dbf
children 45be7590301d
line wrap: on
line diff
--- a/mercurial/color.py	Tue Feb 21 17:50:04 2017 +0100
+++ b/mercurial/color.py	Tue Feb 21 17:51:43 2017 +0100
@@ -162,6 +162,8 @@
         _terminfo_params.clear()
 
 def _modesetup(ui, coloropt):
+    if ui.plain():
+        return None
     if coloropt == 'debug':
         return 'debug'