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

Function print_cross_view_outcome

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

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

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