changeset 43541:1944aaaecabf

index: use `index.has_node` in `obsutil.foreground` Differential Revision: https://phab.mercurial-scm.org/D7334
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 08 Nov 2019 14:20:48 +0100
parents c8f1e8412db4
children 5f347567589b
files mercurial/obsutil.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsutil.py	Fri Nov 08 14:19:53 2019 +0100
+++ b/mercurial/obsutil.py	Fri Nov 08 14:20:48 2019 +0100
@@ -328,7 +328,7 @@
     if repo.obsstore:
         # We only need this complicated logic if there is obsolescence
         # XXX will probably deserve an optimised revset.
-        nm = repo.changelog.nodemap
+        has_node = repo.changelog.index.has_node
         plen = -1
         # compute the whole set of successors or descendants
         while len(foreground) != plen:
@@ -336,7 +336,7 @@
             succs = set(c.node() for c in foreground)
             mutable = [c.node() for c in foreground if c.mutable()]
             succs.update(allsuccessors(repo.obsstore, mutable))
-            known = (n for n in succs if n in nm)
+            known = (n for n in succs if has_node(n))
             foreground = set(repo.set(b'%ln::', known))
     return set(c.node() for c in foreground)