# HG changeset patch # User Anton Shestakov # Date 1660199916 -14400 # Node ID 0f16420c5907f2dbf6cc3af8ac5cbbd86c4dee5d # Parent 0ef3c127cf28c4778c03ce58fee7678e12b82f84 evolve: remove 4.7 compatibility (internal API data format) diff -r 0ef3c127cf28 -r 0f16420c5907 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Mon Sep 19 15:41:10 2022 +0200 +++ b/hgext3rd/evolve/cmdrewrite.py Thu Aug 11 10:38:36 2022 +0400 @@ -823,17 +823,9 @@ metadata[b'note'] = opts['note'] phases.retractboundary(repo, tr, targetphase, [newid]) - # Use this condition as a proxy since the commit we care about - # (b99903534e06) didn't change any signatures. - if util.safehasattr(scmutil, 'nullrev'): - mapping = {tuple(ctx.node() for ctx in allctx): (newid,)} - scmutil.cleanupnodes(repo, mapping, operation=b"metaedit", - metadata=metadata) - else: - # hg <= 4.7 (b99903534e06) - mapping = {ctx.node(): (newid,) for ctx in allctx} - scmutil.cleanupnodes(repo, mapping, operation=b"metaedit", - metadata=metadata) + replacements = {tuple(ctx.node() for ctx in allctx): (newid,)} + scmutil.cleanupnodes(repo, replacements, operation=b"metaedit", + metadata=metadata) else: ui.status(_(b"nothing changed\n")) tr.close() diff -r 0ef3c127cf28 -r 0f16420c5907 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Mon Sep 19 15:41:10 2022 +0200 +++ b/hgext3rd/evolve/evolvecmd.py Thu Aug 11 10:38:36 2022 +0400 @@ -757,11 +757,7 @@ if saveeffectflag: # The effect flag is saved in a versioned field name for # future evolution - try: - effectflag = obsutil.geteffectflag(prec, (succ,)) - except TypeError: - # hg <= 4.7 (bae6f1418a95) - effectflag = obsutil.geteffectflag((prec, (succ,))) + effectflag = obsutil.geteffectflag(prec, (succ,)) metadata[obsutil.EFFECTFLAGFIELD] = b"%d" % effectflag # create markers diff -r 0ef3c127cf28 -r 0f16420c5907 hgext3rd/evolve/rewind.py --- a/hgext3rd/evolve/rewind.py Mon Sep 19 15:41:10 2022 +0200 +++ b/hgext3rd/evolve/rewind.py Thu Aug 11 10:38:36 2022 +0400 @@ -133,17 +133,13 @@ relationships.append(rel) if wctxp.node() == source: update_target = newdest[-1] - # Use this condition as a proxy since the commit we care about - # (b99903534e06) didn't change any signatures. - if util.safehasattr(scmutil, 'nullrev'): - # hg <= 4.7 (b99903534e06) - destmap = util.sortdict() - for src, dest in relationships: - destmap.setdefault(dest, []).append(src) - relationships = [ - (tuple(src), dest) - for dest, src in destmap.items() - ] + destmap = util.sortdict() + for src, dest in relationships: + destmap.setdefault(dest, []).append(src) + relationships = [ + (tuple(src), dest) + for dest, src in destmap.items() + ] obsolete.createmarkers(unfi, relationships, operation=b'rewind') if update_target is not None: if opts.get('keep'):