changeset 43538:9970412d2ce3

index: use `index.has_node` in `analyzeremotephases` Differential Revision: https://phab.mercurial-scm.org/D7330
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 08 Nov 2019 14:16:24 +0100
parents 7f489b9a79a1
children 44f54b8f9f10
files mercurial/phases.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/phases.py	Fri Nov 08 14:00:22 2019 +0100
+++ b/mercurial/phases.py	Fri Nov 08 14:16:24 2019 +0100
@@ -672,7 +672,7 @@
     repo = repo.unfiltered()
     # build list from dictionary
     draftroots = []
-    nodemap = repo.changelog.nodemap  # to filter unknown nodes
+    has_node = repo.changelog.index.has_node  # to filter unknown nodes
     for nhex, phase in pycompat.iteritems(roots):
         if nhex == b'publishing':  # ignore data related to publish option
             continue
@@ -688,7 +688,7 @@
                     % nhex
                 )
         elif phase == draft:
-            if node in nodemap:
+            if has_node(node):
                 draftroots.append(node)
         else:
             repo.ui.warn(