##// 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 def makememctx(repo, parents, text, user
407 date, extra, editor)
407 date, extra, editor)
408 return ctx
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 class changectx(basectx):
423 class changectx(basectx):
411 """A changecontext object makes access to data related to a particular
424 """A changecontext object makes access to data related to a particular
412 changeset convenient. It represents a read-only context already present in
425 changeset convenient. It represents a read-only context already present in
@@ -513,13 +526,7 class changectx(basectx):
513 pass
526 pass
514 except (error.FilteredIndexError, error.FilteredLookupError,
527 except (error.FilteredIndexError, error.FilteredLookupError,
515 error.FilteredRepoLookupError):
528 error.FilteredRepoLookupError):
516 if repo.filtername.startswith('visible'):
529 raise _filterederror(repo, changeid)
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)
523 except IndexError:
530 except IndexError:
524 pass
531 pass
525 raise error.RepoLookupError(
532 raise error.RepoLookupError(
General Comments 0
You need to be logged in to leave comments. Login now