comparison mercurial/exchange.py @ 21600:5e08f3b65510

bundle2: update all ``addpart`` callers to ``newpart`` The new method is what we want in all current cases.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 23 May 2014 15:59:19 -0700
parents e303b8ea84b3
children 0cfda08afd24
comparison
equal deleted inserted replaced
21599:57cd844d7a5b 21600:5e08f3b65510
212 capsblob = urllib.unquote(pushop.remote.capable('bundle2-exp')) 212 capsblob = urllib.unquote(pushop.remote.capable('bundle2-exp'))
213 caps = bundle2.decodecaps(capsblob) 213 caps = bundle2.decodecaps(capsblob)
214 bundler = bundle2.bundle20(pushop.ui, caps) 214 bundler = bundle2.bundle20(pushop.ui, caps)
215 # create reply capability 215 # create reply capability
216 capsblob = bundle2.encodecaps(pushop.repo.bundle2caps) 216 capsblob = bundle2.encodecaps(pushop.repo.bundle2caps)
217 bundler.addpart(bundle2.bundlepart('b2x:replycaps', data=capsblob)) 217 bundler.newpart('b2x:replycaps', data=capsblob)
218 if not pushop.force: 218 if not pushop.force:
219 part = bundle2.bundlepart('B2X:CHECK:HEADS', 219 bundler.newpart('B2X:CHECK:HEADS', data=iter(pushop.remoteheads))
220 data=iter(pushop.remoteheads))
221 bundler.addpart(part)
222 extrainfo = _pushbundle2extraparts(pushop, bundler) 220 extrainfo = _pushbundle2extraparts(pushop, bundler)
223 # add the changegroup bundle 221 # add the changegroup bundle
224 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing) 222 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
225 cgpart = bundle2.bundlepart('B2X:CHANGEGROUP', data=cg.getchunks()) 223 cgpart = bundler.newpart('B2X:CHANGEGROUP', data=cg.getchunks())
226 bundler.addpart(cgpart)
227 stream = util.chunkbuffer(bundler.getchunks()) 224 stream = util.chunkbuffer(bundler.getchunks())
228 try: 225 try:
229 reply = pushop.remote.unbundle(stream, ['force'], 'push') 226 reply = pushop.remote.unbundle(stream, ['force'], 'push')
230 except bundle2.UnknownPartError, exc: 227 except bundle2.UnknownPartError, exc:
231 raise util.Abort('missing support for %s' % exc) 228 raise util.Abort('missing support for %s' % exc)
668 if bcaps.startswith('bundle2='): 665 if bcaps.startswith('bundle2='):
669 blob = urllib.unquote(bcaps[len('bundle2='):]) 666 blob = urllib.unquote(bcaps[len('bundle2='):])
670 b2caps.update(bundle2.decodecaps(blob)) 667 b2caps.update(bundle2.decodecaps(blob))
671 bundler = bundle2.bundle20(repo.ui, b2caps) 668 bundler = bundle2.bundle20(repo.ui, b2caps)
672 if cg: 669 if cg:
673 part = bundle2.bundlepart('b2x:changegroup', data=cg.getchunks()) 670 bundler.newpart('b2x:changegroup', data=cg.getchunks())
674 bundler.addpart(part)
675 _getbundleextrapart(bundler, repo, source, heads=heads, common=common, 671 _getbundleextrapart(bundler, repo, source, heads=heads, common=common,
676 bundlecaps=bundlecaps, **kwargs) 672 bundlecaps=bundlecaps, **kwargs)
677 return util.chunkbuffer(bundler.getchunks()) 673 return util.chunkbuffer(bundler.getchunks())
678 674
679 def _getbundleextrapart(bundler, repo, source, heads=None, common=None, 675 def _getbundleextrapart(bundler, repo, source, heads=None, common=None,