Mercurial > hg-stable
changeset 24922:d9fb88c045a0
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.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Mon, 04 May 2015 10:38:45 -0700 |
parents | 86c0b5c09ee6 |
children | e5f166961123 |
files | mercurial/context.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Sun May 03 14:18:32 2015 -0700 +++ b/mercurial/context.py Mon May 04 10:38:45 2015 -0700 @@ -459,7 +459,7 @@ 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)