bundle2: raise BundleValueError error for stream level unsupported params
This ensures both consistency and smooth propagation over the wire.
--- a/mercurial/bundle2.py Wed May 28 16:46:58 2014 -0700
+++ b/mercurial/bundle2.py Wed May 28 15:37:47 2014 -0700
@@ -523,7 +523,7 @@
if name[0].islower():
self.ui.debug("ignoring unknown parameter %r\n" % name)
else:
- raise KeyError(name)
+ raise error.BundleValueError(params=(name,))
def iterparts(self):
--- a/tests/test-bundle2.t Wed May 28 16:46:58 2014 -0700
+++ b/tests/test-bundle2.t Wed May 28 15:37:47 2014 -0700
@@ -166,7 +166,7 @@
> unbundler = bundle2.unbundle20(ui, sys.stdin)
> try:
> params = unbundler.params
- > except KeyError, exc:
+ > except error.BundleValueError, exc:
> raise util.Abort('unknown parameters: %s' % exc)
> ui.write('options count: %i\n' % len(params))
> for key in sorted(params):
@@ -304,7 +304,7 @@
---------------------------------------------------
$ hg bundle2 --param 'Gravity' | hg statbundle2
- abort: unknown parameters: 'Gravity'
+ abort: unknown parameters: Stream Parameter - Gravity
[255]
Test debug output