Mercurial > evolve
changeset 5509:628215631e8e
metaedit: switch to cleanupnodes() so e.g. bookmarks are moved
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 25 Aug 2020 22:34:33 -0700 |
parents | 65622482cc9d |
children | 9fef6f8790a5 |
files | CHANGELOG hgext3rd/evolve/cmdrewrite.py tests/test-metaedit.t |
diffstat | 3 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGELOG Tue Aug 25 22:50:28 2020 -0700 +++ b/CHANGELOG Tue Aug 25 22:34:33 2020 -0700 @@ -5,6 +5,7 @@ -------------------- * numerous minor changes to packaging, README moved to README.rst + * metaedit: update bookmark location when applicable topic (0.20.0)
--- a/hgext3rd/evolve/cmdrewrite.py Tue Aug 25 22:50:28 2020 -0700 +++ b/hgext3rd/evolve/cmdrewrite.py Tue Aug 25 22:34:33 2020 -0700 @@ -935,14 +935,16 @@ phases.retractboundary(repo, tr, targetphase, [newid]) # Use this condition as a proxy since the commit we care about - # (6335c0de80fa) didn't change any signatures. - if not util.safehasattr(context, 'bin'): - obsolete.createmarkers(repo, [(tuple(allctx), (repo[newid],))], - metadata=metadata, operation=b"metaedit") + # (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 (6335c0de80fa) - obsolete.createmarkers(repo, [(ctx, (repo[newid],)) for ctx in allctx], - metadata=metadata, operation=b"metaedit") + # hg <= 4.7 (b99903534e06) + mapping = {ctx.node(): (newid,) for ctx in allctx} + scmutil.cleanupnodes(repo, mapping, operation=b"metaedit", + metadata=metadata) else: ui.status(_(b"nothing changed\n")) tr.close()
--- a/tests/test-metaedit.t Tue Aug 25 22:50:28 2020 -0700 +++ b/tests/test-metaedit.t Tue Aug 25 22:34:33 2020 -0700 @@ -265,12 +265,8 @@ A E A F $ hg gluf - @ 15: squashed - mr-squasher (C D E F) + @ 15 bookmark-D: squashed - mr-squasher (C D E F) | - | x 12 bookmark-D: D2 - foobar3 (D) - | | - | x 3: C - test (C) - |/ | o 2: B - test (B) |/ o 1: A - test (A)