index: use `index.has_node` in `revlog.addgroup`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 03 Nov 2019 00:49:55 +0100
changeset 43584 bf6fa330e0a5
parent 43583 8b533de0429d
child 43585 7f489b9a79a1
index: use `index.has_node` in `revlog.addgroup` Differential Revision: https://phab.mercurial-scm.org/D7328
mercurial/revlog.py
--- a/mercurial/revlog.py	Sun Nov 03 00:05:20 2019 +0100
+++ b/mercurial/revlog.py	Sun Nov 03 00:49:55 2019 +0100
@@ -2306,18 +2306,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')
                     )