Print the outcome of a cross-view insert operation.
(outcome: &CrossViewInsertOutcome, dry_run: bool)
| 823 | |
| 824 | /// Print the outcome of a cross-view insert operation. |
| 825 | pub(crate) fn print_cross_view_outcome(outcome: &CrossViewInsertOutcome, dry_run: bool) { |
| 826 | if let Some(review) = &outcome.review_approval { |
| 827 | print_review_approval(review); |
| 828 | } |
| 829 | println!(); |
| 830 | |
| 831 | if dry_run { |
| 832 | if outcome.applied_hashes.is_empty() { |
| 833 | output::print_info("Dry run: No changes would be inserted."); |
| 834 | } else { |
| 835 | output::print_info(&format!( |
| 836 | "Dry run: {} change(s) would be inserted", |
| 837 | outcome.applied_hashes.len() |
| 838 | )); |
| 839 | |
| 840 | println!(); |
| 841 | println!("Changes:"); |
| 842 | for hash in &outcome.applied_hashes { |
| 843 | println!(" {}", format_hash(hash, true)); |
| 844 | } |
| 845 | } |
| 846 | return; |
| 847 | } |
| 848 | |
| 849 | if outcome.changes_applied == 0 { |
| 850 | output::print_success("No changes to insert - already up to date."); |
| 851 | } else { |
| 852 | output::print_success(&format!("Inserted {} change(s)", outcome.changes_applied)); |
| 853 | println!(" New state: {}", outcome.new_state.to_base32()); |
| 854 | |
| 855 | if !outcome.skipped_hashes.is_empty() { |
| 856 | println!( |
| 857 | " Skipped: {} (already inserted)", |
| 858 | outcome.skipped_hashes.len() |
| 859 | ); |
| 860 | } |
| 861 | } |
| 862 | |
| 863 | if let Some(review) = &outcome.review_decision { |
| 864 | output::print_warning(&format!("Attested review {} · evidence readiness {:?} · user disposition {:?} · {} explicitly accepted degradation(s). Report {}. This is not a clean-code or independent-approval claim.",review.decision,review.readiness,review.disposition,review.accepted_degradations,review.report_hash)); |
| 865 | } |
| 866 | |
| 867 | if outcome.has_conflicts { |
| 868 | println!(); |
| 869 | output::print_warning("Conflicts detected. Run 'atomic conflicts' to see details."); |
| 870 | } |
| 871 | } |
| 872 | |
| 873 | pub(crate) fn print_review_approval(review: &atomic_repository::NativeReviewEvidence) { |
| 874 | output::print_info(&format!( |
no test coverage detected