##// END OF EJS Templates
bundle2: rename error exception class for unsupported feature...
Pierre-Yves David -
r26393:cff70549 default
parent child Browse files
Show More
@@ -376,17 +376,17 b' def _processpart(op, part):'
376 handler = parthandlermapping.get(part.type)
376 handler = parthandlermapping.get(part.type)
377 if handler is None:
377 if handler is None:
378 status = 'unsupported-type'
378 status = 'unsupported-type'
379 raise error.UnsupportedPartError(parttype=part.type)
379 raise error.BundleUnknownFeatureError(parttype=part.type)
380 indebug(op.ui, 'found a handler for part %r' % part.type)
380 indebug(op.ui, 'found a handler for part %r' % part.type)
381 unknownparams = part.mandatorykeys - handler.params
381 unknownparams = part.mandatorykeys - handler.params
382 if unknownparams:
382 if unknownparams:
383 unknownparams = list(unknownparams)
383 unknownparams = list(unknownparams)
384 unknownparams.sort()
384 unknownparams.sort()
385 status = 'unsupported-params (%s)' % unknownparams
385 status = 'unsupported-params (%s)' % unknownparams
386 raise error.UnsupportedPartError(parttype=part.type,
386 raise error.BundleUnknownFeatureError(parttype=part.type,
387 params=unknownparams)
387 params=unknownparams)
388 status = 'supported'
388 status = 'supported'
389 except error.UnsupportedPartError as exc:
389 except error.BundleUnknownFeatureError as exc:
390 if part.mandatory: # mandatory parts
390 if part.mandatory: # mandatory parts
391 raise
391 raise
392 indebug(op.ui, 'ignoring unsupported advisory part %s' % exc)
392 indebug(op.ui, 'ignoring unsupported advisory part %s' % exc)
@@ -666,7 +666,7 b' class unbundle20(unpackermixin):'
666 if name[0].islower():
666 if name[0].islower():
667 indebug(self.ui, "ignoring unknown parameter %r" % name)
667 indebug(self.ui, "ignoring unknown parameter %r" % name)
668 else:
668 else:
669 raise error.UnsupportedPartError(params=(name,))
669 raise error.BundleUnknownFeatureError(params=(name,))
670
670
671
671
672 def iterparts(self):
672 def iterparts(self):
@@ -1329,7 +1329,7 b' def handleerrorunsupportedcontent(op, in'
1329 if params is not None:
1329 if params is not None:
1330 kwargs['params'] = params.split('\0')
1330 kwargs['params'] = params.split('\0')
1331
1331
1332 raise error.UnsupportedPartError(**kwargs)
1332 raise error.BundleUnknownFeatureError(**kwargs)
1333
1333
1334 @parthandler('error:pushraced', ('message',))
1334 @parthandler('error:pushraced', ('message',))
1335 def handleerrorpushraced(op, inpart):
1335 def handleerrorpushraced(op, inpart):
@@ -141,7 +141,7 b' class PushRaced(RuntimeError):'
141 class BundleValueError(ValueError):
141 class BundleValueError(ValueError):
142 """error raised when bundle2 cannot be processed"""
142 """error raised when bundle2 cannot be processed"""
143
143
144 class UnsupportedPartError(BundleValueError):
144 class BundleUnknownFeatureError(BundleValueError):
145 def __init__(self, parttype=None, params=()):
145 def __init__(self, parttype=None, params=()):
146 self.parttype = parttype
146 self.parttype = parttype
147 self.params = params
147 self.params = params
General Comments 0
You need to be logged in to leave comments. Login now