changeset 43548:ccda03f6abcb

index: use `index.has_node` in `histedit.cleanupnode` Differential Revision: https://phab.mercurial-scm.org/D7352
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 08 Nov 2019 15:09:09 +0100
parents 2b5d07702f94
children 4cb3f5bb29ec
files hgext/histedit.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Fri Nov 08 15:08:27 2019 +0100
+++ b/hgext/histedit.py	Fri Nov 08 15:09:09 2019 +0100
@@ -2565,8 +2565,8 @@
         repo = repo.unfiltered()
         # Find all nodes that need to be stripped
         # (we use %lr instead of %ln to silently ignore unknown items)
-        nm = repo.changelog.nodemap
-        nodes = sorted(n for n in nodes if n in nm)
+        has_node = repo.changelog.index.has_node
+        nodes = sorted(n for n in nodes if has_node(n))
         roots = [c.node() for c in repo.set(b"roots(%ln)", nodes)]
         if roots:
             backup = not nobackup