Mercurial > hg
comparison mercurial/exchange.py @ 26829:58f1645f72c3 stable
bundle2: attribute remote failures to remote (issue4788)
Before bundle2, hook output from hook failures was prefixed with
"remote: ". Up to this point with bundle2, the output was converted to
the message to print in an Abort exception. This had 2 implications:
1) It was unclear whether an error message came from the local repo
or the remote
2) The exit code changed from 1 to 255
This patch changes the handling of error:abort bundle2 parts during push
to prefix the error message with "remote: ". This restores the old
behavior.
We still preserve the behavior of raising an Abort during bundle2
application failure. This is a regression from pre-bundle2 because the
exit code changed.
Because we no longer raise an Abort with the remote's message, we needed
to insert a message for the new Abort. So, I invented a new error
message for that. This is another change from pre-bundle2. However, I
like the new error message because it states unambiguously who aborted
the push failed, which I think is important for users so they can decide
what's next.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 24 Oct 2015 00:39:22 +0100 |
parents | 1aee2ab0f902 |
children | 9350f00a7b23 |
comparison
equal
deleted
inserted
replaced
26828:00e75baa810f | 26829:58f1645f72c3 |
---|---|
796 if pushback: | 796 if pushback: |
797 trgetter = pushop.trmanager.transaction | 797 trgetter = pushop.trmanager.transaction |
798 op = bundle2.processbundle(pushop.repo, reply, trgetter) | 798 op = bundle2.processbundle(pushop.repo, reply, trgetter) |
799 except error.BundleValueError as exc: | 799 except error.BundleValueError as exc: |
800 raise error.Abort('missing support for %s' % exc) | 800 raise error.Abort('missing support for %s' % exc) |
801 except bundle2.AbortFromPart as exc: | |
802 pushop.ui.status(_('remote: %s\n') % exc) | |
803 raise error.Abort(_('push failed on remote'), hint=exc.hint) | |
801 except error.PushkeyFailed as exc: | 804 except error.PushkeyFailed as exc: |
802 partid = int(exc.partid) | 805 partid = int(exc.partid) |
803 if partid not in pushop.pkfailcb: | 806 if partid not in pushop.pkfailcb: |
804 raise | 807 raise |
805 pushop.pkfailcb[partid](pushop, exc) | 808 pushop.pkfailcb[partid](pushop, exc) |