# HG changeset patch # User Pierre-Yves David # Date 1429168657 14400 # Node ID 0c4d5e01b31fa3d983caf6a402805ad4099baf84 # Parent 61ff209fc01dbe23550ebfc5530f790bdb5546ba bundle2-wireproto: properly propagate the server output on error (issue4594) In case of errors, output parts salvaged from the reply bundle are re-injected into the bundle carrying the exception. We still need to fix the situation for non-wireprotocol push. diff -r 61ff209fc01d -r 0c4d5e01b31f mercurial/wireproto.py --- a/mercurial/wireproto.py Thu Apr 16 03:56:50 2015 -0400 +++ b/mercurial/wireproto.py Thu Apr 16 03:17:37 2015 -0400 @@ -858,6 +858,8 @@ return pusherr(str(exc)) bundler = bundle2.bundle20(repo.ui) + for out in getattr(exc, '_bundle2salvagedoutput', ()): + bundler.addpart(out) try: raise except error.BundleValueError, exc: diff -r 61ff209fc01d -r 0c4d5e01b31f tests/test-bundle2-exchange.t --- a/tests/test-bundle2-exchange.t Thu Apr 16 03:56:50 2015 -0400 +++ b/tests/test-bundle2-exchange.t Thu Apr 16 03:17:37 2015 -0400 @@ -567,6 +567,10 @@ $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 pushing to ssh://user@dummy/other searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 1 changes to 1 files abort: pretxnclose.failpush hook exited with status 1 remote: pre-close-tip:e7ec4e813ba6 draft remote: transaction abort! @@ -576,6 +580,10 @@ $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 pushing to http://localhost:$HGPORT2/ searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 1 changes to 1 files abort: pretxnclose.failpush hook exited with status 1 [255]