Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
21626:985d139c8e8f | 21627:3e8bcc90f07c |
---|---|
838 | 838 |
839 @parthandler('b2x:error:unsupportedcontent', ('parttype', 'params')) | 839 @parthandler('b2x:error:unsupportedcontent', ('parttype', 'params')) |
840 def handlereplycaps(op, inpart): | 840 def handlereplycaps(op, inpart): |
841 """Used to transmit unknown content error over the wire""" | 841 """Used to transmit unknown content error over the wire""" |
842 kwargs = {} | 842 kwargs = {} |
843 kwargs['parttype'] = inpart.params['parttype'] | 843 parttype = inpart.params.get('parttype') |
844 if parttype is not None: | |
845 kwargs['parttype'] = parttype | |
844 params = inpart.params.get('params') | 846 params = inpart.params.get('params') |
845 if params is not None: | 847 if params is not None: |
846 kwargs['params'] = params.split('\0') | 848 kwargs['params'] = params.split('\0') |
847 | 849 |
848 raise error.BundleValueError(**kwargs) | 850 raise error.BundleValueError(**kwargs) |