bundle2: make error testing more modular
We have more than Abort to test.
--- a/tests/test-bundle2.t Mon Apr 21 15:48:52 2014 -0700
+++ b/tests/test-bundle2.t Mon Apr 21 15:59:55 2014 -0700
@@ -904,8 +904,12 @@
>
> def _pushbundle2failpart(orig, pushop, bundler):
> extradata = orig(pushop, bundler)
- > part = bundle2.bundlepart('test:abort')
- > bundler.addpart(part)
+ > reason = pushop.ui.config('failpush', 'reason', None)
+ > part = None
+ > if reason == 'abort':
+ > part = bundle2.bundlepart('test:abort')
+ > if part is not None:
+ > bundler.addpart(part)
> return extradata
>
> @bundle2.parthandler("test:abort")
@@ -938,6 +942,11 @@
Doing the actual push: Abort error
+ $ cat << EOF >> $HGRCPATH
+ > [failpush]
+ > reason = abort
+ > EOF
+
$ hg -R main push other -r e7ec4e813ba6
pushing to other
searching for changes