D7339: index: use `index.has_node` in `bundlerepo.bundlerevlog`

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Fri Nov 8 16:25:37 UTC 2019


marmoute 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/D7339

AFFECTED FILES
  mercurial/bundlerepo.py

CHANGE DETAILS

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



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


More information about the Mercurial-devel mailing list