diff mercurial/bundle2.py @ 21622:457492741007

bundle2: support transmission of params error over the wire We picked a null character to split each parameter during the transfer. This is fragile if the same character is used in parameter name. However other codes will already behave in a strange way in that case, so we are not introducing any regression. A better format may be picked for the final version of the protocol.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 28 May 2014 15:57:23 -0700
parents 6eaa71b2a3cc
children 5b26d82e4e2a
line wrap: on
line diff
--- a/mercurial/bundle2.py	Wed May 28 15:53:34 2014 -0700
+++ b/mercurial/bundle2.py	Wed May 28 15:57:23 2014 -0700
@@ -831,8 +831,13 @@
 @parthandler('b2x:error:unsupportedcontent')
 def handlereplycaps(op, inpart):
     """Used to transmit unknown content error over the wire"""
-    parttype = inpart.params['parttype']
-    raise error.BundleValueError(parttype=parttype)
+    kwargs = {}
+    kwargs['parttype'] = inpart.params['parttype']
+    params = inpart.params.get('params')
+    if params is not None:
+        kwargs['params'] = params.split('\0')
+
+    raise error.BundleValueError(**kwargs)
 
 @parthandler('b2x:error:pushraced')
 def handlereplycaps(op, inpart):