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

Function print_cross_view_outcome

atomic-cli/src/commands/insert.rs:707–746  ·  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

705
706/// Print the outcome of a cross-view insert operation.
707fn print_cross_view_outcome(outcome: &CrossViewInsertOutcome, dry_run: bool) {
708 println!();
709
710 if dry_run {
711 if outcome.applied_hashes.is_empty() {
712 output::print_info("Dry run: No changes would be inserted.");
713 } else {
714 output::print_info(&format!(
715 "Dry run: {} change(s) would be inserted",
716 outcome.applied_hashes.len()
717 ));
718
719 println!();
720 println!("Changes:");
721 for hash in &outcome.applied_hashes {
722 println!(" {}", format_hash(hash, true));
723 }
724 }
725 return;
726 }
727
728 if outcome.changes_applied == 0 {
729 output::print_success("No changes to insert - already up to date.");
730 } else {
731 output::print_success(&format!("Inserted {} change(s)", outcome.changes_applied));
732 println!(" New state: {}", outcome.new_state.to_base32());
733
734 if !outcome.skipped_hashes.is_empty() {
735 println!(
736 " Skipped: {} (already inserted)",
737 outcome.skipped_hashes.len()
738 );
739 }
740 }
741
742 if outcome.has_conflicts {
743 println!();
744 output::print_warning("Conflicts detected. Run 'atomic conflicts' to see details.");
745 }
746}
747
748// Tests
749

Callers 4

run_promote_to_parentFunction · 0.85
run_view_insertFunction · 0.85
run_tagFunction · 0.85
run_change_insertFunction · 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