revset: remove deprecated singular aliases

This commit is contained in:
Yuya Nishihara 2025-03-07 20:21:28 +09:00
parent 54868877d6
commit bf54158fa2
2 changed files with 2 additions and 19 deletions

View File

@ -25,6 +25,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* The following deprecated revset functions have been removed:
- `branches()`, `remote_branches()`, `tracked_remote_branches()`, and
`untracked_remote_branches()`, which were renamed to "bookmarks".
- `file()` and `conflict()`, which were renamed to plural forms.
* The following deprecated template functions have been removed:
- `branches()`, `local_branches()`, and `remote_branches()`, which were

View File

@ -871,13 +871,6 @@ static BUILTIN_FUNCTION_MAP: Lazy<HashMap<&'static str, RevsetFunction>> = Lazy:
Ok(RevsetExpression::is_empty())
});
map.insert("files", |diagnostics, function, context| {
// TODO: Remove in jj 0.28+
if function.name != "files" {
diagnostics.add_warning(RevsetParseError::expression(
"file() is deprecated; use files() instead",
function.name_span,
));
}
let ctx = context.workspace.as_ref().ok_or_else(|| {
RevsetParseError::with_span(
RevsetParseErrorKind::FsPathWithoutWorkspace,
@ -898,8 +891,6 @@ static BUILTIN_FUNCTION_MAP: Lazy<HashMap<&'static str, RevsetFunction>> = Lazy:
let expr = FilesetExpression::union_all(file_expressions);
Ok(RevsetExpression::filter(RevsetFilterPredicate::File(expr)))
});
// TODO: Remove in jj 0.28+
map.insert("file", map["files"]);
map.insert("diff_contains", |diagnostics, function, context| {
let ([text_arg], [files_opt_arg]) = function.expect_arguments()?;
let text = expect_string_pattern(diagnostics, text_arg)?;
@ -920,19 +911,10 @@ static BUILTIN_FUNCTION_MAP: Lazy<HashMap<&'static str, RevsetFunction>> = Lazy:
RevsetFilterPredicate::DiffContains { text, files },
))
});
map.insert("conflicts", |diagnostics, function, _context| {
// TODO: Remove in jj 0.28+
if function.name != "conflicts" {
diagnostics.add_warning(RevsetParseError::expression(
"conflict() is deprecated; use conflicts() instead",
function.name_span,
));
}
map.insert("conflicts", |_diagnostics, function, _context| {
function.expect_no_arguments()?;
Ok(RevsetExpression::filter(RevsetFilterPredicate::HasConflict))
});
// TODO: Remove in jj 0.28+
map.insert("conflict", map["conflicts"]);
map.insert("present", |diagnostics, function, context| {
let [arg] = function.expect_exact_arguments()?;
let expression = lower_expression(diagnostics, arg, context)?;