changeset 44298:0e8b28fb751b

httpconnection: allow `httpsendfile` subclasses to suppress the progressbar This will be neccessary for LFS, which manages the progressbar outside of the file. Differential Revision: https://phab.mercurial-scm.org/D7960
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 21 Jan 2020 10:24:32 -0500
parents cf1f8660e568
children 4caac36c66bc
files mercurial/httpconnection.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/httpconnection.py	Mon Feb 10 21:54:12 2020 +0100
+++ b/mercurial/httpconnection.py	Tue Jan 21 10:24:32 2020 -0500
@@ -39,12 +39,15 @@
         self.write = self._data.write
         self.length = os.fstat(self._data.fileno()).st_size
         self._pos = 0
+        self._progress = self._makeprogress()
+
+    def _makeprogress(self):
         # We pass double the max for total because we currently have
         # to send the bundle twice in the case of a server that
         # requires authentication. Since we can't know until we try
         # once whether authentication will be required, just lie to
         # the user and maybe the push succeeds suddenly at 50%.
-        self._progress = ui.makeprogress(
+        return self.ui.makeprogress(
             _(b'sending'), unit=_(b'kb'), total=(self.length // 1024 * 2)
         )