changeset 43537:7f489b9a79a1

index: use `index.has_node` in `repo._rollback` Differential Revision: https://phab.mercurial-scm.org/D7329
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 08 Nov 2019 14:00:22 +0100
parents bf6fa330e0a5
children 9970412d2ce3
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sun Nov 03 00:49:55 2019 +0100
+++ b/mercurial/localrepo.py	Fri Nov 08 14:00:22 2019 +0100
@@ -2351,7 +2351,8 @@
             self.svfs.rename(b'undo.phaseroots', b'phaseroots', checkambig=True)
         self.invalidate()
 
-        parentgone = any(p not in self.changelog.nodemap for p in parents)
+        has_node = self.changelog.index.has_node
+        parentgone = any(not has_node(p) for p in parents)
         if parentgone:
             # prevent dirstateguard from overwriting already restored one
             dsguard.close()