mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-24 06:19:42 +00:00
revset: ignore Present node when building backend expression
This will become safe as I'm going to add static check that the expression does never contain CommitRef(_)s. We could make Present(_) unconstructible, but the existence of Present node is harmless.
This commit is contained in:
parent
e6ea88aac0
commit
e83072b98f
1 changed files with 4 additions and 6 deletions
|
@ -2300,9 +2300,8 @@ impl VisibilityResolutionContext<'_> {
|
|||
self.resolve(expression1).into(),
|
||||
self.resolve(expression2).into(),
|
||||
),
|
||||
RevsetExpression::Present(_) => {
|
||||
panic!("Expression '{expression:?}' should have been resolved by caller");
|
||||
}
|
||||
// present(x) is noop if x doesn't contain any commit refs.
|
||||
RevsetExpression::Present(candidates) => self.resolve(candidates),
|
||||
RevsetExpression::NotIn(complement) => ResolvedExpression::Difference(
|
||||
self.resolve_all().into(),
|
||||
self.resolve(complement).into(),
|
||||
|
@ -2392,9 +2391,8 @@ impl VisibilityResolutionContext<'_> {
|
|||
RevsetExpression::Coalesce(_, _) => {
|
||||
ResolvedPredicateExpression::Set(self.resolve(expression).into())
|
||||
}
|
||||
RevsetExpression::Present(_) => {
|
||||
panic!("Expression '{expression:?}' should have been resolved by caller")
|
||||
}
|
||||
// present(x) is noop if x doesn't contain any commit refs.
|
||||
RevsetExpression::Present(candidates) => self.resolve_predicate(candidates),
|
||||
RevsetExpression::NotIn(complement) => {
|
||||
ResolvedPredicateExpression::NotIn(self.resolve_predicate(complement).into())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue