##// END OF EJS Templates
bundle2: have ``newpart`` automatically add the part to the bundle...
Pierre-Yves David -
r21599:57cd844d default
parent child Browse files
Show More
@@ -381,7 +381,7 b' def encodecaps(caps):'
381 381 class bundle20(object):
382 382 """represent an outgoing bundle2 container
383 383
384 Use the `addparam` method to add stream level parameter. and `addpart` to
384 Use the `addparam` method to add stream level parameter. and `newpart` to
385 385 populate it. Then call `getchunks` to retrieve all the binary chunks of
386 386 data that compose the bundle2 container."""
387 387
@@ -411,6 +411,7 b' class bundle20(object):'
411 411 def newpart(self, typeid, *args, **kwargs):
412 412 """create a new part for the containers"""
413 413 part = bundlepart(typeid, *args, **kwargs)
414 self.addpart(part)
414 415 return part
415 416
416 417 # methods used to generate the bundle2 stream
@@ -712,10 +713,9 b' def handlechangegroup(op, inpart):'
712 713 if op.reply is not None:
713 714 # This is definitly not the final form of this
714 715 # return. But one need to start somewhere.
715 part = op.reply.newpart('b2x:reply:changegroup', (),
716 [('in-reply-to', str(inpart.id)),
717 ('return', '%i' % ret)])
718 op.reply.addpart(part)
716 op.reply.newpart('b2x:reply:changegroup', (),
717 [('in-reply-to', str(inpart.id)),
718 ('return', '%i' % ret)])
719 719 assert not inpart.read()
720 720
721 721 @parthandler('b2x:reply:changegroup')
General Comments 0
You need to be logged in to leave comments. Login now