431 """build an exception to be raised about a filtered changeid |
432 """build an exception to be raised about a filtered changeid |
432 |
433 |
433 This is extracted in a function to help extensions (eg: evolve) to |
434 This is extracted in a function to help extensions (eg: evolve) to |
434 experiment with various message variants.""" |
435 experiment with various message variants.""" |
435 if repo.filtername.startswith('visible'): |
436 if repo.filtername.startswith('visible'): |
436 msg = _("hidden revision '%s'") % changeid |
437 |
|
438 # Check if the changeset is obsolete |
|
439 unfilteredrepo = repo.unfiltered() |
|
440 ctx = unfilteredrepo[changeid] |
|
441 |
|
442 # If the changeset is obsolete, enrich the hint with the reason that |
|
443 # made this changeset not visible |
|
444 if ctx.obsolete(): |
|
445 reason = obsutil._getfilteredreason(unfilteredrepo, ctx) |
|
446 msg = _("hidden revision '%s' %s") % (changeid, reason) |
|
447 else: |
|
448 msg = _("hidden revision '%s'") % changeid |
|
449 |
437 hint = _('use --hidden to access hidden revisions') |
450 hint = _('use --hidden to access hidden revisions') |
|
451 |
438 return error.FilteredRepoLookupError(msg, hint=hint) |
452 return error.FilteredRepoLookupError(msg, hint=hint) |
439 msg = _("filtered revision '%s' (not in '%s' subset)") |
453 msg = _("filtered revision '%s' (not in '%s' subset)") |
440 msg %= (changeid, repo.filtername) |
454 msg %= (changeid, repo.filtername) |
441 return error.FilteredRepoLookupError(msg) |
455 return error.FilteredRepoLookupError(msg) |
442 |
456 |