color: drop the _enabledbydefault module variable
authorBoris Feld <boris.feld@octobus.net>
Sat, 15 Jul 2017 14:14:46 +0200
changeset 33521 de1cb83728f8
parent 33520 6e19198cbe31
child 33522 62b29ca72d1a
color: drop the _enabledbydefault module variable Since color is on by default, cleanup the now useless variable in both core and color extension.
hgext/color.py
mercurial/color.py
--- a/hgext/color.py	Fri Jun 30 03:44:45 2017 +0200
+++ b/hgext/color.py	Sat Jul 15 14:14:46 2017 +0200
@@ -18,14 +18,8 @@
 
 from __future__ import absolute_import
 
-from mercurial import color
-
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
-
-def extsetup(ui):
-    # change default color config
-    color._enabledbydefault = True
--- a/mercurial/color.py	Fri Jun 30 03:44:45 2017 +0200
+++ b/mercurial/color.py	Sat Jul 15 14:14:46 2017 +0200
@@ -45,8 +45,6 @@
     curses = None
     _baseterminfoparams = {}
 
-_enabledbydefault = True
-
 # start and stop parameters for effects
 _effects = {
     'none': 0,
@@ -185,10 +183,7 @@
 def _modesetup(ui):
     if ui.plain():
         return None
-    default = 'never'
-    if _enabledbydefault:
-        default = 'auto'
-    config = ui.config('ui', 'color', default)
+    config = ui.config('ui', 'color', 'auto')
     if config == 'debug':
         return 'debug'