# HG changeset patch # User Laurent Charignon # Date 2015-05-04 17:38:45 # Node ID d9fb88c045a03619805b41477016152397e480f8 # Parent 86c0b5c09ee6e221a8345c69cc30cb5431780e98 context: make warning message for hidden revision extensible Extensions might want to create new filternames and change what revisions are considered hidden or shown. This is the case for inhibit that enables direct access to hidden hashes with the visible-directaccess-nowarn filtername. By using startswith instead of a direct comparison with 'visible' we allow extensions to do that and not work directly on the 'visible' filtername used by core. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -459,7 +459,7 @@ class changectx(basectx): pass except (error.FilteredIndexError, error.FilteredLookupError, error.FilteredRepoLookupError): - if repo.filtername == 'visible': + if repo.filtername.startswith('visible'): msg = _("hidden revision '%s'") % changeid hint = _('use --hidden to access hidden revisions') raise error.FilteredRepoLookupError(msg, hint=hint)