From fa6f5e3880b369f6d3e82457875283d8b345cac4 Mon Sep 17 00:00:00 2001 From: Matt Stark Date: Fri, 17 May 2024 09:34:43 +1000 Subject: [PATCH] Add the revsets `mutable` and `immutable`. I add them as aliases, since a user may instead choose to define `immutable_heads()`, for example, as `heads(immutable())`, and the define `immutable()` instead. --- CHANGELOG.md | 2 ++ cli/src/config/revsets.toml | 2 ++ docs/revsets.md | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81308ade4..0e27a4c3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Note, these are cross compiled and currently untested. We plan on providing fully tested builds later once our CI system allows it. +* Added new revsets `mutable()` and `immutable()`. + ### Fixed bugs * When the working copy commit becomes immutable, a new one is automatically created on top of it diff --git a/cli/src/config/revsets.toml b/cli/src/config/revsets.toml index f37d649d7..60517d3ff 100644 --- a/cli/src/config/revsets.toml +++ b/cli/src/config/revsets.toml @@ -18,3 +18,5 @@ latest( ''' 'immutable_heads()' = 'trunk() | tags()' +'immutable()' = '::(immutable_heads() | root())' +'mutable()' = '~immutable()' diff --git a/docs/revsets.md b/docs/revsets.md index d566b368d..1e14ea199 100644 --- a/docs/revsets.md +++ b/docs/revsets.md @@ -223,6 +223,16 @@ for a comprehensive list. * `immutable_heads()`: Resolves to `trunk() | tags()` by default. See [here](config.md#set-of-immutable-commits) for details. +* `immutable()`: The set of commits that `jj` treats as immutable. This is + equivalent to `::(immutable_heads() | root())`. Note that modifying this will + *not* change whether a commit is immutable. To do that, edit + `immutable_heads()`. + +* `mutable()`: The set of commits that `jj` treats as mutable. This is + equivalent to `~immutable()`. Note that modifying this will + *not* change whether a commit is immutable. To do that, edit + `immutable_heads()`. + ## The `all:` modifier