Skip to content

Commit

Permalink
cli: uncapitalize op description of "workspace add" and custom comman…
Browse files Browse the repository at this point in the history
…d example

That's our convention.
  • Loading branch information
yuja committed Jul 24, 2024
1 parent 94a4c7b commit 3f05d06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cli/examples/custom-command/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn run_custom_command(
.rewrite_commit(command_helper.settings(), &commit)
.set_description("Frobnicated!")
.write()?;
tx.finish(ui, "Frobnicate")?;
tx.finish(ui, "frobnicate")?;
writeln!(
ui.status(),
"Frobnicated revision: {}",
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ fn cmd_workspace_add(
tx.edit(&new_wc_commit)?;
tx.finish(
ui,
format!("Create initial working-copy commit in workspace {}", &name),
format!("create initial working-copy commit in workspace {name}"),
)?;
Ok(())
}
Expand Down
14 changes: 7 additions & 7 deletions cli/tests/test_workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,14 @@ fn test_workspaces_conflicting_edits() {
"###);
let stderr = test_env.jj_cmd_failure(&secondary_path, &["st"]);
insta::assert_snapshot!(stderr, @r###"
Error: The working copy is stale (not updated since operation f46ea702e886).
Error: The working copy is stale (not updated since operation 0da24da631e3).
Hint: Run `jj workspace update-stale` to update it.
See https://github.com/martinvonz/jj/blob/main/docs/working-copy.md#stale-working-copy for more information.
"###);
// Same error on second run, and from another command
let stderr = test_env.jj_cmd_failure(&secondary_path, &["log"]);
insta::assert_snapshot!(stderr, @r###"
Error: The working copy is stale (not updated since operation f46ea702e886).
Error: The working copy is stale (not updated since operation 0da24da631e3).
Hint: Run `jj workspace update-stale` to update it.
See https://github.com/martinvonz/jj/blob/main/docs/working-copy.md#stale-working-copy for more information.
"###);
Expand Down Expand Up @@ -420,7 +420,7 @@ fn test_workspaces_updated_by_other() {
"###);
let stderr = test_env.jj_cmd_failure(&secondary_path, &["st"]);
insta::assert_snapshot!(stderr, @r###"
Error: The working copy is stale (not updated since operation f46ea702e886).
Error: The working copy is stale (not updated since operation 0da24da631e3).
Hint: Run `jj workspace update-stale` to update it.
See https://github.com/martinvonz/jj/blob/main/docs/working-copy.md#stale-working-copy for more information.
"###);
Expand Down Expand Up @@ -491,8 +491,8 @@ fn test_workspaces_current_op_discarded_by_other() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ 8e5ea0fbda abandon commit 3540d386892997a2a927078635a2d933e37499fb8691938a2f540c25bccffd9e8a60b2d5a8cb94bb3eeab17e1c56f96aafa2bcb66fa1e4eb96911d093d7a579e
f336f5b6e8 Create initial working-copy commit in workspace secondary
@ 78e49a9ae1 abandon commit 3540d386892997a2a927078635a2d933e37499fb8691938a2f540c25bccffd9e8a60b2d5a8cb94bb3eeab17e1c56f96aafa2bcb66fa1e4eb96911d093d7a579e
083b1fe855 create initial working-copy commit in workspace secondary
○ aacb3bda7d add workspace 'secondary'
○ 46bcf7d75e new empty commit
○ 4d2f5d7cbf snapshot working copy
Expand Down Expand Up @@ -524,7 +524,7 @@ fn test_workspaces_current_op_discarded_by_other() {

let (stdout, stderr) = test_env.jj_cmd_ok(&secondary_path, &["workspace", "update-stale"]);
insta::assert_snapshot!(stderr, @r###"
Failed to read working copy's current operation; attempting recovery. Error message from read attempt: Object f336f5b6e83bb901dce6d05d83193f7d0cad2b6375a9910d586c844a479feb130c30d417bdf3030f980d9bacca117584a654e9bdf74b41b30021651e28fbfc8c of type operation not found
Failed to read working copy's current operation; attempting recovery. Error message from read attempt: Object 083b1fe855c23361b504fc78eb827aaa6099067d5ccba28b4e8cd89ed35d850be68ea557f03aaeaa37a09cc91b185c03c7ac638fff1fd8234b2e2a9cc62dc2cf of type operation not found
Created and checked out recovery commit 6803354995e6
"###);
insta::assert_snapshot!(stdout, @"");
Expand Down Expand Up @@ -728,7 +728,7 @@ fn test_workspaces_forget_multi_transaction() {
// the op log should have multiple workspaces forgotten in a single tx
let stdout = test_env.jj_cmd_success(&main_path, &["op", "log", "--limit", "1"]);
insta::assert_snapshot!(stdout, @r###"
@ f91852cb278f [email protected] 2001-02-03 04:05:12.000 +07:00 - 2001-02-03 04:05:12.000 +07:00
@ b7ab9f1c16cc [email protected] 2001-02-03 04:05:12.000 +07:00 - 2001-02-03 04:05:12.000 +07:00
│ forget workspaces second, third
│ args: jj workspace forget second third
"###);
Expand Down

0 comments on commit 3f05d06

Please sign in to comment.