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.
--- 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)