From cdc56fa072ec0f23f052f967ab2c6d7648c19306 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 22 Jun 2024 10:19:38 +0900 Subject: [PATCH] cli: sort operation subcommands --- cli/src/commands/operation/mod.rs | 2 +- cli/tests/cli-reference@.md.snap | 32 +++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cli/src/commands/operation/mod.rs b/cli/src/commands/operation/mod.rs index 1429a18ea1..f28b404df8 100644 --- a/cli/src/commands/operation/mod.rs +++ b/cli/src/commands/operation/mod.rs @@ -35,8 +35,8 @@ use crate::ui::Ui; pub enum OperationCommand { Abandon(OperationAbandonArgs), Log(OperationLogArgs), - Undo(OperationUndoArgs), Restore(OperationRestoreArgs), + Undo(OperationUndoArgs), } pub fn cmd_operation( diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index b610e63b03..3c485485a2 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -61,8 +61,8 @@ This document contains the help content for the `jj` command-line program. * [`jj operation`↴](#jj-operation) * [`jj operation abandon`↴](#jj-operation-abandon) * [`jj operation log`↴](#jj-operation-log) -* [`jj operation undo`↴](#jj-operation-undo) * [`jj operation restore`↴](#jj-operation-restore) +* [`jj operation undo`↴](#jj-operation-undo) * [`jj parallelize`↴](#jj-parallelize) * [`jj prev`↴](#jj-prev) * [`jj rebase`↴](#jj-rebase) @@ -1217,8 +1217,8 @@ For information about the operation log, see https://github.com/martinvonz/jj/bl * `abandon` — Abandon operation history * `log` — Show the operation log -* `undo` — Create a new operation that undoes an earlier operation * `restore` — Create a new operation that restores the repo to an earlier state +* `undo` — Create a new operation that undoes an earlier operation @@ -1256,21 +1256,19 @@ Show the operation log -## `jj operation undo` +## `jj operation restore` -Create a new operation that undoes an earlier operation +Create a new operation that restores the repo to an earlier state -This undoes an individual operation by applying the inverse of the operation. +This restores the repo to the state at the specified operation, effectively undoing all later operations. It does so by creating a new operation. -**Usage:** `jj operation undo [OPTIONS] [OPERATION]` +**Usage:** `jj operation restore [OPTIONS] ` ###### **Arguments:** -* `` — The operation to undo - - Use `jj op log` to find an operation to undo. +* `` — The operation to restore to - Default value: `@` + Use `jj op log` to find an operation to restore to. Use e.g. `jj --at-op= log` before restoring to an operation to see the state of the repo at that operation. ###### **Options:** @@ -1289,19 +1287,21 @@ This undoes an individual operation by applying the inverse of the operation. -## `jj operation restore` +## `jj operation undo` -Create a new operation that restores the repo to an earlier state +Create a new operation that undoes an earlier operation -This restores the repo to the state at the specified operation, effectively undoing all later operations. It does so by creating a new operation. +This undoes an individual operation by applying the inverse of the operation. -**Usage:** `jj operation restore [OPTIONS] ` +**Usage:** `jj operation undo [OPTIONS] [OPERATION]` ###### **Arguments:** -* `` — The operation to restore to +* `` — The operation to undo - Use `jj op log` to find an operation to restore to. Use e.g. `jj --at-op= log` before restoring to an operation to see the state of the repo at that operation. + Use `jj op log` to find an operation to undo. + + Default value: `@` ###### **Options:**