# HG changeset patch # User Martin von Zweigbergk # Date 1548179125 28800 # Node ID 45c0415e45b9a05020b8c5dc5c517487674101e7 # Parent 75276f858444588d4d616877bc17cd6d0bdd472d fold: use scmutil.cleanupnodes() scmutil.cleanupnodes() has existed since 4.3 and had the metadata argument since 4.4, so we can now safely depend on it. diff -r 75276f858444 -r 45c0415e45b9 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Sat Jan 26 23:58:18 2019 +0800 +++ b/hgext3rd/evolve/cmdrewrite.py Tue Jan 22 09:45:25 2019 -0800 @@ -776,14 +776,9 @@ root.p2().node()], commitopts=commitopts) phases.retractboundary(repo, tr, targetphase, [newid]) - obsolete.createmarkers(repo, [(ctx, (repo[newid],)) - for ctx in allctx], metadata=metadata, - operation="fold") - # move bookmarks from old nodes to the new one - # XXX: we should make rewriteutil.rewrite() handle such cases - for ctx in allctx: - bmupdater = rewriteutil.bookmarksupdater(repo, ctx.node(), tr) - bmupdater(newid) + replacements = {ctx.node(): [newid] for ctx in allctx} + scmutil.cleanupnodes(repo, replacements, operation="fold", + metadata=metadata) tr.close() finally: tr.release()