Skip to content

Commit

Permalink
diff_util: add copy records tracking to DiffRenderer::show_patch
Browse files Browse the repository at this point in the history
This allow `jj show --summary` and other commands to include copy
tracking information.
  • Loading branch information
bnjmnt4n committed Aug 13, 2024
1 parent 38f6ee8 commit c2c89ad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cli/src/diff_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,21 @@ impl<'a> DiffRenderer<'a> {
) -> Result<(), DiffRenderError> {
let from_tree = commit.parent_tree(self.repo)?;
let to_tree = commit.tree()?;
let mut copy_records = CopyRecords::default();
for parent_id in commit.parent_ids() {
copy_records.add_records(self.repo.store().get_copy_records(
None,
parent_id,
commit.id(),
)?)?;
}
self.show_diff(
ui,
formatter,
&from_tree,
&to_tree,
matcher,
&Default::default(),
&copy_records,
width,
)
}
Expand Down

0 comments on commit c2c89ad

Please sign in to comment.