MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / print_conflict_summary

Function print_conflict_summary

atomic-cli/src/commands/insert.rs:686–714  ·  view source on GitHub ↗

After materializing the current view, list any conflicted files inline so the user does not have to run a second command to find them.

(repo: &Repository)

Source from the content-addressed store, hash-verified

684/// After materializing the current view, list any conflicted files inline so
685/// the user does not have to run a second command to find them.
686fn print_conflict_summary(repo: &Repository) {
687 let conflicts = match repo.list_conflicts() {
688 Ok(c) => c,
689 Err(_) => return,
690 };
691 if conflicts.is_empty() {
692 return;
693 }
694 println!();
695 let file_word = if conflicts.len() == 1 {
696 "file"
697 } else {
698 "files"
699 };
700 output::print_warning(&format!(
701 "{} conflicted {} — resolve markers, then record:",
702 conflicts.len(),
703 file_word
704 ));
705 for (path, records) in &conflicts {
706 let where_ = records
707 .first()
708 .and_then(|c| c.line)
709 .map(|l| format!(" (line {})", l))
710 .unwrap_or_default();
711 println!(" {}{}", path, where_);
712 }
713 output::print_hint("See 'atomic conflicts' for details.");
714}
715
716/// Print the outcome of a cross-view insert operation.
717fn print_cross_view_outcome(outcome: &CrossViewInsertOutcome, dry_run: bool) {

Callers 4

run_single_insertFunction · 0.85
run_view_insertFunction · 0.85
run_tagFunction · 0.85
run_change_insertFunction · 0.85

Calls 5

print_warningFunction · 0.85
print_hintFunction · 0.85
list_conflictsMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected