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.
--- 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()