# HG changeset patch # User Kostia Balytskyi # Date 1501964349 25200 # Node ID c2c6a0f7408b642df7a98382bad08291b09f49dc # Parent 524b13fc711f76343557f054d2a11678ef83f8c8 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. diff -r 524b13fc711f -r c2c6a0f7408b mercurial/ui.py --- 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)