# HG changeset patch # User Pierre-Yves David # Date 2014-10-17 22:25:32 # Node ID c1aede895072e28a430a353efdd203daf43d1f3a # Parent a4dd270a419ce879176c1e43d82982b9cb5d59af repoview: issue a special message when filtering hidden changesets Hidden changesets are by far the most common error case and is the only one[1] that can reach the user. We move to a friendlier message with a hint about how to access the data anyway. We should probably point to a help topic instead but we do not have such a topic yet. Example of the new output abort: hidden revision '4'! (use --hidden to access hidden revisions) [1] Actually, filtering from "served" can also reach the user during certain exchange operations. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -469,6 +469,10 @@ class changectx(basectx): pass except (error.FilteredIndexError, error.FilteredLookupError, error.FilteredRepoLookupError): + if repo.filtername == 'visible': + msg = _("hidden revision '%s'") % changeid + hint = _('use --hidden to access hidden revisions') + raise error.FilteredRepoLookupError(msg, hint=hint) msg = _("filtered revision '%s' (not in '%s' subset)") msg %= (changeid, repo.filtername) raise error.FilteredRepoLookupError(msg) diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -1393,7 +1393,8 @@ enable obsolete to test hidden feature 1:a765632148dc55d38c35c4f247c618701886cb2f 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05 $ hg log -r a - abort: filtered revision 'a' (not in 'visible' subset)! + abort: hidden revision 'a'! + (use --hidden to access hidden revisions) [255] test that parent prevent a changeset to be hidden diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -182,7 +182,8 @@ check that various commands work well wi abort: unknown revision '6'! [255] $ hg log -r 4 - abort: filtered revision '4' (not in 'visible' subset)! + abort: hidden revision '4'! + (use --hidden to access hidden revisions) [255] Check that public changeset are not accounted as obsolete: