changeset 31526:9d55494bd0db

histedit: use safecleanupnode in _finishhistedit This simplifies code a lot.
author Jun Wu <quark@fb.com>
date Mon, 13 Mar 2017 22:19:06 -0700
parents 8633d3e21443
children 6f0b7475cf9a
files hgext/histedit.py
diffstat 1 files changed, 2 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Mon Mar 13 21:10:45 2017 -0700
+++ b/hgext/histedit.py	Mon Mar 13 22:19:06 2017 -0700
@@ -1169,29 +1169,13 @@
                     for n in succs[1:]:
                         ui.debug(m % node.short(n))
 
-    supportsmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt)
-    if supportsmarkers:
-        # Only create markers if the temp nodes weren't already removed.
-        obsolete.createmarkers(repo, ((repo[t],()) for t in sorted(tmpnodes)
-                                       if t in repo))
-    else:
-        cleanupnode(ui, repo, 'temp', tmpnodes)
+    safecleanupnode(ui, repo, 'temp', tmpnodes)
 
     if not state.keep:
         if mapping:
             movebookmarks(ui, repo, mapping, state.topmost, ntm)
             # TODO update mq state
-        if supportsmarkers:
-            markers = []
-            # sort by revision number because it sound "right"
-            for prec in sorted(mapping, key=repo.changelog.rev):
-                succs = mapping[prec]
-                markers.append((repo[prec],
-                                tuple(repo[s] for s in succs)))
-            if markers:
-                obsolete.createmarkers(repo, markers)
-        else:
-            cleanupnode(ui, repo, 'replaced', mapping)
+        safecleanupnode(ui, repo, 'replaced', mapping)
 
     state.clear()
     if os.path.exists(repo.sjoin('undo')):