Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace --allow-large-revsets by all: prefix #1911

Merged
merged 4 commits into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* The storage format of branches, tags, and git refs has changed. Newly-stored
repository data will no longer be loadable by older binaries.

* The `:` revset operator is deprecated. Use `::` instead. We plan to delete the
`:` form in jj 0.15+.

* The `--allow-large-revsets` flag for `jj rebase` and `jj new` was replaced by
a `all:` before the revset. For example, use `jj rebase -d 'all:foo-'`
instead of `jj rebase --allow-large-revsets -d 'foo-'`.

* The `--allow-large-revsets` flag for `jj rebase` and `jj new` can no longer be
martinvonz marked this conversation as resolved.
Show resolved Hide resolved
used for allowing duplicate destinations. Include the potential duplicates
in a single expression instead (e.g. `jj new 'all:x|y'`).

### New features

* `jj config edit --user` and `jj config set --user` will now pick a default
Expand Down
4 changes: 2 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ To get shorter prefixes for certain revisions, set `revsets.short-prefixes`:

```toml
# Prioritize the current branch
revsets.short-prefixes = "(main..@):"
revsets.short-prefixes = "(main..@)::"
```

### Relative timestamps
Expand Down Expand Up @@ -259,7 +259,7 @@ You can define aliases for commands, including their arguments. For example:
```toml
# `jj l` shows commits on the working-copy commit's (anonymous) branch
# compared to the `main` branch
aliases.l = ["log", "-r", "(main..@): | (main..@)-"]
aliases.l = ["log", "-r", "(main..@):: | (main..@)-"]
```

## Editor
Expand Down
2 changes: 1 addition & 1 deletion docs/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ remote
Log all remote branches, which you authored or committed to
`jj log -r 'remote_branches() & (committer([email protected]) | author([email protected]))'`
Log all descendants of the current working copy, which aren't on a remote
`jj log -r ':@ & ~remote_branches()'`
`jj log -r '::@ & ~remote_branches()'`

## Merge conflicts

Expand Down
25 changes: 14 additions & 11 deletions docs/revsets.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ only symbols.
* `~x`: Revisions that are not in `x`.
* `x-`: Parents of `x`.
* `x+`: Children of `x`.
* `:x`: Ancestors of `x`, including the commits in `x` itself.
* `x:`: Descendants of `x`, including the commits in `x` itself.
* `x:y`: Descendants of `x` that are also ancestors of `y`. Equivalent to
`x: & :y`. This is what `git log` calls `--ancestry-path x..y`.
* `::x`: Ancestors of `x`, including the commits in `x` itself.
* `x::`: Descendants of `x`, including the commits in `x` itself.
* `x::y`: Descendants of `x` that are also ancestors of `y`. Equivalent
to `x:: & ::y`. This is what `git log` calls `--ancestry-path x..y`.
* `:x`, `x:`, and `x:y`: Deprecated synonyms for `::x`, `x::`, and `x::y`. We
plan to delete them in jj 0.15+.
* `x..y`: Ancestors of `y` that are not also ancestors of `x`. Equivalent to
`:y ~ :x`. This is what `git log` calls `x..y` (i.e. the same as we call it).
`::y ~ ::x`. This is what `git log` calls `x..y` (i.e. the same as we call it).
* `..x`: Ancestors of `x`, including the commits in `x` itself. Equivalent to
`:x` and provided for consistency.
`::x` and provided for consistency.
* `x..`: Revisions that are not ancestors of `x`.

You can use parentheses to control evaluation order, such as `(x & y) | z` or
Expand All @@ -78,9 +80,9 @@ revsets (expressions) as arguments.

* `parents(x)`: Same as `x-`.
* `children(x)`: Same as `x+`.
* `ancestors(x)`: Same as `:x`.
* `descendants(x)`: Same as `x:`.
* `connected(x)`: Same as `x:x`. Useful when `x` includes several commits.
* `ancestors(x)`: Same as `::x`.
* `descendants(x)`: Same as `x::`.
* `connected(x)`: Same as `x::x`. Useful when `x` includes several commits.
* `all()`: All visible commits in the repo.
* `none()`: No commits. This function is rarely useful; it is provided for
completeness.
Expand Down Expand Up @@ -169,7 +171,7 @@ jj log -r 'remote_branches(remote=origin)..'
Show all ancestors of the working copy (almost like plain `git log`)

```
jj log -r :@
jj log -r ::@
```

Show the initial commits in the repo (the ones Git calls "root commits"):
Expand All @@ -187,8 +189,9 @@ jj log -r 'tags() | branches()'
Show local commits leading up to the working copy, as well as descendants of
those commits:


```
jj log -r '(remote_branches()..@):'
jj log -r '(remote_branches()..@)::'
```

Show commits authored by "martinvonz" and containing the word "reset" in the
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ called the "root commit". It's the root commit of every repo. The `root` symbol
in the revset matches it.

There are also operators for getting the parents (`foo-`), children (`foo+`),
ancestors (`:foo`), descendants (`foo:`), DAG range (`foo:bar`, like
ancestors (`::foo`), descendants (`foo::`), DAG range (`foo::bar`, like
`git log --ancestry-path`), range (`foo..bar`, same as Git's). There are also a
few more functions, such as `heads(<set>)`, which filters out revisions in the
input set if they're ancestors of other revisions in the set.
Expand Down Expand Up @@ -345,7 +345,7 @@ $ jj new -m ABC; printf 'A\nB\nc\n' > file
Working copy now at: 6f30cd1fb351 ABC
$ jj new -m ABCD; printf 'A\nB\nC\nD\n' > file
Working copy now at: a67491542e10 ABCD
$ jj log -r master:@
$ jj log -r master::@
@ mrxqplykzpkw [email protected] 2023-02-12 19:38:21.000 -08:00 b98c607bf87f
│ ABCD
◉ kwtuwqnmqyqp [email protected] 2023-02-12 19:38:12.000 -08:00 30aecc0871ea
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-command/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn run_custom_command(
match command {
CustomCommands::Frobnicate(args) => {
let mut workspace_command = command_helper.workspace_helper(ui)?;
let commit = workspace_command.resolve_single_rev(&args.revision)?;
let commit = workspace_command.resolve_single_rev(&args.revision, ui)?;
let mut tx = workspace_command.start_transaction("Frobnicate");
let new_commit = tx
.mut_repo()
Expand Down
2 changes: 1 addition & 1 deletion lib/src/default_index_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,7 @@ mod tests {
);

// Merge range with sub-range (1..4 + 2..3 should be 1..4, not 1..3):
// 8,7,6->5:1..4, B5_1->5:2..3
// 8,7,6->5::1..4, B5_1->5::2..3
assert_eq!(
walk_commit_ids(
&[&ids[8], &ids[7], &ids[6], &id_branch5_1].map(Clone::clone),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/default_revset_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ impl<'index> EvaluationContext<'index> {
}
}

/// Calculates `root_set:head_set`.
/// Calculates `root_set::head_set`.
fn collect_dag_range<'a, 'b, S, T>(
&self,
root_set: &S,
Expand Down
16 changes: 10 additions & 6 deletions lib/src/revset.pest
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ parents_op = { "-" }
children_op = { "+" }
compat_parents_op = { "^" }

dag_range_op = { ":" }
dag_range_pre_op = { ":" }
dag_range_post_op = { ":" }
dag_range_op = { "::" }
dag_range_pre_op = { "::" }
dag_range_post_op = { "::" }
// TODO: Drop support for these in 0.15+
legacy_dag_range_op = { ":" }
legacy_dag_range_pre_op = { ":" }
legacy_dag_range_post_op = { ":" }
range_op = { ".." }
range_pre_op = { ".." }
range_post_op = { ".." }
range_ops = _{ dag_range_op | range_op }
range_pre_ops = _{ dag_range_pre_op | range_pre_op }
range_post_ops = _{ dag_range_post_op | range_post_op }
range_ops = _{ dag_range_op | legacy_dag_range_op | range_op }
range_pre_ops = _{ dag_range_pre_op | legacy_dag_range_pre_op | range_pre_op }
range_post_ops = _{ dag_range_post_op | legacy_dag_range_post_op | range_post_op }

negate_op = { "~" }
union_op = { "|" }
Expand Down
Loading