ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: add pointer from error message to docs about stale working copy

This commit is contained in:
Martin von Zweigbergk 2023-05-25 07:59:16 -07:00 committed by Martin von Zweigbergk
parent fb17e6a50e
commit 5653827101
2 changed files with 6 additions and 1 deletions

View file

@ -1050,7 +1050,9 @@ impl WorkspaceCommandHelper {
"The working copy is stale (not updated since operation {}).",
short_operation_hash(&old_op_id)
),
"Run `jj workspace update-stale` to update it.",
"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.",
));
}
Err(StaleWorkingCopyError::SiblingOperation) => {

View file

@ -116,12 +116,14 @@ fn test_workspaces_conflicting_edits() {
insta::assert_snapshot!(stderr, @r###"
Error: The working copy is stale (not updated since operation 815bb8fcbd7a).
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 815bb8fcbd7a).
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.
"###);
let stdout = test_env.jj_cmd_success(&secondary_path, &["workspace", "update-stale"]);
// It was detected that the working copy is now stale.
@ -199,6 +201,7 @@ fn test_workspaces_updated_by_other() {
insta::assert_snapshot!(stderr, @r###"
Error: The working copy is stale (not updated since operation 815bb8fcbd7a).
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.
"###);
let stdout = test_env.jj_cmd_success(&secondary_path, &["workspace", "update-stale"]);
// It was detected that the working copy is now stale, but clean. So no