# HG changeset patch # User Pierre-Yves David # Date 1393913885 28800 # Node ID b82b491893285d069f3305bcfe984d10a3ba8b97 # Parent aa722de361793def8beb7b0783b3a2d176596985 exchange: add progress bar when pulling using wire protocol command progress bar on pull was only available for pushkey based pull before this changeset. diff -r aa722de36179 -r b82b49189328 hgext/evolve.py --- a/hgext/evolve.py Mon Mar 03 21:37:18 2014 -0800 +++ b/hgext/evolve.py Mon Mar 03 22:18:05 2014 -0800 @@ -2249,7 +2249,18 @@ f = self._callstream("evoext_pullobsmarkers_0", **opts) f = self._decompress(f) length= int(f.read(20)) - return StringIO(f.read(length)) + chunk = 4096 + current = 0 + data = StringIO() + ui = self.ui + ui.progress('OBSEXC', current, unit="bytes", total=length) + while current < length: + readsize = min(length-current, chunk) + data.write(f.read(readsize)) + current += readsize + ui.progress('OBSEXC', current, unit="bytes", total=length) + ui.progress('OBSEXC', None) + return data @eh.addattr(localrepo.localpeer, 'evoext_pullobsmarkers_0') def local_pullobsmarkers(self, heads=None, common=None):