diff --git a/cli/tests/test_revset_output.rs b/cli/tests/test_revset_output.rs index 3d8260b95..03e4f3e3a 100644 --- a/cli/tests/test_revset_output.rs +++ b/cli/tests/test_revset_output.rs @@ -153,14 +153,14 @@ fn test_bad_function_call() { let stderr = test_env.jj_cmd_failure(&repo_path, &["log", "-r", r#"file(a, "../out")"#]); insta::assert_snapshot!(stderr.replace('\\', "/"), @r###" - Error: Failed to parse revset: Invalid file pattern + Error: Failed to parse revset: Function "file": Invalid file pattern Caused by: 1: --> 1:9 | 1 | file(a, "../out") | ^------^ | - = Invalid file pattern + = Function "file": Invalid file pattern 2: Path "../out" is not in the repo "." 3: Invalid component ".." in repo-relative path "../out" "###); diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 040553663..792412f95 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -178,8 +178,6 @@ pub enum RevsetParseErrorKind { }, #[error(r#"Function "{name}": {message}"#)] InvalidFunctionArguments { name: String, message: String }, - #[error("Invalid file pattern")] - FsPathParseError, #[error("Cannot resolve file pattern without workspace")] FsPathWithoutWorkspace, #[error(r#"Cannot resolve "@" without workspace"#)] @@ -1272,7 +1270,10 @@ static BUILTIN_FUNCTION_MAP: Lazy> = Lazy: let path = RepoPathBuf::parse_fs_path(ctx.cwd, ctx.workspace_root, needle) .map_err(|e| { RevsetParseError::with_span_and_source( - RevsetParseErrorKind::FsPathParseError, + RevsetParseErrorKind::InvalidFunctionArguments { + name: name.to_owned(), + message: "Invalid file pattern".to_owned(), + }, span, e, )