Patchwork D7329: index: use `index.has_node` in `repo._rollback`

login
register
mail settings
Submitter phabricator
Date Nov. 9, 2019, 8:41 a.m.
Message ID <2d2d81e54acfdfc651d26cb539347d37@localhost.localdomain>
Download mbox | patch
Permalink /patch/43058/
State Not Applicable
Headers show

Comments

phabricator - Nov. 9, 2019, 8:41 a.m.
Closed by commit rHG8ff16807dee4: index: use `index.has_node` in `repo._rollback` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7329?vs=17842&id=17868

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7329/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7329

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: marmoute, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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()