changeset 33627:c2c6a0f7408b stable

ui: make sure buffer is flushed before waiting for user input (issue5587) Without this patch on Windows 'hg ci -i' hangs waiting for user input and "examine changes to 'file'? [Ynesfdaq?]" is never displayed (at least if the diff is sufficiently small). When Ctrl+C is pressed, this prompt becomes visible, which suggests that the buffer just wasn't flushed. I've never seen this happening on Linux, but this looks harmless enough to not platform-gate it.
author Kostia Balytskyi <ikostia@fb.com>
date Sat, 05 Aug 2017 13:19:09 -0700
parents 524b13fc711f
children aa7a3f6e3729
files mercurial/ui.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Wed Aug 02 22:51:19 2017 +0900
+++ b/mercurial/ui.py	Sat Aug 05 13:19:09 2017 -0700
@@ -1215,6 +1215,7 @@
         # call write() so output goes through subclassed implementation
         # e.g. color extension on Windows
         self.write(prompt, prompt=True)
+        self.flush()
 
         # instead of trying to emulate raw_input, swap (self.fin,
         # self.fout) with (sys.stdin, sys.stdout)