# HG changeset patch # User Pierre-Yves David # Date 2017-06-30 01:32:09 # Node ID 95c57596b3807421eb10316cb6247735cc6ed746 # Parent a0068f49b5f639d60f46589415c82ae7defc4891 configitems: register the 'color.mode' config 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, )