[PATCH] profile: colorize output on Windows
Yuya Nishihara
yuya at tcha.org
Sun Mar 4 07:17:33 EST 2018
On Sat, 03 Mar 2018 00:50:46 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1520055359 18000
> # Sat Mar 03 00:35:59 2018 -0500
> # Node ID 57af2e6a832eabb2e584977a11cc34c97092cfcd
> # Parent ed77050177498aff4ff4db94f30d5bdeefd8f76e
> profile: colorize output on Windows
Queued, thanks.
> diff --git a/mercurial/profiling.py b/mercurial/profiling.py
> --- a/mercurial/profiling.py
> +++ b/mercurial/profiling.py
> @@ -14,6 +14,7 @@
> encoding,
> error,
> extensions,
> + pycompat,
> util,
> )
>
> @@ -200,6 +201,16 @@
> elif self._output:
> path = self._ui.expandpath(self._output)
> self._fp = open(path, 'wb')
> + elif pycompat.iswindows:
Added inline comment "parse escape sequence by win32print()" here because
it seems unclear why we need this only for Windows.
> + class uifp(object):
> + def __init__(self, ui):
> + self._ui = ui
> + def write(self, data):
> + self._ui.write_err(data)
More information about the Mercurial-devel
mailing list