D5692: localrepo: slightly simplify check for removed parents in _rollback()
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Fri Jan 25 00:47:17 UTC 2019
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5692
AFFECTED FILES
mercurial/localrepo.py
CHANGE DETAILS
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2011,8 +2011,7 @@
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()
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list