# HG changeset patch # User Kyle Lippincott # Date 1578014857 28800 # Node ID 4e0a6d157910ca326d17bb2e2e57d63944f94126 # Parent 7ca8aa8840c07ac51b103af8b5a6384780a76381 progress: flush stderr after clearing On python3, ui.stderr is buffered, it seems, so we need to flush it to actually get the progress bar off the screen. This is important since ui.write() will call into progbar.clear() if it thinks there's a progress bar on the screen, with the intent that the next thing it outputs is at the beginning of the line (instead of at the end of the progress bar line). Without the flush, we buffer up the clearing of the screen, and we get some really weird/corrupt output. Differential Revision: https://phab.mercurial-scm.org/D7784 diff -r 7ca8aa8840c0 -r 4e0a6d157910 mercurial/progress.py --- a/mercurial/progress.py Tue Dec 24 01:38:02 2019 -0500 +++ b/mercurial/progress.py Thu Jan 02 17:27:37 2020 -0800 @@ -193,6 +193,7 @@ if not self.printed or not self.lastprint or not shouldprint(self.ui): return self._writeerr(b'\r%s\r' % (b' ' * self.width())) + self._flusherr() if self.printed: # force immediate re-paint of progress bar self.lastprint = 0