Patchwork D7343: index: use `index.get_rev` in `revset._mapbynodefunc`

login
register
mail settings
Submitter phabricator
Date Nov. 8, 2019, 4:26 p.m.
Message ID <differential-rev-PHID-DREV-qdligewzgokhmfgjlu3z-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42949/
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.

REVISION SUMMARY
  We slightly update the code in the process.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/revset.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2406,10 +2406,10 @@ 
     filtering.
     """
     cl = repo.unfiltered().changelog
-    torev = cl.rev
+    torev = cl.index.get_rev
     tonode = cl.node
-    nodemap = cl.nodemap
-    result = set(torev(n) for n in f(tonode(r) for r in s) if n in nodemap)
+    result = set(torev(n) for n in f(tonode(r) for r in s))
+    result.discard(None)
     return smartset.baseset(result - repo.changelog.filteredrevs)