ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: status: evaluate conflicts revset as a user expression

Otherwise, it would panic if immutable_heads() contained unresolved symbols.
This commit is contained in:
Yuya Nishihara 2024-05-07 10:43:20 +09:00
parent 76b6d031d7
commit c1d934a08a

View file

@ -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 {