changeset 26410:4c4b3c37776c

unbundle: test and fix for clean abort on unknown bundle2 feature This introduce a test for the feature and fix the exception name that is different on default.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 24 Sep 2015 17:52:21 -0700
parents 19d946cf2a1b
children dd62eaa82cbe
files mercurial/commands.py tests/test-bundle2-format.t
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Sep 29 14:33:31 2015 -0500
+++ b/mercurial/commands.py	Thu Sep 24 17:52:21 2015 -0700
@@ -6388,7 +6388,7 @@
                 try:
                     op = bundle2.processbundle(repo, gen, lambda: tr)
                     tr.close()
-                except error.UnsupportedPartError as exc:
+                except error.BundleUnknownFeatureError as exc:
                     raise util.Abort(_('%s: unknown bundle feature, %s')
                                      % (fname, exc),
                                      hint=_("see https://mercurial.selenic.com/"
--- a/tests/test-bundle2-format.t	Tue Sep 29 14:33:31 2015 -0500
+++ b/tests/test-bundle2-format.t	Thu Sep 24 17:52:21 2015 -0700
@@ -1219,5 +1219,9 @@
   $ cat ../rev.hg2.bz | hg statbundle2
   abort: unknown parameters: Stream Parameter - Compression='FooBarUnknown'
   [255]
+  $ hg unbundle ../rev.hg2.bz
+  abort: ../rev.hg2.bz: unknown bundle feature, Stream Parameter - Compression='FooBarUnknown'
+  (see https://mercurial.selenic.com/wiki/BundleFeature for more information)
+  [255]
 
   $ cd ..