mercurial/bundle2.py
changeset 21606 e55888447958
parent 21605 f9dabfceb259
child 21607 054fa5176fa7
equal deleted inserted replaced
21605:f9dabfceb259 21606:e55888447958
   323                 handler(op, part)
   323                 handler(op, part)
   324             finally:
   324             finally:
   325                 if output is not None:
   325                 if output is not None:
   326                     output = op.ui.popbuffer()
   326                     output = op.ui.popbuffer()
   327             if output:
   327             if output:
   328                 op.reply.newpart('b2x:output',
   328                 outpart = op.reply.newpart('b2x:output', data=output)
   329                                  advisoryparams=[('in-reply-to',
   329                 outpart.addparam('in-reply-to', str(part.id), mandatory=False)
   330                                                   str(part.id))],
       
   331                                  data=output)
       
   332             part.read()
   330             part.read()
   333     except Exception, exc:
   331     except Exception, exc:
   334         if part is not None:
   332         if part is not None:
   335             # consume the bundle content
   333             # consume the bundle content
   336             part.read()
   334             part.read()
   767     ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2')
   765     ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2')
   768     op.records.add('changegroup', {'return': ret})
   766     op.records.add('changegroup', {'return': ret})
   769     if op.reply is not None:
   767     if op.reply is not None:
   770         # This is definitly not the final form of this
   768         # This is definitly not the final form of this
   771         # return. But one need to start somewhere.
   769         # return. But one need to start somewhere.
   772         op.reply.newpart('b2x:reply:changegroup', (),
   770         part = op.reply.newpart('b2x:reply:changegroup')
   773                          [('in-reply-to', str(inpart.id)),
   771         part.addparam('in-reply-to', str(inpart.id), mandatory=False)
   774                           ('return', '%i' % ret)])
   772         part.addparam('return', '%i' % ret, mandatory=False)
   775     assert not inpart.read()
   773     assert not inpart.read()
   776 
   774 
   777 @parthandler('b2x:reply:changegroup')
   775 @parthandler('b2x:reply:changegroup')
   778 def handlechangegroup(op, inpart):
   776 def handlechangegroup(op, inpart):
   779     p = dict(inpart.advisoryparams)
   777     p = dict(inpart.advisoryparams)