# HG changeset patch # User Martin von Zweigbergk # Date 2019-01-25 00:25:19 # Node ID 390ef056081bd9607fa820a0b832bbaeed3005a0 # Parent 608c15f76f507a539310d93f5d30ccfc651cee21 localrepo: slightly simplify check for removed parents in _rollback() Differential Revision: https://phab.mercurial-scm.org/D5692 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2011,8 +2011,7 @@ class localrepository(object): self.svfs.rename('undo.phaseroots', 'phaseroots', checkambig=True) self.invalidate() - parentgone = (parents[0] not in self.changelog.nodemap or - parents[1] not in self.changelog.nodemap) + parentgone = any(p not in self.changelog.nodemap for p in parents) if parentgone: # prevent dirstateguard from overwriting already restored one dsguard.close()