# HG changeset patch # User Pierre-Yves David # Date 2017-02-10 16:56:47 # Node ID 4c8dcb491974d97ea3c773ad1ac5588b2bd5478a # Parent 75149f84eac79994b99e159cda8d8f1bec75b5a2 bundle2: keep hint close to the primary message when remote abort The remote hint message was ignored when reporting the remote error and passed to the local generic abort error. I think I might initially have tried to avoid reimplementing logic controlling the hint display depending of the verbosity level. However, first, there does not seems to have such verbosity related logic and second the resulting was wrong as the primary error and the hint were split apart. We now properly print the hint as remote output. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -904,7 +904,9 @@ def _pushbundle2(pushop): raise error.Abort(_('missing support for %s') % exc) except bundle2.AbortFromPart as exc: pushop.ui.status(_('remote: %s\n') % exc) - raise error.Abort(_('push failed on remote'), hint=exc.hint) + if exc.hint is not None: + pushop.ui.status(_('remote: %s\n') % ('(%s)' % exc.hint)) + raise error.Abort(_('push failed on remote')) except error.PushkeyFailed as exc: partid = int(exc.partid) if partid not in pushop.pkfailcb: 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 @@ -518,16 +518,16 @@ Doing the actual push: Abort error pushing to ssh://user@dummy/other searching for changes remote: Abandon ship! + remote: (don't panic) abort: push failed on remote - (don't panic) [255] $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 pushing to http://localhost:$HGPORT2/ searching for changes remote: Abandon ship! + remote: (don't panic) abort: push failed on remote - (don't panic) [255]