# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 2019-11-08 15:00:47
# Node ID 0a338d8e670417e359a6035dcf72716beababd6b
# Parent  a35bbeef9d884886d6442db1cd533dbe4b49cd1e

index: use `index.has_node` in `exchange._pulldiscoverychangegroup`

Differential Revision: https://phab.mercurial-scm.org/D7346

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1855,7 +1855,7 @@ def _pulldiscoverychangegroup(pullop):
         pullop.repo, pullop.remote, heads=pullop.heads, force=pullop.force
     )
     common, fetch, rheads = tmp
-    nm = pullop.repo.unfiltered().changelog.nodemap
+    has_node = pullop.repo.unfiltered().changelog.index.has_node
     if fetch and rheads:
         # If a remote heads is filtered locally, put in back in common.
         #
@@ -1868,7 +1868,7 @@ def _pulldiscoverychangegroup(pullop):
         # but are not including a remote heads, we'll not be able to detect it,
         scommon = set(common)
         for n in rheads:
-            if n in nm:
+            if has_node(n):
                 if n not in scommon:
                     common.append(n)
         if set(rheads).issubset(set(common)):