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

Function print_cross_view_outcome

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

Print the outcome of a cross-view insert operation.

(outcome: &CrossViewInsertOutcome, dry_run: bool)

Source from the content-addressed store, hash-verified

535
536/// Print the outcome of a cross-view insert operation.
537fn print_cross_view_outcome(outcome: &CrossViewInsertOutcome, dry_run: bool) {
538 println!();
539
540 if dry_run {
541 if outcome.applied_hashes.is_empty() {
542 output::print_info("Dry run: No changes would be inserted.");
543 } else {
544 output::print_info(&format!(
545 "Dry run: {} change(s) would be inserted",
546 outcome.applied_hashes.len()
547 ));
548
549 println!();
550 println!("Changes:");
551 for hash in &outcome.applied_hashes {
552 println!(" {}", format_hash(hash, true));
553 }
554 }
555 return;
556 }
557
558 if outcome.changes_applied == 0 {
559 output::print_success("No changes to insert - already up to date.");
560 } else {
561 output::print_success(&format!("Inserted {} change(s)", outcome.changes_applied));
562 println!(" New state: {}", outcome.new_state.to_base32());
563
564 if !outcome.skipped_hashes.is_empty() {
565 println!(
566 " Skipped: {} (already inserted)",
567 outcome.skipped_hashes.len()
568 );
569 }
570 }
571
572 if outcome.has_conflicts {
573 println!();
574 output::print_warning("Conflicts detected. Run 'atomic status' to see details.");
575 }
576}
577
578// Tests
579

Callers 3

run_from_viewFunction · 0.85
run_tagFunction · 0.85
run_pickFunction · 0.85

Calls 4

print_infoFunction · 0.85
print_successFunction · 0.85
print_warningFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected