After materializing the current view, list any conflicted files inline so the user does not have to run a second command to find them.
(repo: &Repository)
| 684 | /// After materializing the current view, list any conflicted files inline so |
| 685 | /// the user does not have to run a second command to find them. |
| 686 | fn print_conflict_summary(repo: &Repository) { |
| 687 | let conflicts = match repo.list_conflicts() { |
| 688 | Ok(c) => c, |
| 689 | Err(_) => return, |
| 690 | }; |
| 691 | if conflicts.is_empty() { |
| 692 | return; |
| 693 | } |
| 694 | println!(); |
| 695 | let file_word = if conflicts.len() == 1 { |
| 696 | "file" |
| 697 | } else { |
| 698 | "files" |
| 699 | }; |
| 700 | output::print_warning(&format!( |
| 701 | "{} conflicted {} — resolve markers, then record:", |
| 702 | conflicts.len(), |
| 703 | file_word |
| 704 | )); |
| 705 | for (path, records) in &conflicts { |
| 706 | let where_ = records |
| 707 | .first() |
| 708 | .and_then(|c| c.line) |
| 709 | .map(|l| format!(" (line {})", l)) |
| 710 | .unwrap_or_default(); |
| 711 | println!(" {}{}", path, where_); |
| 712 | } |
| 713 | output::print_hint("See 'atomic conflicts' for details."); |
| 714 | } |
| 715 | |
| 716 | /// Print the outcome of a cross-view insert operation. |
| 717 | fn print_cross_view_outcome(outcome: &CrossViewInsertOutcome, dry_run: bool) { |
no test coverage detected