D6843: ui: option to preserve the progress bar

joerg.sonnenberger (Joerg Sonnenberger) phabricator at mercurial-scm.org
Wed Sep 11 21:41:20 EDT 2019


joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Some interface like the fast-import format of git are meant for pipe
  processing. It can be still desirable to have progress bars in this
  case, but clearing the bar after each output operation is not desirable.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6843

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1023,8 +1023,9 @@
                 self._buffers[-1].extend(args)
             return
 
-        # inliend _writenobuf() for speed
-        self._progclear()
+        # inlined _writenobuf() for speed
+        if not opts.get(r'keepprogressbar', False):
+            self._progclear()
         msg = b''.join(args)
 
         # opencode timeblockedsection because this is a critical path
@@ -1061,7 +1062,8 @@
 
     def _writenobuf(self, dest, *args, **opts):
         # update write() as well if you touch this code
-        self._progclear()
+        if not opts.get(r'keepprogressbar', False):
+            self._progclear()
         msg = b''.join(args)
 
         # opencode timeblockedsection because this is a critical path



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list