Mercurial > evolve
changeset 6299:0f16420c5907
evolve: remove 4.7 compatibility (internal API data format)
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 11 Aug 2022 10:38:36 +0400 |
parents | 0ef3c127cf28 |
children | f656daf884a4 |
files | hgext3rd/evolve/cmdrewrite.py hgext3rd/evolve/evolvecmd.py hgext3rd/evolve/rewind.py |
diffstat | 3 files changed, 11 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- 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()
--- 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
--- 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'):