changeset 33179:95c57596b380

configitems: register the 'color.mode' config
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 30 Jun 2017 03:32:09 +0200
parents a0068f49b5f6
children 21383dbb3611
files mercurial/color.py mercurial/configitems.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/color.py	Sat Jul 01 21:57:17 2017 +0200
+++ b/mercurial/color.py	Fri Jun 30 03:32:09 2017 +0200
@@ -208,7 +208,7 @@
     formatted = (always or (encoding.environ.get('TERM') != 'dumb'
                  and ui.formatted()))
 
-    mode = ui.config('color', 'mode', 'auto')
+    mode = ui.config('color', 'mode')
 
     # If pager is active, color.pagermode overrides color.mode.
     if getattr(ui, 'pageractive', False):
--- a/mercurial/configitems.py	Sat Jul 01 21:57:17 2017 +0200
+++ b/mercurial/configitems.py	Fri Jun 30 03:32:09 2017 +0200
@@ -56,6 +56,9 @@
 
 coreconfigitem = getitemregister(coreitems)
 
+coreconfigitem('color', 'mode',
+    default='auto',
+)
 coreconfigitem('devel', 'all-warnings',
     default=False,
 )