##// END OF EJS Templates
bundle2-push: introduce a list of part generating functions...
Pierre-Yves David -
r21904:5fbccbcc default
parent child Browse files
Show More
@@ -227,6 +227,9 b' def _pushb2ctx(pushop, bundler):'
227 227 pushop.ret = cgreplies['changegroup'][0]['return']
228 228 return handlereply
229 229
230 # list of function that may decide to add parts to an outgoing bundle2
231 bundle2partsgenerators = [_pushb2ctx]
232
230 233 def _pushbundle2(pushop):
231 234 """push data to the remote using bundle2
232 235
@@ -237,9 +240,11 b' def _pushbundle2(pushop):'
237 240 capsblob = bundle2.encodecaps(pushop.repo.bundle2caps)
238 241 bundler.newpart('b2x:replycaps', data=capsblob)
239 242 extrainfo = _pushbundle2extraparts(pushop, bundler)
240 # add the changegroup bundle
241 cgreplyhandler = _pushb2ctx(pushop, bundler)
242 # do not push if no other parts than the capability
243 replyhandlers = []
244 for partgen in bundle2partsgenerators:
245 ret = partgen(pushop, bundler)
246 replyhandlers.append(ret)
247 # do not push if nothing to push
243 248 if bundler.nbparts <= 1:
244 249 return
245 250 stream = util.chunkbuffer(bundler.getchunks())
@@ -251,7 +256,8 b' def _pushbundle2(pushop):'
251 256 op = bundle2.processbundle(pushop.repo, reply)
252 257 except error.BundleValueError, exc:
253 258 raise util.Abort('missing support for %s' % exc)
254 cgreplyhandler(op)
259 for rephand in replyhandlers:
260 rephand(op)
255 261 _pushbundle2extrareply(pushop, op, extrainfo)
256 262
257 263 def _pushbundle2extraparts(pushop, bundler):
General Comments 0
You need to be logged in to leave comments. Login now