1824 |
1825 |
1825 return False |
1826 return False |
1826 |
1827 |
1827 return subset.filter(matches, condrepr=('<subrepo %r>', pat)) |
1828 return subset.filter(matches, condrepr=('<subrepo %r>', pat)) |
1828 |
1829 |
|
1830 def _mapbynodefunc(repo, s, f): |
|
1831 """(repo, smartset, [node] -> [node]) -> smartset |
|
1832 |
|
1833 Helper method to map a smartset to another smartset given a function only |
|
1834 talking about nodes. Handles converting between rev numbers and nodes, and |
|
1835 filtering. |
|
1836 """ |
|
1837 cl = repo.unfiltered().changelog |
|
1838 torev = cl.rev |
|
1839 tonode = cl.node |
|
1840 nodemap = cl.nodemap |
|
1841 result = set(torev(n) for n in f(tonode(r) for r in s) if n in nodemap) |
|
1842 return smartset.baseset(result - repo.changelog.filteredrevs) |
|
1843 |
|
1844 @predicate('successors(set)', safe=True) |
|
1845 def successors(repo, subset, x): |
|
1846 """All successors for set, including the given set themselves""" |
|
1847 s = getset(repo, fullreposet(repo), x) |
|
1848 f = lambda nodes: obsutil.allsuccessors(repo.obsstore, nodes) |
|
1849 d = _mapbynodefunc(repo, s, f) |
|
1850 return subset & d |
|
1851 |
1829 def _substringmatcher(pattern, casesensitive=True): |
1852 def _substringmatcher(pattern, casesensitive=True): |
1830 kind, pattern, matcher = util.stringmatcher(pattern, |
1853 kind, pattern, matcher = util.stringmatcher(pattern, |
1831 casesensitive=casesensitive) |
1854 casesensitive=casesensitive) |
1832 if kind == 'literal': |
1855 if kind == 'literal': |
1833 if not casesensitive: |
1856 if not casesensitive: |