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