forked from mirrors/jj
cli: include root() in the heads node of the immutable set expression
It helps to optimize '~immutable()' to '(immutable_heads() | root())..'.
This commit is contained in:
parent
50363419fb
commit
f46b738f6e
1 changed files with 4 additions and 4 deletions
|
@ -120,10 +120,10 @@ pub fn parse_immutable_expression(
|
||||||
params.is_empty(),
|
params.is_empty(),
|
||||||
"invalid declaration should have been rejected by load_revset_aliases()"
|
"invalid declaration should have been rejected by load_revset_aliases()"
|
||||||
);
|
);
|
||||||
let immutable_heads_revset = revset::parse(immutable_heads_str, context)?;
|
// Negated ancestors expression `~::(<heads> | root())` is slightly easier
|
||||||
Ok(immutable_heads_revset
|
// to optimize than negated union `~(::<heads> | root())`.
|
||||||
.ancestors()
|
let heads = revset::parse(immutable_heads_str, context)?;
|
||||||
.union(&RevsetExpression::root()))
|
Ok(heads.union(&RevsetExpression::root()).ancestors())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn format_parse_error(err: &RevsetParseError) -> String {
|
pub fn format_parse_error(err: &RevsetParseError) -> String {
|
||||||
|
|
Loading…
Reference in a new issue