comparison mercurial/commands.py @ 42130:a362b0b95e42

pull: improved message issued in case of failed update When running `hg pull --update`, the update step may fail. Nothing in the error message help to understand the abort is related to the secondary step (update) instead of the primary step (pull). We now add some information to the error message to clarify it comes from the update part. It is useful in various situation (uncommitted changes blocking the update, update to hidden destination, etc...) The pull output is updated from: $ hg pull ../repo-Bob --rev 956063ac4557 --update pulling from ../repo-Bob searching for changes adding changesets adding manifests adding file changes added 2 changesets with 0 changes to 2 files (+1 heads) (2 other changesets obsolete on arrival) abort: filtered revision '6'! to: $ hg pull ../repo-Bob --rev 956063ac4557 --update pulling from ../repo-Bob searching for changes adding changesets adding manifests adding file changes added 2 changesets with 0 changes to 2 files (+1 heads) (2 other changesets obsolete on arrival) abort: cannot update to target: filtered revision '6'! (I am not sure why the actual error, "filtered revision '6'", is not using the more modern format mentioning the obsolescence fate of '6')
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 05 Apr 2019 14:35:33 +0200
parents 232a33a11ce0
children 013de80bf90e
comparison
equal deleted inserted replaced
42129:232a33a11ce0 42130:a362b0b95e42
4501 brev = branches[0] 4501 brev = branches[0]
4502 repo._subtoppath = source 4502 repo._subtoppath = source
4503 try: 4503 try:
4504 ret = postincoming(ui, repo, modheads, opts.get('update'), 4504 ret = postincoming(ui, repo, modheads, opts.get('update'),
4505 checkout, brev) 4505 checkout, brev)
4506 4506 except error.FilteredRepoLookupError as exc:
4507 msg = _('cannot update to target: %s') % exc.args[0]
4508 exc.args = (msg,) + exc.args[1:]
4509 raise
4507 finally: 4510 finally:
4508 del repo._subtoppath 4511 del repo._subtoppath
4509 4512
4510 finally: 4513 finally:
4511 other.close() 4514 other.close()