revset: remove None variant from resolved enum, use Commits([]) instead

We'll remove All, so it makes sense to not have None either.
This commit is contained in:
Yuya Nishihara 2023-04-06 16:38:14 +09:00
parent 0fcc13a6f4
commit 7974269bab
2 changed files with 1 additions and 3 deletions

View File

@ -574,7 +574,6 @@ impl<'index, 'heads> EvaluationContext<'index, 'heads> {
expression: &ResolvedExpression,
) -> Result<Box<dyn InternalRevset<'index> + 'index>, RevsetEvaluationError> {
match expression {
ResolvedExpression::None => Ok(Box::new(EagerRevset::empty())),
ResolvedExpression::All => {
// Since `all()` does not include hidden commits, some of the logical
// transformation rules may subtly change the evaluated set. For example,

View File

@ -460,7 +460,6 @@ pub enum ResolvedPredicateExpression {
/// Use `RevsetExpression` API to build a query programmatically.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ResolvedExpression {
None,
All, // TODO: should be substituted at resolve_visibility()
Commits(Vec<CommitId>),
Children(Box<ResolvedExpression>), // TODO: add heads: VisibleHeads
@ -1816,7 +1815,7 @@ impl VisibilityResolutionContext {
/// Resolves expression tree as set.
fn resolve(&self, expression: &RevsetExpression) -> ResolvedExpression {
match expression {
RevsetExpression::None => ResolvedExpression::None,
RevsetExpression::None => ResolvedExpression::Commits(vec![]),
RevsetExpression::All => self.resolve_all(),
RevsetExpression::Commits(commit_ids) => {
ResolvedExpression::Commits(commit_ids.clone())