##// END OF EJS Templates
httpconnection: allow `httpsendfile` subclasses to suppress the progressbar...
Matt Harbison -
r44780:0e8b28fb default
parent child Browse files
Show More
@@ -39,12 +39,15 b' class httpsendfile(object):'
39 self.write = self._data.write
39 self.write = self._data.write
40 self.length = os.fstat(self._data.fileno()).st_size
40 self.length = os.fstat(self._data.fileno()).st_size
41 self._pos = 0
41 self._pos = 0
42 self._progress = self._makeprogress()
43
44 def _makeprogress(self):
42 # We pass double the max for total because we currently have
45 # We pass double the max for total because we currently have
43 # to send the bundle twice in the case of a server that
46 # to send the bundle twice in the case of a server that
44 # requires authentication. Since we can't know until we try
47 # requires authentication. Since we can't know until we try
45 # once whether authentication will be required, just lie to
48 # once whether authentication will be required, just lie to
46 # the user and maybe the push succeeds suddenly at 50%.
49 # the user and maybe the push succeeds suddenly at 50%.
47 self._progress = ui.makeprogress(
50 return self.ui.makeprogress(
48 _(b'sending'), unit=_(b'kb'), total=(self.length // 1024 * 2)
51 _(b'sending'), unit=_(b'kb'), total=(self.length // 1024 * 2)
49 )
52 )
50
53
General Comments 0
You need to be logged in to leave comments. Login now