Patchwork D7334: index: use `index.has_node` in `obsutil.foreground`

login
register
mail settings
Submitter phabricator
Date Nov. 9, 2019, 8:40 a.m.
Message ID <990ed4ba2242da01d878d752acec8165@localhost.localdomain>
Download mbox | patch
Permalink /patch/43055/
State Not Applicable
Headers show

Comments

phabricator - Nov. 9, 2019, 8:40 a.m.
Closed by commit rHG30ca628dd32c: index: use `index.has_node` in `obsutil.foreground` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7334?vs=17757&id=17872

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7334/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7334

AFFECTED FILES
  mercurial/obsutil.py

CHANGE DETAILS




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

Patch

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