##// END OF EJS Templates
hidden: extract the code generating "filtered rev" error for wrapping...
Pierre-Yves David -
r32006:c84c83b5 default
parent child Browse files
Show More
@@ -407,6 +407,19 b' def makememctx(repo, parents, text, user'
407 407 date, extra, editor)
408 408 return ctx
409 409
410 def _filterederror(repo, changeid):
411 """build an exception to be raised about a filtered changeid
412
413 This is extracted in a function to help extensions (eg: evolve) to
414 experiment with various message variants."""
415 if repo.filtername.startswith('visible'):
416 msg = _("hidden revision '%s'") % changeid
417 hint = _('use --hidden to access hidden revisions')
418 return error.FilteredRepoLookupError(msg, hint=hint)
419 msg = _("filtered revision '%s' (not in '%s' subset)")
420 msg %= (changeid, repo.filtername)
421 return error.FilteredRepoLookupError(msg)
422
410 423 class changectx(basectx):
411 424 """A changecontext object makes access to data related to a particular
412 425 changeset convenient. It represents a read-only context already present in
@@ -513,13 +526,7 b' class changectx(basectx):'
513 526 pass
514 527 except (error.FilteredIndexError, error.FilteredLookupError,
515 528 error.FilteredRepoLookupError):
516 if repo.filtername.startswith('visible'):
517 msg = _("hidden revision '%s'") % changeid
518 hint = _('use --hidden to access hidden revisions')
519 raise error.FilteredRepoLookupError(msg, hint=hint)
520 msg = _("filtered revision '%s' (not in '%s' subset)")
521 msg %= (changeid, repo.filtername)
522 raise error.FilteredRepoLookupError(msg)
529 raise _filterederror(repo, changeid)
523 530 except IndexError:
524 531 pass
525 532 raise error.RepoLookupError(
General Comments 0
You need to be logged in to leave comments. Login now