# HG changeset patch # User Augie Fackler # Date 1443240648 14400 # Node ID 72bccc1f26b1a2e88243c8964781c2e0aaf0a978 # Parent 2cac6126329f681e451c54c74db99fbc3f2a81fa progress: force a repaint of a printed progress bar after a clear() This avoids some visual flickering of the progress bar in convert and probably some other operations. Previously, a line of output would erase the progress bar, and then it would wait `progress.refresh` seconds (default of 0.1) before redrawing the progress bar. Now if we've ever painted a progress bar, we schedule the progress bar for immediate repainting on the next progress call, which helps lend the illusion that the progress bar is "always" there. In practice, it's merely there more of the time, but it ends up being a lot easier to read during convert. diff -r 2cac6126329f -r 72bccc1f26b1 mercurial/progress.py --- a/mercurial/progress.py Tue Sep 29 14:08:37 2015 -0500 +++ b/mercurial/progress.py Sat Sep 26 00:10:48 2015 -0400 @@ -166,6 +166,9 @@ if not shouldprint(self.ui): return sys.stderr.write('\r%s\r' % (' ' * self.width())) + if self.printed: + # force immediate re-paint of progress bar + self.lastprint = 0 def complete(self): if not shouldprint(self.ui):