mercurial/bundle2.py
changeset 24047 731fa8e3e580
parent 24037 f0b498cfc5c8
child 24048 13d88b7eb3a0
equal deleted inserted replaced
24046:6e1d9f9932a9 24047:731fa8e3e580
   311         for part in iterparts:
   311         for part in iterparts:
   312             _processpart(op, part)
   312             _processpart(op, part)
   313     except Exception, exc:
   313     except Exception, exc:
   314         for part in iterparts:
   314         for part in iterparts:
   315             # consume the bundle content
   315             # consume the bundle content
   316             part.read()
   316             part.seek(0, 2)
   317         # Small hack to let caller code distinguish exceptions from bundle2
   317         # Small hack to let caller code distinguish exceptions from bundle2
   318         # processing from processing the old format. This is mostly
   318         # processing from processing the old format. This is mostly
   319         # needed to handle different return codes to unbundle according to the
   319         # needed to handle different return codes to unbundle according to the
   320         # type of bundle. We should probably clean up or drop this return code
   320         # type of bundle. We should probably clean up or drop this return code
   321         # craziness in a future version.
   321         # craziness in a future version.
   363             outpart = op.reply.newpart('b2x:output', data=output,
   363             outpart = op.reply.newpart('b2x:output', data=output,
   364                                        mandatory=False)
   364                                        mandatory=False)
   365             outpart.addparam('in-reply-to', str(part.id), mandatory=False)
   365             outpart.addparam('in-reply-to', str(part.id), mandatory=False)
   366     finally:
   366     finally:
   367         # consume the part content to not corrupt the stream.
   367         # consume the part content to not corrupt the stream.
   368         part.read()
   368         part.seek(0, 2)
   369 
   369 
   370 
   370 
   371 def decodecaps(blob):
   371 def decodecaps(blob):
   372     """decode a bundle2 caps bytes blob into a dictionary
   372     """decode a bundle2 caps bytes blob into a dictionary
   373 
   373