Patchwork [03,of,18] configitems: register the 'color.mode' config

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 2:57 a.m.
Message ID <c6dc2fa9b34d85873c2e.1498964251@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21892/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 2:57 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498786329 -7200
#      Fri Jun 30 03:32:09 2017 +0200
# Node ID c6dc2fa9b34d85873c2e00a996f142c9f17e74a8
# Parent  f92fcf4884e2f2959f33011fb4996cca8c594e65
# EXP-Topic config.register.core
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r c6dc2fa9b34d
configitems: register the 'color.mode' config

Patch

diff --git a/mercurial/color.py b/mercurial/color.py
--- a/mercurial/color.py
+++ b/mercurial/color.py
@@ -208,7 +208,7 @@  def _modesetup(ui):
     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):
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -56,6 +56,9 @@  def getitemregister(configtable):
 
 coreconfigitem = getitemregister(coreitems)
 
+coreconfigitem('color', 'mode',
+    default='auto',
+)
 coreconfigitem('devel', 'all-warnings',
     default=False,
 )