comparison mercurial/exchange.py @ 21070:408877d491fb

bundle2: feed a binary stream to `peer.unbundle` This input will have to travel over the wire anyway, so we feed the peer method with a simple binary stream and rely on the server side to use `readbundle` to create the python object. The test output changes because the bundle is created marginally sooner and the debug output interleaves in a different way.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 15 Apr 2014 16:42:52 -0400
parents c15b66a6bbb4
children 19b9f23a8c6f
comparison
equal deleted inserted replaced
21069:0a9cae236738 21070:408877d491fb
214 # add the changegroup bundle 214 # add the changegroup bundle
215 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing) 215 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
216 cgpart = bundle2.bundlepart('CHANGEGROUP', data=cg.getchunks()) 216 cgpart = bundle2.bundlepart('CHANGEGROUP', data=cg.getchunks())
217 bundler.addpart(cgpart) 217 bundler.addpart(cgpart)
218 stream = util.chunkbuffer(bundler.getchunks()) 218 stream = util.chunkbuffer(bundler.getchunks())
219 sent = bundle2.unbundle20(pushop.repo.ui, stream) 219 reply = pushop.remote.unbundle(stream, ['force'], 'push')
220 reply = pushop.remote.unbundle(sent, ['force'], 'push')
221 try: 220 try:
222 op = bundle2.processbundle(pushop.repo, reply) 221 op = bundle2.processbundle(pushop.repo, reply)
223 except KeyError, exc: 222 except KeyError, exc:
224 raise util.Abort('missing support for %s' % exc) 223 raise util.Abort('missing support for %s' % exc)
225 cgreplies = op.records.getreplies(cgpart.id) 224 cgreplies = op.records.getreplies(cgpart.id)