[PATCH 5 of 7] histedit: pass multiple nodes to strip (BC)

Jun Wu quark at fb.com
Sat Jul 8 19:51:33 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1499557831 25200
#      Sat Jul 08 16:50:31 2017 -0700
# Node ID 9a325ae88021e0e02a87ef1ae6baa8a199405140
# Parent  d1b9eb1ad8ac5f9e645337034594862e1ba37092
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 9a325ae88021
histedit: pass multiple nodes to strip (BC)

Previously, histedit.cleanupnode pass root nodes one by one. Since
repair.strip takes multiple nodes and can handle them just fine, pass all
strip roots at once.

This is BC because the number of strip backup files may change from N to 1.

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1604,9 +1604,6 @@ def cleanupnode(ui, repo, nodes):
         nodes = sorted(n for n in nodes if n in nm)
         roots = [c.node() for c in repo.set("roots(%ln)", nodes)]
-        for c in roots:
-            # We should process node in reverse order to strip tip most first.
-            # but this trigger a bug in changegroup hook.
-            # This would reduce bundle overhead
-            repair.strip(ui, repo, c)
+        if roots:
+            repair.strip(ui, repo, roots)
 
 def safecleanupnode(ui, repo, nodes):


More information about the Mercurial-devel mailing list