Patchwork [3,of,7,stable] bundle1: display server abort hint during unbundle

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 10, 2017, 5:53 p.m.
Message ID <0f8b506dc5406a9c9eba.1486749184@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/18401/
State Accepted
Delegated to: Martin von Zweigbergk
Headers show

Comments

Pierre-Yves David - Feb. 10, 2017, 5:53 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1486745812 -3600
#      Fri Feb 10 17:56:52 2017 +0100
# Branch stable
# Node ID 0f8b506dc5406a9c9ebaab67495ff231c58663fc
# Parent  f319afe9c93cb0cfeeff58f66b1792eb55130ba4
# EXP-Topic getbundleerror
bundle1: display server abort hint during unbundle

The code was printing the abort message but not the hint. This is now fixed.

Patch

diff -r f319afe9c93c -r 0f8b506dc540 mercurial/wireproto.py
--- a/mercurial/wireproto.py	Fri Feb 10 17:56:59 2017 +0100
+++ b/mercurial/wireproto.py	Fri Feb 10 17:56:52 2017 +0100
@@ -981,6 +981,8 @@ 
                 # This need to be moved to something proper.
                 # Feel free to do it.
                 util.stderr.write("abort: %s\n" % exc)
+                if exc.hint is not None:
+                    util.stderr.write("(%s)\n" % exc.hint)
                 return pushres(0)
             except error.PushRaced:
                 return pusherr(str(exc))
diff -r f319afe9c93c -r 0f8b506dc540 tests/test-bundle2-exchange.t
--- a/tests/test-bundle2-exchange.t	Fri Feb 10 17:56:59 2017 +0100
+++ b/tests/test-bundle2-exchange.t	Fri Feb 10 17:56:52 2017 +0100
@@ -1113,6 +1113,7 @@ 
   pushing to ssh://user@dummy/bundle2onlyserver
   searching for changes
   remote: abort: incompatible Mercurial client; bundle2 required
+  remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
   [1]
 
   $ hg push