# HG changeset patch # User Sune Foldager # Date 2018-06-25 14:36:14 # Node ID 0b63a6743010dfdbf8a8154186e119949bdaa1cc # Parent 1322ae04d3d71c9bab8ca6e70c77dfa867421c9b procutil: use unbuffered stdout on Windows Windows doesn't support line buffering, treating it as fully buffered. This causes output of slow commands to stutter. We use unbuffered instead. diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py +++ b/mercurial/utils/procutil.py @@ -42,9 +42,13 @@ def isatty(fp): # glibc determines buffering on first write to stdout - if we replace a TTY # destined stdout with a pipe destined stdout (e.g. pager), we want line -# buffering +# buffering (or unbuffered, on Windows) if isatty(stdout): - stdout = os.fdopen(stdout.fileno(), r'wb', 1) + if pycompat.iswindows: + # Windows doesn't support line buffering + stdout = os.fdopen(stdout.fileno(), r'wb', 0) + else: + stdout = os.fdopen(stdout.fileno(), r'wb', 1) if pycompat.iswindows: from .. import windows as platform