# HG changeset patch # User Pierre-Yves David # Date 1583334843 -3600 # Node ID 9f3ad17b62ef8e8ece25c4b6f3908d7eb9c5fb2d # Parent b9af7b8f3eee828826d42b61a4c4fa8012272d6c compat: drop 4.5 compatibility for `_filterederror` diff -r b9af7b8f3eee -r 9f3ad17b62ef hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Wed Mar 04 16:03:23 2020 +0100 +++ b/hgext3rd/evolve/__init__.py Wed Mar 04 16:14:03 2020 +0100 @@ -269,7 +269,6 @@ bookmarks as bookmarksmod, cmdutil, commands, - context, dirstate, error, help, @@ -721,38 +720,6 @@ ui.warn(b"(%s)\n" % solvemsg) -if util.safehasattr(context, '_filterederror'): # <= hg-4.5 - @eh.wrapfunction(context, '_filterederror') - def evolve_filtererror(original, repo, changeid): - """build an exception to be raised about a filtered changeid - - This is extracted in a function to help extensions (eg: evolve) to - experiment with various message variants.""" - if repo.filtername.startswith(b'visible'): - - unfilteredrepo = repo.unfiltered() - rev = repo[scmutil.revsingle(unfilteredrepo, changeid)] - reason, successors = obshistory._getobsfateandsuccs(unfilteredrepo, rev.node()) - - # Be more precise in case the revision is superseded - if reason == b'superseded': - reason = _(b"successor: %s") % successors[0] - elif reason == b'superseded_split': - if len(successors) <= 2: - reason = _(b"successors: %s") % b", ".join(successors) - else: - firstsuccessors = b", ".join(successors[:2]) - remainingnumber = len(successors) - 2 - successorsmsg = _(b"%s and %d more") % (firstsuccessors, remainingnumber) - reason = _(b"successors: %s") % successorsmsg - - msg = _(b"hidden revision '%s'") % changeid - hint = _(b'use --hidden to access hidden revisions; %s') % reason - return error.FilteredRepoLookupError(msg, hint=hint) - msg = _(b"filtered revision '%s' (not in '%s' subset)") - msg %= (changeid, repo.filtername) - return error.FilteredRepoLookupError(msg) - @eh.wrapcommand(b"update") @eh.wrapcommand(b"pull") def wrapmayobsoletewc(origfn, ui, repo, *args, **opts):