uncommit: use scmtutil.cleanupnodes()
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 22 Jan 2019 10:45:16 -0800
changeset 4373 11bbf4dc694f
parent 4372 5345be014f2c
child 4374 86bf0b106949
uncommit: use scmtutil.cleanupnodes()
hgext3rd/evolve/cmdrewrite.py
--- a/hgext3rd/evolve/cmdrewrite.py	Tue Jan 22 10:33:02 2019 -0800
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Jan 22 10:45:16 2019 -0800
@@ -522,7 +522,6 @@
 
         # Recommit the filtered changeset
         tr = repo.transaction('uncommit')
-        updatebookmarks = rewriteutil.bookmarksupdater(repo, old.node(), tr)
         if interactive:
             opts['all'] = True
             match = scmutil.match(old, pats, opts)
@@ -547,8 +546,9 @@
         if opts.get('note'):
             metadata['note'] = opts['note']
 
-        obsolete.createmarkers(repo, [(old, (repo[newid],))], metadata=metadata,
-                               operation="uncommit")
+        replacements = {old.node(): [newid]}
+        scmutil.cleanupnodes(repo, replacements, operation="uncommit",
+                             metadata=metadata)
         phases.retractboundary(repo, tr, oldphase, [newid])
         if opts.get('revert'):
             hg.updaterepo(repo, newid, True)
@@ -556,7 +556,6 @@
             with repo.dirstate.parentchange():
                 repo.dirstate.setparents(newid, node.nullid)
                 _uncommitdirstate(repo, old, match, interactive)
-        updatebookmarks(newid)
         if not repo[newid].files():
             ui.warn(_("new changeset is empty\n"))
             ui.status(_("(use 'hg prune .' to remove it)\n"))