diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4503,7 +4503,10 @@ def pull(ui, repo, source="default", **o try: ret = postincoming(ui, repo, modheads, opts.get('update'), checkout, brev) - + except error.FilteredRepoLookupError as exc: + msg = _('cannot update to target: %s') % exc.args[0] + exc.args = (msg,) + exc.args[1:] + raise finally: del repo._subtoppath diff --git a/tests/test-obsolete-distributed.t b/tests/test-obsolete-distributed.t --- a/tests/test-obsolete-distributed.t +++ b/tests/test-obsolete-distributed.t @@ -504,6 +504,21 @@ X` has to process a X that is filtered l (2 other changesets obsolete on arrival) (run 'hg heads' to see heads) +With --update + + $ hg rollback + repository tip rolled back to revision 4 (undo pull) + $ 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'! + [255] + $ cd .. Test pull report consistency