amend: use scmutil.cleanupnodes() with --patch
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 22 Jan 2019 10:33:02 -0800
changeset 4372 5345be014f2c
parent 4371 9a218768bac5
child 4373 11bbf4dc694f
amend: use scmutil.cleanupnodes() with --patch
hgext3rd/evolve/cmdrewrite.py
--- a/hgext3rd/evolve/cmdrewrite.py	Tue Jan 22 10:32:44 2019 -0800
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Jan 22 10:33:02 2019 -0800
@@ -159,7 +159,6 @@
         old = repo['.']
         p1 = old.p1()
         rewriteutil.precheck(repo, [old.rev()], 'amend')
-        bookmarkupdater = rewriteutil.bookmarksupdater(repo, old.node(), tr)
         diffopts = patch.difffeatureopts(repo.ui, whitespace=True)
         diffopts.nodates = True
         diffopts.git = True
@@ -176,11 +175,11 @@
         metadata = {}
         if opts.get('note'):
             metadata['note'] = opts['note']
-        obsolete.createmarkers(repo, [(old, (repo[newnode],))],
-                               metadata=metadata, operation='amend')
+        replacements = {old.node(): [newnode]}
+        scmutil.cleanupnodes(repo, replacements, operation='amend',
+                             metadata=metadata)
         phases.retractboundary(repo, tr, old.phase(), [newnode])
         hg.updaterepo(repo, newnode, True)
-        bookmarkupdater(newnode)
         tr.close()
     finally:
         if tr is not None: