# HG changeset patch # User Anton Shestakov # Date 1633691013 -10800 # Node ID a49a90a5fa5bf414edde81780fce9e45abe5d2cd # Parent 2da56c12e70f33b42fc513b64f27abff6b13826b compat: make prune and rewind use the new dirstate.get_entry() diff -r 2da56c12e70f -r a49a90a5fa5b hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Tue Oct 05 09:30:02 2021 +0300 +++ b/hgext3rd/evolve/cmdrewrite.py Fri Oct 08 14:03:33 2021 +0300 @@ -1011,7 +1011,7 @@ # reset files that only changed in the dirstate too dirstate = repo.dirstate - dirchanges = [f for f in dirstate if dirstate[f] != b'n'] + dirchanges = compat.dirchanges(dirstate) changedfiles.extend(dirchanges) repo.dirstate.rebuild(newnode.node(), newnode.manifest(), changedfiles) diff -r 2da56c12e70f -r a49a90a5fa5b hgext3rd/evolve/compat.py --- a/hgext3rd/evolve/compat.py Tue Oct 05 09:30:02 2021 +0300 +++ b/hgext3rd/evolve/compat.py Fri Oct 08 14:03:33 2021 +0300 @@ -554,3 +554,13 @@ } context.overlayworkingctx._markdirty = fixedmarkdirty + +if util.safehasattr(dirstate.dirstate, 'get_entry'): + def dirchanges(dirstate): + return [ + f for f in dirstate if not dirstate.get_entry(f).maybe_clean + ] +else: + # hg <= 5.9 (dcd97b082b3b) + def dirchanges(dirstate): + return [f for f in dirstate if dirstate[f] != b'n'] diff -r 2da56c12e70f -r a49a90a5fa5b hgext3rd/evolve/rewind.py --- a/hgext3rd/evolve/rewind.py Tue Oct 05 09:30:02 2021 +0300 +++ b/hgext3rd/evolve/rewind.py Fri Oct 08 14:03:33 2021 +0300 @@ -163,7 +163,7 @@ # reset files that only changed in the dirstate too dirstate = repo.dirstate - dirchanges = [f for f in dirstate if dirstate[f] != 'n'] + dirchanges = compat.dirchanges(dirstate) changedfiles.extend(dirchanges) repo.dirstate.rebuild(newctx.node(), newctx.manifest(), changedfiles)