mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-11 02:12:51 +00:00
revset: remove deprecated singular aliases
This commit is contained in:
parent
54868877d6
commit
bf54158fa2
@ -25,6 +25,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
* The following deprecated revset functions have been removed:
|
* The following deprecated revset functions have been removed:
|
||||||
- `branches()`, `remote_branches()`, `tracked_remote_branches()`, and
|
- `branches()`, `remote_branches()`, `tracked_remote_branches()`, and
|
||||||
`untracked_remote_branches()`, which were renamed to "bookmarks".
|
`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:
|
* The following deprecated template functions have been removed:
|
||||||
- `branches()`, `local_branches()`, and `remote_branches()`, which were
|
- `branches()`, `local_branches()`, and `remote_branches()`, which were
|
||||||
|
@ -871,13 +871,6 @@ static BUILTIN_FUNCTION_MAP: Lazy<HashMap<&'static str, RevsetFunction>> = Lazy:
|
|||||||
Ok(RevsetExpression::is_empty())
|
Ok(RevsetExpression::is_empty())
|
||||||
});
|
});
|
||||||
map.insert("files", |diagnostics, function, context| {
|
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(|| {
|
let ctx = context.workspace.as_ref().ok_or_else(|| {
|
||||||
RevsetParseError::with_span(
|
RevsetParseError::with_span(
|
||||||
RevsetParseErrorKind::FsPathWithoutWorkspace,
|
RevsetParseErrorKind::FsPathWithoutWorkspace,
|
||||||
@ -898,8 +891,6 @@ static BUILTIN_FUNCTION_MAP: Lazy<HashMap<&'static str, RevsetFunction>> = Lazy:
|
|||||||
let expr = FilesetExpression::union_all(file_expressions);
|
let expr = FilesetExpression::union_all(file_expressions);
|
||||||
Ok(RevsetExpression::filter(RevsetFilterPredicate::File(expr)))
|
Ok(RevsetExpression::filter(RevsetFilterPredicate::File(expr)))
|
||||||
});
|
});
|
||||||
// TODO: Remove in jj 0.28+
|
|
||||||
map.insert("file", map["files"]);
|
|
||||||
map.insert("diff_contains", |diagnostics, function, context| {
|
map.insert("diff_contains", |diagnostics, function, context| {
|
||||||
let ([text_arg], [files_opt_arg]) = function.expect_arguments()?;
|
let ([text_arg], [files_opt_arg]) = function.expect_arguments()?;
|
||||||
let text = expect_string_pattern(diagnostics, text_arg)?;
|
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 },
|
RevsetFilterPredicate::DiffContains { text, files },
|
||||||
))
|
))
|
||||||
});
|
});
|
||||||
map.insert("conflicts", |diagnostics, function, _context| {
|
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,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
function.expect_no_arguments()?;
|
function.expect_no_arguments()?;
|
||||||
Ok(RevsetExpression::filter(RevsetFilterPredicate::HasConflict))
|
Ok(RevsetExpression::filter(RevsetFilterPredicate::HasConflict))
|
||||||
});
|
});
|
||||||
// TODO: Remove in jj 0.28+
|
|
||||||
map.insert("conflict", map["conflicts"]);
|
|
||||||
map.insert("present", |diagnostics, function, context| {
|
map.insert("present", |diagnostics, function, context| {
|
||||||
let [arg] = function.expect_exact_arguments()?;
|
let [arg] = function.expect_exact_arguments()?;
|
||||||
let expression = lower_expression(diagnostics, arg, context)?;
|
let expression = lower_expression(diagnostics, arg, context)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user