mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-25 05:29:39 +00:00
cli: print "Added X files, modified Y files, removed Z files" on all updates
I was confused myself why the message was only printed by `jj co` and not e.g. `jj undo`. That probably means that it should always be printed (or never be printed).
This commit is contained in:
parent
6c0f3625ff
commit
83c051984e
1 changed files with 11 additions and 8 deletions
|
@ -427,7 +427,15 @@ impl RepoCommandHelper {
|
|||
}
|
||||
}
|
||||
self.repo = tx.commit();
|
||||
update_working_copy(ui, &self.repo, &mut self.repo.working_copy_locked())
|
||||
let stats = update_working_copy(ui, &self.repo, &mut self.repo.working_copy_locked())?;
|
||||
if let Some(stats) = &stats {
|
||||
writeln!(
|
||||
ui,
|
||||
"Added {} files, modified {} files, removed {} files",
|
||||
stats.added_files, stats.updated_files, stats.removed_files
|
||||
)?;
|
||||
}
|
||||
Ok(stats)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1383,13 +1391,8 @@ fn cmd_checkout(
|
|||
repo_command.start_transaction(&format!("check out commit {}", new_commit.id().hex()));
|
||||
tx.mut_repo().check_out(ui.settings(), &new_commit);
|
||||
let stats = repo_command.finish_transaction(ui, tx)?;
|
||||
match stats {
|
||||
None => ui.write("Already on that commit\n")?,
|
||||
Some(stats) => writeln!(
|
||||
ui,
|
||||
"Added {} files, modified {} files, removed {} files",
|
||||
stats.added_files, stats.updated_files, stats.removed_files
|
||||
)?,
|
||||
if stats.is_none() {
|
||||
ui.write("Already on that commit\n")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue