# HG changeset patch # User Pierre-Yves David # Date 1478459453 -3600 # Node ID 1613c55ad3d621bc78d4b176bd985e813a8cbd30 # Parent 268caf97c38f4543c088e2e3938b9f33e55ff959 color: pass 'ui' to 'win32print' Same logic as before,'win32print' relies on some data we will move on the 'ui' object soon, we update the API beforehand for clarity. diff -r 268caf97c38f -r 1613c55ad3d6 mercurial/color.py --- a/mercurial/color.py Sat Feb 25 15:00:51 2017 +0100 +++ b/mercurial/color.py Sun Nov 06 20:10:53 2016 +0100 @@ -423,11 +423,11 @@ ansire = re.compile('\033\[([^m]*)m([^\033]*)(.*)', re.MULTILINE | re.DOTALL) - def win32print(writefunc, *msgs, **opts): + def win32print(ui, writefunc, *msgs, **opts): for text in msgs: - _win32print(text, writefunc, **opts) + _win32print(ui, text, writefunc, **opts) - def _win32print(text, writefunc, **opts): + def _win32print(ui, text, writefunc, **opts): label = opts.get('label', '') attr = origattr diff -r 268caf97c38f -r 1613c55ad3d6 mercurial/ui.py --- a/mercurial/ui.py Sat Feb 25 15:00:51 2017 +0100 +++ b/mercurial/ui.py Sun Nov 06 20:10:53 2016 +0100 @@ -805,7 +805,7 @@ elif self._colormode == 'win32': # windows color printing is its own can of crab, defer to # the color module and that is it. - color.win32print(self._write, *args, **opts) + color.win32print(self, self._write, *args, **opts) else: msgs = args if self._colormode is not None: @@ -831,7 +831,7 @@ elif self._colormode == 'win32': # windows color printing is its own can of crab, defer to # the color module and that is it. - color.win32print(self._write_err, *args, **opts) + color.win32print(self, self._write_err, *args, **opts) else: msgs = args if self._colormode is not None: