[PATCH 1 of 6] run-tests: flush output stream before prompting to accept changes

Matt Harbison mharbison72 at gmail.com
Sun Sep 30 05:46:20 UTC 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1538267632 14400
#      Sat Sep 29 20:33:52 2018 -0400
# Node ID 32349019b1ed3beae780cfe4c628d71714c6f675
# Parent  7eb937f598d1c7b79502a62e674bd667d398e2ef
run-tests: flush output stream before prompting to accept changes

With py3 on Windows, the prompt to accept changes in an --interactive run wasn't
showing up until after the choice was read from stdin.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1875,6 +1875,7 @@ class TestResult(unittest._TextTestResul
                         'changes)')
                 else:
                     self.stream.write('Accept this change? [n] ')
+                    self.stream.flush()
                     answer = sys.stdin.readline().strip()
                     if answer.lower() in ('y', 'yes'):
                         if test.path.endswith(b'.t'):


More information about the Mercurial-devel mailing list