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

Function print_cross_view_outcome

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

679
680/// Print the outcome of a cross-view insert operation.
681fn print_cross_view_outcome(outcome: &CrossViewInsertOutcome, dry_run: bool) {
682 println!();
683
684 if dry_run {
685 if outcome.applied_hashes.is_empty() {
686 output::print_info("Dry run: No changes would be inserted.");
687 } else {
688 output::print_info(&format!(
689 "Dry run: {} change(s) would be inserted",
690 outcome.applied_hashes.len()
691 ));
692
693 println!();
694 println!("Changes:");
695 for hash in &outcome.applied_hashes {
696 println!(" {}", format_hash(hash, true));
697 }
698 }
699 return;
700 }
701
702 if outcome.changes_applied == 0 {
703 output::print_success("No changes to insert - already up to date.");
704 } else {
705 output::print_success(&format!("Inserted {} change(s)", outcome.changes_applied));
706 println!(" New state: {}", outcome.new_state.to_base32());
707
708 if !outcome.skipped_hashes.is_empty() {
709 println!(
710 " Skipped: {} (already inserted)",
711 outcome.skipped_hashes.len()
712 );
713 }
714 }
715
716 if outcome.has_conflicts {
717 println!();
718 output::print_warning("Conflicts detected. Run 'atomic status' to see details.");
719 }
720}
721
722// Tests
723

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