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

Function print_cross_view_outcome

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

810
811/// Print the outcome of a cross-view insert operation.
812pub(crate) fn print_cross_view_outcome(outcome: &CrossViewInsertOutcome, dry_run: bool) {
813 println!();
814
815 if dry_run {
816 if outcome.applied_hashes.is_empty() {
817 output::print_info("Dry run: No changes would be inserted.");
818 } else {
819 output::print_info(&format!(
820 "Dry run: {} change(s) would be inserted",
821 outcome.applied_hashes.len()
822 ));
823
824 println!();
825 println!("Changes:");
826 for hash in &outcome.applied_hashes {
827 println!(" {}", format_hash(hash, true));
828 }
829 }
830 return;
831 }
832
833 if outcome.changes_applied == 0 {
834 output::print_success("No changes to insert - already up to date.");
835 } else {
836 output::print_success(&format!("Inserted {} change(s)", outcome.changes_applied));
837 println!(" New state: {}", outcome.new_state.to_base32());
838
839 if !outcome.skipped_hashes.is_empty() {
840 println!(
841 " Skipped: {} (already inserted)",
842 outcome.skipped_hashes.len()
843 );
844 }
845 }
846
847 if outcome.has_conflicts {
848 println!();
849 output::print_warning("Conflicts detected. Run 'atomic conflicts' to see details.");
850 }
851}
852
853// Tests
854

Callers 8

insert_from_viewFunction · 0.85
insert_up_to_tagFunction · 0.85
insert_changesFunction · 0.85
insert_promoteFunction · 0.85
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