Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 50393:386737600689
revset: add `_internal()` predicate
This predicate help core code to select internal changeset (in the internal
phase).
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 08 Mar 2023 11:00:30 +0100 |
parents | 92f71d40fc1d |
children | 18c8c18993f0 |
comparison
equal
deleted
inserted
replaced
50392:71a2c061865d | 50393:386737600689 |
---|---|
1965 def _phase(repo, subset, *targets): | 1965 def _phase(repo, subset, *targets): |
1966 """helper to select all rev in <targets> phases""" | 1966 """helper to select all rev in <targets> phases""" |
1967 return repo._phasecache.getrevset(repo, targets, subset) | 1967 return repo._phasecache.getrevset(repo, targets, subset) |
1968 | 1968 |
1969 | 1969 |
1970 @predicate(b'_internal()', safe=True) | |
1971 def _internal(repo, subset, x): | |
1972 getargs(x, 0, 0, _(b"_internal takes no arguments")) | |
1973 return _phase(repo, subset, *phases.all_internal_phases) | |
1974 | |
1975 | |
1970 @predicate(b'_phase(idx)', safe=True) | 1976 @predicate(b'_phase(idx)', safe=True) |
1971 def phase(repo, subset, x): | 1977 def phase(repo, subset, x): |
1972 l = getargs(x, 1, 1, b"_phase requires one argument") | 1978 l = getargs(x, 1, 1, b"_phase requires one argument") |
1973 target = getinteger(l[0], b"_phase expects a number") | 1979 target = getinteger(l[0], b"_phase expects a number") |
1974 return _phase(repo, subset, target) | 1980 return _phase(repo, subset, target) |