Patchwork D7348: index: use `index.has_node` in `exchangev2._pullchangesetdiscovery`

login
register
mail settings
Submitter phabricator
Date Nov. 8, 2019, 4:26 p.m.
Message ID <differential-rev-PHID-DREV-7rmlzplhrb4rvglpcsdq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42950/
State Superseded
Headers show

Comments

phabricator - Nov. 8, 2019, 4:26 p.m.
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/D7348

AFFECTED FILES
  mercurial/exchangev2.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/exchangev2.py b/mercurial/exchangev2.py
--- a/mercurial/exchangev2.py
+++ b/mercurial/exchangev2.py
@@ -291,9 +291,9 @@ 
     # See the comment in exchange._pulldiscoverychangegroup() for more.
 
     if fetch and remoteheads:
-        nodemap = repo.unfiltered().changelog.nodemap
+        has_node = repo.unfiltered().changelog.index.has_node
 
-        common |= {head for head in remoteheads if head in nodemap}
+        common |= {head for head in remoteheads if has_node(head)}
 
         if set(remoteheads).issubset(common):
             fetch = []