(parsed: &ParsedCommit, line_index: &ImportLineIndex)
| 778 | } |
| 779 | |
| 780 | fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String { |
| 781 | let mut entries: Vec<(usize, String)> = parsed |
| 782 | .files |
| 783 | .iter() |
| 784 | .map(|file| { |
| 785 | let (current_lines, indexed_lines, imported_commits) = |
| 786 | import_shape_for_file(file, line_index); |
| 787 | let bytes = file |
| 788 | .new_content |
| 789 | .as_ref() |
| 790 | .or(file.old_content.as_ref()) |
| 791 | .map(|content| content.len()) |
| 792 | .unwrap_or(0); |
| 793 | let weight = current_lines |
| 794 | .saturating_mul(imported_commits.max(1)) |
| 795 | .saturating_add(indexed_lines); |
| 796 | ( |
| 797 | weight, |
| 798 | format!( |
| 799 | "{} op={:?} lines={} indexed_lines={} file_commits={} bytes={}", |
| 800 | file.path, |
| 801 | file.operation, |
| 802 | current_lines, |
| 803 | indexed_lines, |
| 804 | imported_commits, |
| 805 | bytes |
| 806 | ), |
| 807 | ) |
| 808 | }) |
| 809 | .collect(); |
| 810 | entries.sort_by_key(|entry| std::cmp::Reverse(entry.0)); |
| 811 | entries |
| 812 | .into_iter() |
| 813 | .take(3) |
| 814 | .map(|(_, entry)| entry) |
| 815 | .collect::<Vec<_>>() |
| 816 | .join("; ") |
| 817 | } |
| 818 | |
| 819 | fn graph_first_skip_summary(skips: &[GraphFirstSkip], parsed: &ParsedCommit) -> String { |
| 820 | if skips.is_empty() { |
no test coverage detected