There is no reason to pass an unfiltered-repo to _getfilteredreason and
successorssets, so use a normal repo instead.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
There is no reason to pass an unfiltered-repo to _getfilteredreason and
successorssets, so use a normal repo instead.
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | mercurial/context.py (2 lines) | |||
| M | mercurial/obsutil.py (4 lines) |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | lothiraldan | ||
| Closed | lothiraldan | ||
| Closed | lothiraldan |
| # Check if the changeset is obsolete | # Check if the changeset is obsolete | ||||
| unfilteredrepo = repo.unfiltered() | unfilteredrepo = repo.unfiltered() | ||||
| ctx = unfilteredrepo[changeid] | ctx = unfilteredrepo[changeid] | ||||
| # If the changeset is obsolete, enrich the message with the reason | # If the changeset is obsolete, enrich the message with the reason | ||||
| # that made this changeset not visible | # that made this changeset not visible | ||||
| if ctx.obsolete(): | if ctx.obsolete(): | ||||
| msg = obsutil._getfilteredreason(unfilteredrepo, changeid, ctx) | msg = obsutil._getfilteredreason(repo, changeid, ctx) | ||||
| else: | else: | ||||
| msg = _("hidden revision '%s'") % changeid | msg = _("hidden revision '%s'") % changeid | ||||
| hint = _('use --hidden to access hidden revisions') | hint = _('use --hidden to access hidden revisions') | ||||
| return error.FilteredRepoLookupError(msg, hint=hint) | return error.FilteredRepoLookupError(msg, hint=hint) | ||||
| msg = _("filtered revision '%s' (not in '%s' subset)") | msg = _("filtered revision '%s' (not in '%s' subset)") | ||||
| msg %= (changeid, repo.filtername) | msg %= (changeid, repo.filtername) | ||||
| "pruned": _("hidden revision '%s' is pruned"), | "pruned": _("hidden revision '%s' is pruned"), | ||||
| "diverged": _("hidden revision '%s' has diverged"), | "diverged": _("hidden revision '%s' has diverged"), | ||||
| "superseded": _("hidden revision '%s' was rewritten as: %s"), | "superseded": _("hidden revision '%s' was rewritten as: %s"), | ||||
| "superseded_split": _("hidden revision '%s' was split as: %s"), | "superseded_split": _("hidden revision '%s' was split as: %s"), | ||||
| "superseded_split_several": _("hidden revision '%s' was split as: %s and " | "superseded_split_several": _("hidden revision '%s' was split as: %s and " | ||||
| "%d more"), | "%d more"), | ||||
| } | } | ||||
| def _getfilteredreason(unfilteredrepo, changeid, ctx): | def _getfilteredreason(repo, changeid, ctx): | ||||
| """return a human-friendly string on why a obsolete changeset is hidden | """return a human-friendly string on why a obsolete changeset is hidden | ||||
| """ | """ | ||||
| successors = successorssets(unfilteredrepo, ctx.node()) | successors = successorssets(repo, ctx.node()) | ||||
| fate = _getobsfate(successors) | fate = _getobsfate(successors) | ||||
| # Be more precise in case the revision is superseded | # Be more precise in case the revision is superseded | ||||
| if fate == 'pruned': | if fate == 'pruned': | ||||
| return filteredmsgtable['pruned'] % changeid | return filteredmsgtable['pruned'] % changeid | ||||
| elif fate == 'diverged': | elif fate == 'diverged': | ||||
| return filteredmsgtable['diverged'] % changeid | return filteredmsgtable['diverged'] % changeid | ||||
| elif fate == 'superseded': | elif fate == 'superseded': | ||||