From patchwork Tue Apr 22 20:10:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [03,of,12,stable] bundle2: make error testing more modular From: Pierre-Yves David X-Patchwork-Id: 4423 Message-Id: To: mercurial-devel@selenic.com Cc: pierre-yves.david@ens-lyon.org Date: Tue, 22 Apr 2014 13:10:47 -0700 # HG changeset patch # User Pierre-Yves David # Date 1398121195 25200 # Mon Apr 21 15:59:55 2014 -0700 # Branch stable # Node ID d2ed7a2bc8301f7a7e5e1c34175950206da27cc6 # Parent 32afe109f32541e1a56b15706bdf033defc39f15 bundle2: make error testing more modular We have more than Abort to test. diff --git a/tests/test-bundle2.t b/tests/test-bundle2.t --- a/tests/test-bundle2.t +++ b/tests/test-bundle2.t @@ -902,12 +902,16 @@ Setting up > from mercurial import exchange > from mercurial import extensions > > 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") > def handleabort(op, part): > raise util.Abort('Abandon ship!', hint="don't panic") @@ -936,10 +940,15 @@ Setting up $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log $ cat other.pid >> $DAEMON_PIDS 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 abort: Abandon ship! (don't panic)