diff mercurial/bundle2.py @ 21627:3e8bcc90f07c

bundle2: support None parttype in BundleValueError This will be used for errors at the stream level.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 28 May 2014 16:46:58 -0700
parents 985d139c8e8f
children 7c5a85619dca
line wrap: on
line diff
--- a/mercurial/bundle2.py	Tue May 27 12:16:45 2014 -0700
+++ b/mercurial/bundle2.py	Wed May 28 16:46:58 2014 -0700
@@ -840,7 +840,9 @@
 def handlereplycaps(op, inpart):
     """Used to transmit unknown content error over the wire"""
     kwargs = {}
-    kwargs['parttype'] = inpart.params['parttype']
+    parttype = inpart.params.get('parttype')
+    if parttype is not None:
+        kwargs['parttype'] = parttype
     params = inpart.params.get('params')
     if params is not None:
         kwargs['params'] = params.split('\0')