changeset 21178:9a813e703172 stable

bundle2: make error testing more modular We have more than Abort to test.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 21 Apr 2014 15:59:55 -0700
parents 952af771bc17
children 372f4772f7a0
files tests/test-bundle2.t
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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