Print the outcome of a cross-view insert operation.
(outcome: &CrossViewInsertOutcome, dry_run: bool)
| 715 | |
| 716 | /// Print the outcome of a cross-view insert operation. |
| 717 | fn 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 |
no test coverage detected