Skip to content

Commit

Permalink
cli: label working copies when writing commit summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
avamsi committed Sep 7, 2023
1 parent a422fd7 commit 5f06638
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,9 @@ See https://github.com/martinvonz/jj/blob/main/docs/working-copy.md#stale-workin
)?;
if Some(&new_commit) != maybe_old_commit {
ui.write("Working copy now at: ")?;
self.write_commit_summary(ui.stdout_formatter().as_mut(), &new_commit)?;
ui.stdout_formatter().with_label("working_copy", |fmt| {
self.write_commit_summary(fmt, &new_commit)
})?;
ui.write("\n")?;
for parent in new_commit.parents() {
// "Working copy now at: "
Expand Down
9 changes: 6 additions & 3 deletions cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,9 @@ fn cmd_status(
}

formatter.write_str("Working copy : ")?;
workspace_command.write_commit_summary(formatter, wc_commit)?;
formatter.with_label("working_copy", |fmt| {
workspace_command.write_commit_summary(fmt, wc_commit)
})?;
formatter.write_str("\n")?;
for parent in wc_commit.parents() {
formatter.write_str("Parent commit: ")?;
Expand Down Expand Up @@ -3822,8 +3824,9 @@ fn cmd_workspace_update_stale(
})?;
locked_wc.finish(repo.op_id().clone())?;
ui.write("Working copy now at: ")?;
workspace_command
.write_commit_summary(ui.stdout_formatter().as_mut(), &desired_wc_commit)?;
ui.stdout_formatter().with_label("working_copy", |fmt| {
workspace_command.write_commit_summary(fmt, &desired_wc_commit)
})?;
ui.write("\n")?;
print_checkout_stats(ui, stats)?;
}
Expand Down

0 comments on commit 5f06638

Please sign in to comment.