From efb0b1b08b45282152acb100545cdcfb01e93c79 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 | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d10496145c..a5a87de268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `ui.color = "debug"` prints active labels alongside the regular colored output. +* 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 f37d649d7e..2c049d3fea 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()' +'mutable()' = '~immutable()' diff --git a/docs/revsets.md b/docs/revsets.md index 59f0614113..48c71dbca4 100644 --- a/docs/revsets.md +++ b/docs/revsets.md @@ -219,6 +219,10 @@ for a comprehensive list. * `immutable_heads()`: Resolves to `trunk() | tags()` by default. See [here](config.md#set-of-immutable-commits) for details. +* `immutable()`: Resolves to `::immutable_heads()` by default. See + [here](config.md#set-of-immutable-commits) for details. +* `mutable()`: Resolves to `~immutable()` by default. See + [here](config.md#set-of-immutable-commits) for details. ## The `all:` modifier