We slightly update the code in the process.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
We slightly update the code in the process.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/revset.py (6 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute |
def _mapbynodefunc(repo, s, f): | def _mapbynodefunc(repo, s, f): | ||||
"""(repo, smartset, [node] -> [node]) -> smartset | """(repo, smartset, [node] -> [node]) -> smartset | ||||
Helper method to map a smartset to another smartset given a function only | Helper method to map a smartset to another smartset given a function only | ||||
talking about nodes. Handles converting between rev numbers and nodes, and | talking about nodes. Handles converting between rev numbers and nodes, and | ||||
filtering. | filtering. | ||||
""" | """ | ||||
cl = repo.unfiltered().changelog | cl = repo.unfiltered().changelog | ||||
torev = cl.rev | torev = cl.index.get_rev | ||||
tonode = cl.node | tonode = cl.node | ||||
nodemap = cl.nodemap | result = set(torev(n) for n in f(tonode(r) for r in s)) | ||||
result = set(torev(n) for n in f(tonode(r) for r in s) if n in nodemap) | result.discard(None) | ||||
return smartset.baseset(result - repo.changelog.filteredrevs) | return smartset.baseset(result - repo.changelog.filteredrevs) | ||||
@predicate(b'successors(set)', safe=True) | @predicate(b'successors(set)', safe=True) | ||||
def successors(repo, subset, x): | def successors(repo, subset, x): | ||||
"""All successors for set, including the given set themselves""" | """All successors for set, including the given set themselves""" | ||||
s = getset(repo, fullreposet(repo), x) | s = getset(repo, fullreposet(repo), x) | ||||
f = lambda nodes: obsutil.allsuccessors(repo.obsstore, nodes) | f = lambda nodes: obsutil.allsuccessors(repo.obsstore, nodes) |