comparison mercurial/bundle2.py @ 25492:219b8ab31220

bundle2: also capture reply capability on failure When unbundling over the wire is aborted, we have a mechanism to convey the error inside a bundle part. As we add support for more errors, we need to know if the client will support them. For this purpose, we duck punch the reply capabilities of the client on the raised extensions. This is similar to what is done to salvage the server output on error.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 06 Jun 2015 00:50:27 -0700
parents 8cd0159207df
children d8e7b0781ad7
comparison
equal deleted inserted replaced
25491:8cd0159207df 25492:219b8ab31220
345 # needed to handle different return codes to unbundle according to the 345 # needed to handle different return codes to unbundle according to the
346 # type of bundle. We should probably clean up or drop this return code 346 # type of bundle. We should probably clean up or drop this return code
347 # craziness in a future version. 347 # craziness in a future version.
348 exc.duringunbundle2 = True 348 exc.duringunbundle2 = True
349 salvaged = [] 349 salvaged = []
350 replycaps = None
350 if op.reply is not None: 351 if op.reply is not None:
351 salvaged = op.reply.salvageoutput() 352 salvaged = op.reply.salvageoutput()
353 replycaps = op.reply.capabilities
354 exc._replycaps = replycaps
352 exc._bundle2salvagedoutput = salvaged 355 exc._bundle2salvagedoutput = salvaged
353 raise 356 raise
354 finally: 357 finally:
355 repo.ui.debug('bundle2-input-bundle: %i parts total\n' % nbpart) 358 repo.ui.debug('bundle2-input-bundle: %i parts total\n' % nbpart)
356 359