##// END OF EJS Templates
bundle2: add a ``newpart`` method to ``bundle20``...
Pierre-Yves David -
r21598:1b0dbb91 default
parent child Browse files
Show More
@@ -408,6 +408,11 b' class bundle20(object):'
408 part.id = len(self._parts) # very cheap counter
408 part.id = len(self._parts) # very cheap counter
409 self._parts.append(part)
409 self._parts.append(part)
410
410
411 def newpart(self, typeid, *args, **kwargs):
412 """create a new part for the containers"""
413 part = bundlepart(typeid, *args, **kwargs)
414 return part
415
411 # methods used to generate the bundle2 stream
416 # methods used to generate the bundle2 stream
412 def getchunks(self):
417 def getchunks(self):
413 self.ui.debug('start emission of %s stream\n' % _magicstring)
418 self.ui.debug('start emission of %s stream\n' % _magicstring)
@@ -707,7 +712,7 b' def handlechangegroup(op, inpart):'
707 if op.reply is not None:
712 if op.reply is not None:
708 # This is definitly not the final form of this
713 # This is definitly not the final form of this
709 # return. But one need to start somewhere.
714 # return. But one need to start somewhere.
710 part = bundlepart('b2x:reply:changegroup', (),
715 part = op.reply.newpart('b2x:reply:changegroup', (),
711 [('in-reply-to', str(inpart.id)),
716 [('in-reply-to', str(inpart.id)),
712 ('return', '%i' % ret)])
717 ('return', '%i' % ret)])
713 op.reply.addpart(part)
718 op.reply.addpart(part)
General Comments 0
You need to be logged in to leave comments. Login now