Patchwork D7328: index: use `index.has_node` in `revlog.addgroup`

login
register
mail settings
Submitter phabricator
Date Nov. 9, 2019, 5:18 a.m.
Message ID <0d098900f80492a95eb666856dee5735@localhost.localdomain>
Download mbox | patch
Permalink /patch/43025/
State Not Applicable
Headers show

Comments

phabricator - Nov. 9, 2019, 5:18 a.m.
marmoute updated this revision to Diff 17841.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7328?vs=17751&id=17841

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

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2318,18 +2318,18 @@ 
 
                 nodes.append(node)
 
-                if node in self.nodemap:
+                if self.index.has_node(node):
                     self._nodeduplicatecallback(transaction, node)
                     # this can happen if two branches make the same change
                     continue
 
                 for p in (p1, p2):
-                    if p not in self.nodemap:
+                    if not self.index.has_node(p):
                         raise error.LookupError(
                             p, self.indexfile, _(b'unknown parent')
                         )
 
-                if deltabase not in self.nodemap:
+                if not self.index.has_node(deltabase):
                     raise error.LookupError(
                         deltabase, self.indexfile, _(b'unknown delta base')
                     )