Mercurial > hg
changeset 31090:e9f96ccf36a6
ui: extract the low level part of 'write' in a dedicated function
We are about to add some extra logic related to color. That logic will need to
access the low level layer of ui doing the actual write to a stream. (eg:
'win32print'). We extract this logic into a private method for this purpose.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 24 Feb 2017 19:27:00 +0100 |
parents | a2ee25ff75e5 |
children | ad074f900907 |
files | mercurial/ui.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/ui.py Fri Feb 24 21:34:07 2017 +0100 +++ b/mercurial/ui.py Fri Feb 24 19:27:00 2017 +0100 @@ -796,11 +796,14 @@ if self._buffers and not opts.get('prompt', False): self._buffers[-1].extend(a for a in args) else: + self._write(*args, **opts) + + def _write(self, *msgs, **opts): self._progclear() # opencode timeblockedsection because this is a critical path starttime = util.timer() try: - for a in args: + for a in msgs: self.fout.write(a) finally: self._blockedtimes['stdio_blocked'] += \