# HG changeset patch # User Pierre-Yves David # Date 2019-11-08 13:00:22 # Node ID 7f489b9a79a1211edc70dc89599f12fe7100f39f # Parent bf6fa330e0a5d8b8559cebcfdbb392ff6179b811 index: use `index.has_node` in `repo._rollback` Differential Revision: https://phab.mercurial-scm.org/D7329 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2351,7 +2351,8 @@ class localrepository(object): 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()