# HG changeset patch # User Pierre-Yves David # Date 1429805038 -3600 # Node ID aff2aca3420e6d238b537378deb94350d8a707ac # Parent 2f88821856eb997b826e47d33d57c003faa3493a bundle2: also capture hook output during processing External hook used to directly write on stdout and stderr. As a result their output was not captured by the bundle2 processing. This resulted in confusing out of order output on the client side. We are now capturing hooks output in this context. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -354,7 +354,7 @@ # itself represents a defect of a different variety). output = None if op.reply is not None: - op.ui.pushbuffer(error=True) + op.ui.pushbuffer(error=True, subproc=True) output = '' try: handler(op, part) diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1303,7 +1303,7 @@ exc.duringunbundle2 = True if r is not None: parts = exc._bundle2salvagedoutput = r.salvageoutput() - repo.ui.pushbuffer(error=True) + repo.ui.pushbuffer(error=True, subproc=True) def recordout(output): part = bundle2.bundlepart('output', data=output, mandatory=False) diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t --- a/tests/test-bundle2-exchange.t +++ b/tests/test-bundle2-exchange.t @@ -549,6 +549,7 @@ > reason = > [hooks] > pretxnclose.failpush = false + > txnabort.failpush = echo 'Cleaning up the mess...' > EOF $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS @@ -564,6 +565,7 @@ remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: transaction abort! + remote: Cleaning up the mess... remote: rollback completed abort: pretxnclose.failpush hook exited with status 1 [255] @@ -576,6 +578,7 @@ remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: transaction abort! + remote: Cleaning up the mess... remote: rollback completed abort: pretxnclose.failpush hook exited with status 1 remote: pre-close-tip:e7ec4e813ba6 draft @@ -589,6 +592,7 @@ remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: transaction abort! + remote: Cleaning up the mess... remote: rollback completed abort: pretxnclose.failpush hook exited with status 1 [255]