index: use `index.has_node` in `histedit._finishhistedit
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 08 Nov 2019 15:08:27 +0100
changeset 43595 2b5d07702f94
parent 43594 a166fadf5c3b
child 43596 ccda03f6abcb
index: use `index.has_node` in `histedit._finishhistedit Differential Revision: https://phab.mercurial-scm.org/D7351
hgext/histedit.py
--- a/hgext/histedit.py	Fri Nov 08 13:25:25 2019 +0100
+++ b/hgext/histedit.py	Fri Nov 08 15:08:27 2019 +0100
@@ -2046,11 +2046,11 @@
             mapping[n] = ()
 
     # remove entries about unknown nodes
-    nodemap = repo.unfiltered().changelog.nodemap
+    has_node = repo.unfiltered().changelog.index.has_node
     mapping = {
         k: v
         for k, v in mapping.items()
-        if k in nodemap and all(n in nodemap for n in v)
+        if has_node(k) and all(has_node(n) for n in v)
     }
     scmutil.cleanupnodes(repo, mapping, b'histedit')
     hf = fm.hexfunc