Mercurial > public > mercurial-scm > hg
comparison mercurial/exchange.py @ 30913:d70971a3ae80 stable
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.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 10 Feb 2017 18:17:20 +0100 |
parents | 4c8dcb491974 |
children | 455677a7667f ffed3bf5cd4c |
comparison
equal
deleted
inserted
replaced
30912:3d4afc2fdcd7 | 30913:d70971a3ae80 |
---|---|
1361 pullop.stepsdone.add('obsmarkers') | 1361 pullop.stepsdone.add('obsmarkers') |
1362 _pullbundle2extraprepare(pullop, kwargs) | 1362 _pullbundle2extraprepare(pullop, kwargs) |
1363 bundle = pullop.remote.getbundle('pull', **kwargs) | 1363 bundle = pullop.remote.getbundle('pull', **kwargs) |
1364 try: | 1364 try: |
1365 op = bundle2.processbundle(pullop.repo, bundle, pullop.gettransaction) | 1365 op = bundle2.processbundle(pullop.repo, bundle, pullop.gettransaction) |
1366 except bundle2.AbortFromPart as exc: | |
1367 pullop.repo.ui.status(_('remote: abort: %s\n') % exc) | |
1368 raise error.Abort(_('pull failed on remote'), hint=exc.hint) | |
1366 except error.BundleValueError as exc: | 1369 except error.BundleValueError as exc: |
1367 raise error.Abort(_('missing support for %s') % exc) | 1370 raise error.Abort(_('missing support for %s') % exc) |
1368 | 1371 |
1369 if pullop.fetch: | 1372 if pullop.fetch: |
1370 results = [cg['return'] for cg in op.records['changegroup']] | 1373 results = [cg['return'] for cg in op.records['changegroup']] |