Mercurial > hg
comparison hgext/color.py @ 31103: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 | 96d561c90ad0 |
children | 8346b2f09e79 |
comparison
equal
deleted
inserted
replaced
31102:96d561c90ad0 | 31103:c1997c5d1ae3 |
---|---|
187 # be specifying the version(s) of Mercurial they are tested with, or | 187 # be specifying the version(s) of Mercurial they are tested with, or |
188 # leave the attribute unspecified. | 188 # leave the attribute unspecified. |
189 testedwith = 'ships-with-hg-core' | 189 testedwith = 'ships-with-hg-core' |
190 | 190 |
191 def uisetup(ui): | 191 def uisetup(ui): |
192 if ui.plain(): | |
193 return | |
194 def colorcmd(orig, ui_, opts, cmd, cmdfunc): | 192 def colorcmd(orig, ui_, opts, cmd, cmdfunc): |
195 mode = color._modesetup(ui_, opts['color']) | 193 mode = color._modesetup(ui_, opts['color']) |
196 uimod.ui._colormode = mode | 194 uimod.ui._colormode = mode |
197 if mode and mode != 'debug': | 195 if mode and mode != 'debug': |
198 color.configstyles(ui_) | 196 color.configstyles(ui_) |