Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 43609:45d123d84011
index: use `index.get_rev` in `revset._mapbynodefunc`
We slightly update the code in the process.
Differential Revision: https://phab.mercurial-scm.org/D7343
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 09 Nov 2019 13:23:53 +0100 |
parents | 8ff1ecfadcd1 |
children | 61d7bca16dff |
comparison
equal
deleted
inserted
replaced
43608:65d6770273c8 | 43609:45d123d84011 |
---|---|
2404 Helper method to map a smartset to another smartset given a function only | 2404 Helper method to map a smartset to another smartset given a function only |
2405 talking about nodes. Handles converting between rev numbers and nodes, and | 2405 talking about nodes. Handles converting between rev numbers and nodes, and |
2406 filtering. | 2406 filtering. |
2407 """ | 2407 """ |
2408 cl = repo.unfiltered().changelog | 2408 cl = repo.unfiltered().changelog |
2409 torev = cl.rev | 2409 torev = cl.index.get_rev |
2410 tonode = cl.node | 2410 tonode = cl.node |
2411 nodemap = cl.nodemap | 2411 result = set(torev(n) for n in f(tonode(r) for r in s)) |
2412 result = set(torev(n) for n in f(tonode(r) for r in s) if n in nodemap) | 2412 result.discard(None) |
2413 return smartset.baseset(result - repo.changelog.filteredrevs) | 2413 return smartset.baseset(result - repo.changelog.filteredrevs) |
2414 | 2414 |
2415 | 2415 |
2416 @predicate(b'successors(set)', safe=True) | 2416 @predicate(b'successors(set)', safe=True) |
2417 def successors(repo, subset, x): | 2417 def successors(repo, subset, x): |