changeset 32026:57042e91521a

color: turn on by default (but for windows) Color support is all in core for a couple of months. I've browsed the bug tracker without finding any blocker bug. So I'm moving forward and enable color on by default before '4.2-rc'. In the worse case, having it on in the release candidate will help us to find blocker bug and we can turn it off for the final release. I remember people talking about issue with Windows during the freeze so I'm keeping it off by default on that OS. We could do various cleaning of the color used and the label issued. However the label are probably already in our backward compatibility envelope since the color extensions has been around since for ever and I do not think the color choice themself should be considered BC. So I think we should rather gives color to all user sooner than later. A couple of test needs to be updated to avoid having color related control code spoil the tested output.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 16 Apr 2017 02:32:51 +0200
parents d323d9e0d7b4
children 8b7f794d6a9d
files mercurial/color.py tests/test-mq.t tests/test-pager-legacy.t tests/test-pager.t
diffstat 4 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/color.py	Sun Apr 16 02:48:06 2017 +0200
+++ b/mercurial/color.py	Sun Apr 16 02:32:51 2017 +0200
@@ -45,8 +45,7 @@
     curses = None
     _baseterminfoparams = {}
 
-# allow the extensions to change the default
-_enabledbydefault = False
+_enabledbydefault = pycompat.osname != 'nt'
 
 # start and stop parameters for effects
 _effects = {
--- a/tests/test-mq.t	Sun Apr 16 02:48:06 2017 +0200
+++ b/tests/test-mq.t	Sun Apr 16 02:32:51 2017 +0200
@@ -365,10 +365,10 @@
 
 setting columns & formatted tests truncating (issue1912)
 
-  $ COLUMNS=4 hg qseries --config ui.formatted=true
+  $ COLUMNS=4 hg qseries --config ui.formatted=true --color=no
   test.patch
   test2.patch
-  $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
+  $ COLUMNS=20 hg qseries --config ui.formatted=true -vs --color=no
   0 A test.patch: f...
   1 A test2.patch: 
   $ hg qpop
--- a/tests/test-pager-legacy.t	Sun Apr 16 02:48:06 2017 +0200
+++ b/tests/test-pager-legacy.t	Sun Apr 16 02:32:51 2017 +0200
@@ -10,6 +10,7 @@
   $ cat >> $HGRCPATH <<EOF
   > [ui]
   > formatted = yes
+  > color = no
   > [extensions]
   > pager=
   > [pager]
--- a/tests/test-pager.t	Sun Apr 16 02:48:06 2017 +0200
+++ b/tests/test-pager.t	Sun Apr 16 02:32:51 2017 +0200
@@ -10,6 +10,7 @@
   $ cat >> $HGRCPATH <<EOF
   > [ui]
   > formatted = yes
+  > color = no
   > [pager]
   > pager = python $TESTTMP/fakepager.py
   > EOF