# HG changeset patch # User Pierre-Yves David # Date 1400631696 25200 # Node ID 8de88b323fb6d019756a3b435e731545fc31cc40 # Parent 0c1142059a824cbb6154f1cbc3f609e365eb10d1 evolve: install progress support for the bundle2 push path The custom wireprotocol command had a trick to display progress while pushing. We reinstall such logic for the new path using bundle2. diff -r 0c1142059a82 -r 8de88b323fb6 hgext/evolve.py --- a/hgext/evolve.py Tue May 20 14:39:13 2014 -0700 +++ b/hgext/evolve.py Tue May 20 17:21:36 2014 -0700 @@ -2247,6 +2247,12 @@ total=self.length) return StringIO.read(self, size) + def __iter__(self): + d = self.read(4096) + while d: + yield d + d = self.read(4096) + @eh.wrapfunction(exchange, '_pushobsolete') @@ -2278,15 +2284,16 @@ if not markers: repo.ui.status("OBSEXC: no marker to push\n") elif remote.capable('_evoext_b2x_obsmarkers_0'): - obsdata = StringIO() + obsdata = pushobsmarkerStringIO() _encodemarkersstream(obsdata, markers) obsdata.seek(0) + obsdata.ui = repo.ui repo.ui.status("OBSEXC: pushing %i markers (%i bytes)\n" % (len(markers), len(obsdata.getvalue()))) bundler = bundle2.bundle20(pushop.ui, {}) capsblob = bundle2.encodecaps(pushop.repo.bundle2caps) bundler.addpart(bundle2.bundlepart('b2x:replycaps', data=capsblob)) - cgpart = bundle2.bundlepart('EVOLVE:B2X:OBSMARKERV1', data=obsdata.getvalue()) + cgpart = bundle2.bundlepart('EVOLVE:B2X:OBSMARKERV1', data=obsdata) bundler.addpart(cgpart) stream = util.chunkbuffer(bundler.getchunks()) try: @@ -2297,6 +2304,7 @@ op = bundle2.processbundle(pushop.repo, reply) except bundle2.UnknownPartError, exc: raise util.Abort('missing support for %s' % exc) + repo.ui.progress('OBSEXC', None) elif remote.capable('_evoext_pushobsmarkers_0'): obsdata = pushobsmarkerStringIO() _encodemarkersstream(obsdata, markers)