Mercurial > hg
changeset 31106:a185b903bda3
color: have the 'ui' object carry the '_colormode' directly
Before this changeset, the value was carried by the class to work around
limitation of the extensions initialisation. Now that the initialisation is
cleanly handled in 'dispatch', we can drop this work around.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 21 Feb 2017 18:22:07 +0100 |
parents | 45be7590301d |
children | fbce78c58f1e |
files | mercurial/color.py mercurial/ui.py |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/color.py Tue Feb 21 18:20:12 2017 +0100 +++ b/mercurial/color.py Tue Feb 21 18:22:07 2017 +0100 @@ -168,7 +168,7 @@ argument. That function both set the colormode for the ui object and read the configuration looking for custom colors and effect definitions.""" mode = _modesetup(ui, coloropts) - ui.__class__._colormode = mode + ui._colormode = mode if mode and mode != 'debug': configstyles(ui)
--- a/mercurial/ui.py Tue Feb 21 18:20:12 2017 +0100 +++ b/mercurial/ui.py Tue Feb 21 18:22:07 2017 +0100 @@ -128,8 +128,6 @@ raise error.SignalInterrupt class ui(object): - # color mode: see mercurial/color.py for possible value - _colormode = None def __init__(self, src=None): """Create a fresh new ui object if no src given @@ -157,6 +155,8 @@ self.insecureconnections = False # Blocked time self.logblockedtimes = False + # color mode: see mercurial/color.py for possible value + self._colormode = None if src: self.fout = src.fout @@ -173,6 +173,8 @@ self.environ = src.environ self.callhooks = src.callhooks self.insecureconnections = src.insecureconnections + self._colormode = src._colormode + self.fixconfig() self.httppasswordmgrdb = src.httppasswordmgrdb