[PATCH 1 of 5] histedit: make cleanupnode more robust

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Aug 3 21:25:23 UTC 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1438382809 25200
#      Fri Jul 31 15:46:49 2015 -0700
# Node ID 7eb4f2a653e9412c51c4163ad0b5a6e0bea6e43a
# Parent  4dcc9b5d786a5f549bf999d0ca9e9babd27f93e4
histedit: make cleanupnode more robust

The goal of this function is to strip content out of the repository. We do not
really care if this content is visible or cleanup node not and we should proceed
anyway. None of the internal actions are subject to this, however, a third party
extension running arbitrary commands during histedit is affected by this.

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1130,10 +1130,14 @@ def cleanupnode(ui, repo, name, nodes):
     ui.debug('should strip %s nodes %s\n' %
              (name, ', '.join([node.short(n) for n in nodes])))
     lock = None
     try:
         lock = repo.lock()
+        # do not let filtering get in the way of the cleanse
+        # we should probably get ride of obsolescence marker created during the
+        # histedit, but we currently do not have such information.
+        repo = repo.unfiltered()
         # Find all node that need to be stripped
         # (we hg %lr instead of %ln to silently ignore unknown item
         nm = repo.changelog.nodemap
         nodes = sorted(n for n in nodes if n in nm)
         roots = [c.node() for c in repo.set("roots(%ln)", nodes)]


More information about the Mercurial-devel mailing list