Mercurial > hg-stable
comparison mercurial/bundle2.py @ 21186:9f3652e851f8 stable
bundle2: gracefully handle PushRaced error during unbundle
Same drill again. We catch the PushRaced error, check if it cames from
a bundle2 processing, if so we turn it into a bundle2 with a part
transporting error information to be reraised client side.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 21 Apr 2014 17:51:58 -0700 |
parents | 5b3717e1a3ea |
children | 1daad9dcdba2 |
comparison
equal
deleted
inserted
replaced
21185:5b3717e1a3ea | 21186:9f3652e851f8 |
---|---|
758 @parthandler('b2x:error:unknownpart') | 758 @parthandler('b2x:error:unknownpart') |
759 def handlereplycaps(op, inpart): | 759 def handlereplycaps(op, inpart): |
760 """Used to transmit unknown part error over the wire""" | 760 """Used to transmit unknown part error over the wire""" |
761 manargs = dict(inpart.mandatoryparams) | 761 manargs = dict(inpart.mandatoryparams) |
762 raise UnknownPartError(manargs['parttype']) | 762 raise UnknownPartError(manargs['parttype']) |
763 | |
764 @parthandler('b2x:error:pushraced') | |
765 def handlereplycaps(op, inpart): | |
766 """Used to transmit push race error over the wire""" | |
767 manargs = dict(inpart.mandatoryparams) | |
768 raise error.ResponseError(_('push failed:'), manargs['message']) |