From 56538271019d09277e8a0ce499e99ac0dd954f9e Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Thu, 25 May 2023 07:59:16 -0700 Subject: [PATCH] cli: add pointer from error message to docs about stale working copy --- src/cli_util.rs | 4 +++- tests/test_workspaces.rs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cli_util.rs b/src/cli_util.rs index 8da20b04f..461216330 100644 --- a/src/cli_util.rs +++ b/src/cli_util.rs @@ -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) => { diff --git a/tests/test_workspaces.rs b/tests/test_workspaces.rs index b1cc97d83..74193994a 100644 --- a/tests/test_workspaces.rs +++ b/tests/test_workspaces.rs @@ -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