comparison mercurial/context.py @ 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 c82d88dfaf59
children 755d23a49170
comparison
equal deleted inserted replaced
24921:86c0b5c09ee6 24922:d9fb88c045a0
457 changeid = hex(changeid) 457 changeid = hex(changeid)
458 except TypeError: 458 except TypeError:
459 pass 459 pass
460 except (error.FilteredIndexError, error.FilteredLookupError, 460 except (error.FilteredIndexError, error.FilteredLookupError,
461 error.FilteredRepoLookupError): 461 error.FilteredRepoLookupError):
462 if repo.filtername == 'visible': 462 if repo.filtername.startswith('visible'):
463 msg = _("hidden revision '%s'") % changeid 463 msg = _("hidden revision '%s'") % changeid
464 hint = _('use --hidden to access hidden revisions') 464 hint = _('use --hidden to access hidden revisions')
465 raise error.FilteredRepoLookupError(msg, hint=hint) 465 raise error.FilteredRepoLookupError(msg, hint=hint)
466 msg = _("filtered revision '%s' (not in '%s' subset)") 466 msg = _("filtered revision '%s' (not in '%s' subset)")
467 msg %= (changeid, repo.filtername) 467 msg %= (changeid, repo.filtername)