[PATCH 2 of 3] [RFC] color: allow color and pager to work on Windows with 'color.mode=auto'

Yuya Nishihara yuya at tcha.org
Sat Mar 25 00:29:21 EDT 2017


On Mon, 20 Mar 2017 00:53:18 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1489985292 14400
> #      Mon Mar 20 00:48:12 2017 -0400
> # Node ID 6e72bb689e57c985b138c580acb4cad8053dc180
> # Parent  a32b379ffe151b8b094dcd67ef5b6bd551203dbe
> [RFC] color: allow color and pager to work on Windows with 'color.mode=auto'

> +_activeeffects = _effects.copy()
> +
>  _defaultstyles = {
>      'grep.match': 'red bold',
>      'grep.linenumber': 'green',
> @@ -231,12 +233,14 @@
>          if mode == realmode and ui.formatted():
>              ui.warn(_('warning: failed to set color mode to %s\n') % mode)
>  
> +    _activeeffects = _effects.copy()
> +
>      if realmode == 'win32':
>          ui._terminfoparams.clear()
>          if not w32effects:
>              modewarn()
>              return None
> -        _effects.update(w32effects)
> +        _activeeffects.update(w32effects)

Perhaps _activeeffects should be moved to ui since we're getting rid of
mutable constants from color.py.


More information about the Mercurial-devel mailing list