Show More
@@ -321,15 +321,15 b' def _processpart(op, part):' | |||||
321 | try: |
|
321 | try: | |
322 | handler = parthandlermapping.get(key) |
|
322 | handler = parthandlermapping.get(key) | |
323 | if handler is None: |
|
323 | if handler is None: | |
324 |
raise error. |
|
324 | raise error.UnsupportedPartError(parttype=key) | |
325 | op.ui.debug('found a handler for part %r\n' % parttype) |
|
325 | op.ui.debug('found a handler for part %r\n' % parttype) | |
326 | unknownparams = part.mandatorykeys - handler.params |
|
326 | unknownparams = part.mandatorykeys - handler.params | |
327 | if unknownparams: |
|
327 | if unknownparams: | |
328 | unknownparams = list(unknownparams) |
|
328 | unknownparams = list(unknownparams) | |
329 | unknownparams.sort() |
|
329 | unknownparams.sort() | |
330 |
raise error. |
|
330 | raise error.UnsupportedPartError(parttype=key, | |
331 | params=unknownparams) |
|
331 | params=unknownparams) | |
332 |
except error. |
|
332 | except error.UnsupportedPartError, exc: | |
333 | if key != parttype: # mandatory parts |
|
333 | if key != parttype: # mandatory parts | |
334 | raise |
|
334 | raise | |
335 | op.ui.debug('ignoring unsupported advisory part %s\n' % exc) |
|
335 | op.ui.debug('ignoring unsupported advisory part %s\n' % exc) | |
@@ -538,7 +538,7 b' class unbundle20(unpackermixin):' | |||||
538 | if name[0].islower(): |
|
538 | if name[0].islower(): | |
539 | self.ui.debug("ignoring unknown parameter %r\n" % name) |
|
539 | self.ui.debug("ignoring unknown parameter %r\n" % name) | |
540 | else: |
|
540 | else: | |
541 |
raise error. |
|
541 | raise error.UnsupportedPartError(params=(name,)) | |
542 |
|
542 | |||
543 |
|
543 | |||
544 | def iterparts(self): |
|
544 | def iterparts(self): | |
@@ -894,7 +894,7 b' def handlereplycaps(op, inpart):' | |||||
894 | if params is not None: |
|
894 | if params is not None: | |
895 | kwargs['params'] = params.split('\0') |
|
895 | kwargs['params'] = params.split('\0') | |
896 |
|
896 | |||
897 |
raise error. |
|
897 | raise error.UnsupportedPartError(**kwargs) | |
898 |
|
898 | |||
899 | @parthandler('b2x:error:pushraced', ('message',)) |
|
899 | @parthandler('b2x:error:pushraced', ('message',)) | |
900 | def handlereplycaps(op, inpart): |
|
900 | def handlereplycaps(op, inpart): |
@@ -102,6 +102,7 b' class PushRaced(RuntimeError):' | |||||
102 | class BundleValueError(ValueError): |
|
102 | class BundleValueError(ValueError): | |
103 | """error raised when bundle2 cannot be processed""" |
|
103 | """error raised when bundle2 cannot be processed""" | |
104 |
|
104 | |||
|
105 | class UnsupportedPartError(BundleValueError): | |||
105 | def __init__(self, parttype=None, params=()): |
|
106 | def __init__(self, parttype=None, params=()): | |
106 | self.parttype = parttype |
|
107 | self.parttype = parttype | |
107 | self.params = params |
|
108 | self.params = params |
General Comments 0
You need to be logged in to leave comments.
Login now