bundle2: rename error exception class for unsupported feature
The original name explicitly mention "Part", however it is also used outside of
parts related feature. We rename from 'UnsupportedPartError' to
'BundleUnknownFeatureError' to fix this.
--- a/mercurial/bundle2.py Wed Sep 23 11:33:30 2015 -0700
+++ b/mercurial/bundle2.py Wed Sep 23 11:44:52 2015 -0700
@@ -376,17 +376,17 @@
handler = parthandlermapping.get(part.type)
if handler is None:
status = 'unsupported-type'
- raise error.UnsupportedPartError(parttype=part.type)
+ raise error.BundleUnknownFeatureError(parttype=part.type)
indebug(op.ui, 'found a handler for part %r' % part.type)
unknownparams = part.mandatorykeys - handler.params
if unknownparams:
unknownparams = list(unknownparams)
unknownparams.sort()
status = 'unsupported-params (%s)' % unknownparams
- raise error.UnsupportedPartError(parttype=part.type,
- params=unknownparams)
+ raise error.BundleUnknownFeatureError(parttype=part.type,
+ params=unknownparams)
status = 'supported'
- except error.UnsupportedPartError as exc:
+ except error.BundleUnknownFeatureError as exc:
if part.mandatory: # mandatory parts
raise
indebug(op.ui, 'ignoring unsupported advisory part %s' % exc)
@@ -666,7 +666,7 @@
if name[0].islower():
indebug(self.ui, "ignoring unknown parameter %r" % name)
else:
- raise error.UnsupportedPartError(params=(name,))
+ raise error.BundleUnknownFeatureError(params=(name,))
def iterparts(self):
@@ -1329,7 +1329,7 @@
if params is not None:
kwargs['params'] = params.split('\0')
- raise error.UnsupportedPartError(**kwargs)
+ raise error.BundleUnknownFeatureError(**kwargs)
@parthandler('error:pushraced', ('message',))
def handleerrorpushraced(op, inpart):
--- a/mercurial/error.py Wed Sep 23 11:33:30 2015 -0700
+++ b/mercurial/error.py Wed Sep 23 11:44:52 2015 -0700
@@ -141,7 +141,7 @@
class BundleValueError(ValueError):
"""error raised when bundle2 cannot be processed"""
-class UnsupportedPartError(BundleValueError):
+class BundleUnknownFeatureError(BundleValueError):
def __init__(self, parttype=None, params=()):
self.parttype = parttype
self.params = params