Mercurial > hg
diff hgext/color.py @ 31094:0c003943134f
color: move 'write-err' logic to the core ui class
This is similar to what we needed for 'write', we move the logic from the
extension to the core class. Beside the dispatch to 'win32print', we just apply
label to the argument.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 20 Feb 2017 12:42:23 +0100 |
parents | ad074f900907 |
children | b4cb86ab4c71 |
line wrap: on
line diff
--- a/hgext/color.py Fri Feb 24 19:53:41 2017 +0100 +++ b/hgext/color.py Mon Feb 20 12:42:23 2017 +0100 @@ -297,19 +297,7 @@ return None class colorui(uimod.ui): - - def write_err(self, *args, **opts): - if self._colormode is None: - return super(colorui, self).write_err(*args, **opts) - - label = opts.get('label', '') - if self._bufferstates and self._bufferstates[-1][0]: - return self.write(*args, **opts) - if self._colormode == 'win32': - color.win32print(super(colorui, self).write_err, *args, **opts) - else: - return super(colorui, self).write_err( - *[self.label(a, label) for a in args], **opts) + pass def uisetup(ui): if ui.plain():