diff mercurial/bundle2.py @ 21183:4345274adc4b stable

bundle2: gracefully handle UnknownPartError during unbundle Same as for Abort error, we catch the error, encode it into a bundle2 reply (expected by the client) and stream this reply. The client processing of the error will raise the exception again.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 21 Apr 2014 16:02:03 -0700
parents 372f4772f7a0
children 28d76afa1568
line wrap: on
line diff
--- a/mercurial/bundle2.py	Tue Apr 22 11:41:34 2014 -0700
+++ b/mercurial/bundle2.py	Mon Apr 21 16:02:03 2014 -0700
@@ -753,3 +753,9 @@
     manargs = dict(inpart.mandatoryparams)
     advargs = dict(inpart.advisoryparams)
     raise util.Abort(manargs['message'], hint=advargs.get('hint'))
+
+@parthandler('b2x:error:unknownpart')
+def handlereplycaps(op, inpart):
+    """Used to transmit unknown part error over the wire"""
+    manargs = dict(inpart.mandatoryparams)
+    raise UnknownPartError(manargs['parttype'])