# HG changeset patch # User Pierre-Yves David # Date 2017-02-10 17:17:20 # Node ID d70971a3ae80fbebdca7a0e3adb72370f08f60e1 # Parent 3d4afc2fdcd727e18a9be38771da2b70caa21f8d getbundle: cleanly handle remote abort during getbundle bundle2 allow the server to report error explicitly. This was initially implemented for push but there is not reason to not use it for pull too. This changeset add logic similar to the one in 'unbundle' to the client side of 'getbundle'. That logic make sure the error is properly reported as "remote". This will allow the server side of getbundle to send clean "Abort" message in the next changeset. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1363,6 +1363,9 @@ def _pullbundle2(pullop): bundle = pullop.remote.getbundle('pull', **kwargs) try: op = bundle2.processbundle(pullop.repo, bundle, pullop.gettransaction) + except bundle2.AbortFromPart as exc: + pullop.repo.ui.status(_('remote: abort: %s\n') % exc) + raise error.Abort(_('pull failed on remote'), hint=exc.hint) except error.BundleValueError as exc: raise error.Abort(_('missing support for %s') % exc)