changeset 43542:5f347567589b

index: use `index.has_node` in `bundlerepo.bundlerevlog` Differential Revision: https://phab.mercurial-scm.org/D7339
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 08 Nov 2019 13:24:54 +0100
parents 1944aaaecabf
children 2c3afd083e45
files mercurial/bundlerepo.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Fri Nov 08 14:20:48 2019 +0100
+++ b/mercurial/bundlerepo.py	Fri Nov 08 13:24:54 2019 +0100
@@ -64,18 +64,18 @@
             start = cgunpacker.tell() - size
 
             link = linkmapper(cs)
-            if node in self.nodemap:
+            if self.index.has_node(node):
                 # this can happen if two branches make the same change
                 self.bundlerevs.add(self.nodemap[node])
                 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 LookupError(
                     deltabase, self.indexfile, _(b'unknown delta base')
                 )