Patchwork [1,of,5] histedit: make cleanupnode more robust

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 3, 2015, 9:25 p.m.
Message ID <7eb4f2a653e9412c51c4.1438637123@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10094/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 3, 2015, 9:25 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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)]