From c1d934a08a04ec9a5701e3d6f3faff4edf3d447c Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 7 May 2024 10:43:20 +0900 Subject: [PATCH] cli: status: evaluate conflicts revset as a user expression Otherwise, it would panic if immutable_heads() contained unresolved symbols. --- cli/src/commands/status.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cli/src/commands/status.rs b/cli/src/commands/status.rs index d469aa75e..28d305e0d 100644 --- a/cli/src/commands/status.rs +++ b/cli/src/commands/status.rs @@ -95,14 +95,16 @@ pub(crate) fn cmd_status( let wc_revset = RevsetExpression::commit(wc_commit.id().clone()); // Ancestors with conflicts, excluding the current working copy commit. - let ancestors_conflicts = RevsetExpression::filter(RevsetFilterPredicate::HasConflict) - .intersection(&wc_revset.ancestors()) - .minus(&wc_revset) - .minus(&revset_util::parse_immutable_expression( - &workspace_command.revset_parse_context(), - )?) - .evaluate_programmatic(repo.as_ref())? - .iter() + let ancestors_conflicts = workspace_command + .attach_revset_evaluator( + RevsetExpression::filter(RevsetFilterPredicate::HasConflict) + .intersection(&wc_revset.ancestors()) + .minus(&wc_revset) + .minus(&revset_util::parse_immutable_expression( + &workspace_command.revset_parse_context(), + )?), + )? + .evaluate_to_commit_ids()? .collect(); workspace_command.report_repo_conflicts(formatter, repo, ancestors_conflicts)?; } else {