mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-29 23:57:51 +00:00
cli: refer to revset argument using REVSET(S)
in synopsis
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
This should help clarify that the arguments are not just simple change ids or commit ids.
This commit is contained in:
parent
a414441dd6
commit
822f01648d
44 changed files with 277 additions and 136 deletions
|
@ -37,7 +37,11 @@ use crate::ui::Ui;
|
|||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub(crate) struct AbandonArgs {
|
||||
/// The revision(s) to abandon
|
||||
#[arg(default_value = "@", add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
default_value = "@",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
revisions: Vec<RevisionArg>,
|
||||
/// Do not print every abandoned commit on a separate line
|
||||
#[arg(long, short)]
|
||||
|
|
|
@ -39,6 +39,7 @@ pub(crate) struct AbsorbArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
from: RevisionArg,
|
||||
|
@ -48,6 +49,7 @@ pub(crate) struct AbsorbArgs {
|
|||
#[arg(
|
||||
long, short = 't', visible_alias = "to",
|
||||
default_value = "mutable()",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
into: Vec<RevisionArg>,
|
||||
|
|
|
@ -31,6 +31,7 @@ pub(crate) struct BackoutArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
revisions: Vec<RevisionArg>,
|
||||
|
@ -40,6 +41,7 @@ pub(crate) struct BackoutArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
destination: Vec<RevisionArg>,
|
||||
|
|
|
@ -35,6 +35,7 @@ pub struct BookmarkCreateArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
visible_alias = "to",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
revision: Option<RevisionArg>,
|
||||
|
|
|
@ -84,7 +84,7 @@ pub struct BookmarkListArgs {
|
|||
///
|
||||
/// Note that `-r deleted_bookmark` will not work since `deleted_bookmark`
|
||||
/// wouldn't have a local target.
|
||||
#[arg(long, short)]
|
||||
#[arg(long, short, value_name = "REVSETS")]
|
||||
revisions: Option<Vec<RevisionArg>>,
|
||||
|
||||
/// Render each bookmark using the given template
|
||||
|
|
|
@ -49,7 +49,7 @@ pub struct BookmarkMoveArgs {
|
|||
#[arg(
|
||||
long,
|
||||
group = "source",
|
||||
value_name = "REVISIONS",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
from: Vec<RevisionArg>,
|
||||
|
@ -60,7 +60,7 @@ pub struct BookmarkMoveArgs {
|
|||
#[arg(
|
||||
long,
|
||||
default_value = "@",
|
||||
value_name = "REVISION",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
to: RevisionArg,
|
||||
|
|
|
@ -33,6 +33,7 @@ pub struct BookmarkSetArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
visible_alias = "to",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
revision: Option<RevisionArg>,
|
||||
|
|
|
@ -28,7 +28,7 @@ use crate::ui::Ui;
|
|||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub struct CopyDetectionArgs {
|
||||
/// Show changes in this revision, compared to its parent(s)
|
||||
#[arg(default_value = "@")]
|
||||
#[arg(default_value = "@", value_name = "REVSET")]
|
||||
revision: RevisionArg,
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ use crate::ui::Ui;
|
|||
/// List the recursive entries of a tree.
|
||||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub struct DebugTreeArgs {
|
||||
#[arg(long, short = 'r')]
|
||||
#[arg(long, short = 'r', value_name = "REVSET")]
|
||||
revision: Option<RevisionArg>,
|
||||
#[arg(long, conflicts_with = "revision")]
|
||||
id: Option<String>,
|
||||
|
|
|
@ -44,7 +44,11 @@ use crate::ui::Ui;
|
|||
#[command(visible_aliases = &["desc"])]
|
||||
pub(crate) struct DescribeArgs {
|
||||
/// The revision(s) whose description to edit
|
||||
#[arg(default_value = "@", add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
default_value = "@",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
revisions: Vec<RevisionArg>,
|
||||
/// Ignored (but lets you pass `-r` for consistency with other commands)
|
||||
#[arg(short = 'r', hide = true, action = clap::ArgAction::Count)]
|
||||
|
|
|
@ -49,13 +49,30 @@ pub(crate) struct DiffArgs {
|
|||
/// If the revision is a merge commit, this shows changes *from* the
|
||||
/// automatic merge of the contents of all of its parents *to* the contents
|
||||
/// of the revision itself.
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
revision: Option<RevisionArg>,
|
||||
/// Show changes from this revision
|
||||
#[arg(long, short, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
conflicts_with = "revision",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
from: Option<RevisionArg>,
|
||||
/// Show changes to this revision
|
||||
#[arg(long, short, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
conflicts_with = "revision",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
to: Option<RevisionArg>,
|
||||
/// Restrict the diff to these paths
|
||||
#[arg(
|
||||
|
|
|
@ -50,7 +50,12 @@ pub(crate) struct DiffeditArgs {
|
|||
/// The revision to touch up
|
||||
///
|
||||
/// Defaults to @ if neither --to nor --from are specified.
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
revision: Option<RevisionArg>,
|
||||
/// Show changes from this revision
|
||||
///
|
||||
|
@ -58,6 +63,7 @@ pub(crate) struct DiffeditArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
conflicts_with = "revision",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
from: Option<RevisionArg>,
|
||||
|
@ -67,6 +73,7 @@ pub(crate) struct DiffeditArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
conflicts_with = "revision",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
to: Option<RevisionArg>,
|
||||
|
|
|
@ -52,13 +52,21 @@ use crate::ui::Ui;
|
|||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub(crate) struct DuplicateArgs {
|
||||
/// The revision(s) to duplicate (default: @)
|
||||
#[arg(value_name = "REVISIONS", add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
revisions_pos: Vec<RevisionArg>,
|
||||
#[arg(short = 'r', hide = true)]
|
||||
#[arg(short = 'r', hide = true, value_name = "REVSETS")]
|
||||
revisions_opt: Vec<RevisionArg>,
|
||||
/// The revision(s) to duplicate onto (can be repeated to create a merge
|
||||
/// commit)
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
destination: Vec<RevisionArg>,
|
||||
/// The revision(s) to insert after (can be repeated to create a merge
|
||||
/// commit)
|
||||
|
@ -67,6 +75,7 @@ pub(crate) struct DuplicateArgs {
|
|||
short = 'A',
|
||||
visible_alias = "after",
|
||||
conflicts_with = "destination",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
insert_after: Vec<RevisionArg>,
|
||||
|
@ -77,6 +86,7 @@ pub(crate) struct DuplicateArgs {
|
|||
short = 'B',
|
||||
visible_alias = "before",
|
||||
conflicts_with = "destination",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
insert_before: Vec<RevisionArg>,
|
||||
|
|
|
@ -33,7 +33,7 @@ use crate::ui::Ui;
|
|||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub(crate) struct EditArgs {
|
||||
/// The commit to edit
|
||||
#[arg(add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(value_name = "REVSET", add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
revision: RevisionArg,
|
||||
/// Ignored (but lets you pass `-r` for consistency with other commands)
|
||||
#[arg(short = 'r', hide = true)]
|
||||
|
|
|
@ -42,6 +42,7 @@ pub(crate) struct EvologArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
revision: RevisionArg,
|
||||
|
|
|
@ -44,7 +44,12 @@ pub(crate) struct FileAnnotateArgs {
|
|||
)]
|
||||
path: String,
|
||||
/// an optional revision to start at
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
revision: Option<RevisionArg>,
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ pub(crate) struct FileChmodArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
revision: RevisionArg,
|
||||
|
|
|
@ -30,6 +30,7 @@ pub(crate) struct FileListArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
revision: RevisionArg,
|
||||
|
|
|
@ -48,6 +48,7 @@ pub(crate) struct FileShowArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
revision: RevisionArg,
|
||||
|
|
|
@ -126,7 +126,12 @@ pub(crate) struct FixArgs {
|
|||
/// Fix files in the specified revision(s) and their descendants. If no
|
||||
/// revisions are specified, this defaults to the `revsets.fix` setting, or
|
||||
/// `reachable(@, mutable())` if it is not set.
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
source: Vec<RevisionArg>,
|
||||
/// Fix only these paths
|
||||
#[arg(value_name = "FILESETS", value_hint = clap::ValueHint::AnyPath)]
|
||||
|
|
|
@ -127,7 +127,7 @@ pub struct GitPushArgs {
|
|||
#[arg(long)]
|
||||
allow_private: bool,
|
||||
/// Push bookmarks pointing to these commits (can be repeated)
|
||||
#[arg(long, short)]
|
||||
#[arg(long, short, value_name = "REVSETS")]
|
||||
revisions: Vec<RevisionArg>,
|
||||
/// Push this commit by creating a bookmark based on its change ID (can be
|
||||
/// repeated)
|
||||
|
@ -135,7 +135,7 @@ pub struct GitPushArgs {
|
|||
/// The created bookmark will be tracked automatically. Use the
|
||||
/// `git.push-bookmark-prefix` setting to change the prefix for generated
|
||||
/// names.
|
||||
#[arg(long, short)]
|
||||
#[arg(long, short, value_name = "REVSETS")]
|
||||
change: Vec<RevisionArg>,
|
||||
/// Only display what will change on the remote
|
||||
#[arg(long)]
|
||||
|
|
|
@ -52,7 +52,7 @@ pub fn cmd_git_submodule(
|
|||
#[command(hide = true)]
|
||||
pub struct PrintArgs {
|
||||
/// Read .gitmodules from the given revision.
|
||||
#[arg(long, short = 'r', default_value = "@")]
|
||||
#[arg(long, short = 'r', default_value = "@", value_name = "REVSET")]
|
||||
revisions: RevisionArg,
|
||||
}
|
||||
|
||||
|
|
|
@ -37,10 +37,20 @@ use crate::ui::Ui;
|
|||
#[command(mut_arg("ignore_space_change", |a| a.short('b')))]
|
||||
pub(crate) struct InterdiffArgs {
|
||||
/// Show changes from this revision
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
from: Option<RevisionArg>,
|
||||
/// Show changes to this revision
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
to: Option<RevisionArg>,
|
||||
/// Restrict the diff to these paths
|
||||
#[arg(
|
||||
|
|
|
@ -63,7 +63,12 @@ pub(crate) struct LogArgs {
|
|||
///
|
||||
/// If no paths nor revisions are specified, this defaults to the
|
||||
/// `revsets.log` setting.
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
revisions: Vec<RevisionArg>,
|
||||
/// Show revisions modifying the given paths
|
||||
#[arg(
|
||||
|
|
|
@ -52,7 +52,11 @@ use crate::ui::Ui;
|
|||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub(crate) struct NewArgs {
|
||||
/// Parent(s) of the new change
|
||||
#[arg(default_value = "@", add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
default_value = "@",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
pub(crate) revisions: Vec<RevisionArg>,
|
||||
/// Ignored (but lets you pass `-d`/`-r` for consistency with other
|
||||
/// commands)
|
||||
|
@ -73,6 +77,7 @@ pub(crate) struct NewArgs {
|
|||
short = 'A',
|
||||
visible_alias = "after",
|
||||
conflicts_with = "revisions",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
insert_after: Vec<RevisionArg>,
|
||||
|
@ -82,6 +87,7 @@ pub(crate) struct NewArgs {
|
|||
short = 'B',
|
||||
visible_alias = "before",
|
||||
conflicts_with = "revisions",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
insert_before: Vec<RevisionArg>,
|
||||
|
|
|
@ -57,7 +57,10 @@ use crate::ui::Ui;
|
|||
#[command(verbatim_doc_comment)]
|
||||
pub(crate) struct ParallelizeArgs {
|
||||
/// Revisions to parallelize
|
||||
#[arg(add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
revisions: Vec<RevisionArg>,
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,12 @@ pub(crate) struct RebaseArgs {
|
|||
/// -d=dst`.
|
||||
///
|
||||
/// If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
branch: Vec<RevisionArg>,
|
||||
|
||||
/// Rebase specified revision(s) together with their trees of descendants
|
||||
|
@ -153,7 +158,12 @@ pub(crate) struct RebaseArgs {
|
|||
/// of others.
|
||||
///
|
||||
/// If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
source: Vec<RevisionArg>,
|
||||
/// Rebase the given revisions, rebasing descendants onto this revision's
|
||||
/// parent(s)
|
||||
|
@ -162,7 +172,12 @@ pub(crate) struct RebaseArgs {
|
|||
/// descendant of `A`.
|
||||
///
|
||||
/// If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
revisions: Vec<RevisionArg>,
|
||||
|
||||
#[command(flatten)]
|
||||
|
@ -185,7 +200,12 @@ pub(crate) struct RebaseArgs {
|
|||
pub struct RebaseDestinationArgs {
|
||||
/// The revision(s) to rebase onto (can be repeated to create a merge
|
||||
/// commit)
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
destination: Option<Vec<RevisionArg>>,
|
||||
/// The revision(s) to insert after (can be repeated to create a merge
|
||||
/// commit)
|
||||
|
@ -194,6 +214,7 @@ pub struct RebaseDestinationArgs {
|
|||
short = 'A',
|
||||
visible_alias = "after",
|
||||
conflicts_with = "destination",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
insert_after: Option<Vec<RevisionArg>>,
|
||||
|
@ -204,6 +225,7 @@ pub struct RebaseDestinationArgs {
|
|||
short = 'B',
|
||||
visible_alias = "before",
|
||||
conflicts_with = "destination",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
insert_before: Option<Vec<RevisionArg>>,
|
||||
|
|
|
@ -48,6 +48,7 @@ pub(crate) struct ResolveArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
revision: RevisionArg,
|
||||
|
|
|
@ -53,22 +53,32 @@ pub(crate) struct RestoreArgs {
|
|||
)]
|
||||
paths: Vec<String>,
|
||||
/// Revision to restore from (source)
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
from: Option<RevisionArg>,
|
||||
/// Revision to restore into (destination)
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
to: Option<RevisionArg>,
|
||||
/// Undo the changes in a revision as compared to the merge of its parents.
|
||||
///
|
||||
/// This undoes the changes that can be seen with `jj diff -r REVISION`. If
|
||||
/// `REVISION` only has a single parent, this option is equivalent to `jj
|
||||
/// restore --to REVISION --from REVISION-`.
|
||||
/// This undoes the changes that can be seen with `jj diff -r REVSET`. If
|
||||
/// `REVSET` only has a single parent, this option is equivalent to `jj
|
||||
/// restore --to REVSET --from REVSET-`.
|
||||
///
|
||||
/// The default behavior of `jj restore` is equivalent to `jj restore
|
||||
/// --changes-in @`.
|
||||
#[arg(
|
||||
long, short,
|
||||
value_name = "REVISION",
|
||||
value_name = "REVSET",
|
||||
conflicts_with_all = ["to", "from"],
|
||||
add = ArgValueCandidates::new(complete::all_revisions),
|
||||
)]
|
||||
|
|
|
@ -40,7 +40,7 @@ pub struct RunArgs {
|
|||
/// The command to run across all selected revisions.
|
||||
shell_command: String,
|
||||
/// The revisions to change.
|
||||
#[arg(long, short, default_value = "@")]
|
||||
#[arg(long, short, default_value = "@", value_name = "REVSETS")]
|
||||
revisions: Vec<RevisionArg>,
|
||||
/// A no-op option to match the interface of `git rebase -x`.
|
||||
#[arg(short = 'x', hide = true)]
|
||||
|
|
|
@ -27,7 +27,11 @@ use crate::ui::Ui;
|
|||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub(crate) struct ShowArgs {
|
||||
/// Show changes in this revision, compared to its parent(s)
|
||||
#[arg(default_value = "@", add = ArgValueCandidates::new(complete::all_revisions))]
|
||||
#[arg(
|
||||
default_value = "@",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::all_revisions)
|
||||
)]
|
||||
revision: RevisionArg,
|
||||
/// Ignored (but lets you pass `-r` for consistency with other commands)
|
||||
#[arg(short = 'r', hide = true)]
|
||||
|
|
|
@ -23,14 +23,24 @@ use crate::ui::Ui;
|
|||
pub(crate) struct SimplifyParentsArgs {
|
||||
/// Simplify specified revision(s) together with their trees of descendants
|
||||
/// (can be repeated)
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
source: Vec<RevisionArg>,
|
||||
/// Simplify specified revision(s) (can be repeated)
|
||||
///
|
||||
/// If both `--source` and `--revisions` are not provided, this defaults to
|
||||
/// the `revsets.simplify-parents` setting, or `reachable(@, mutable())`
|
||||
/// if it is not set.
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
revisions: Vec<RevisionArg>,
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ pub(crate) struct SplitArgs {
|
|||
#[arg(
|
||||
long, short,
|
||||
default_value = "@",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
revision: RevisionArg,
|
||||
|
|
|
@ -60,12 +60,18 @@ use crate::ui::Ui;
|
|||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub(crate) struct SquashArgs {
|
||||
/// Revision to squash into its parent (default: @)
|
||||
#[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))]
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions)
|
||||
)]
|
||||
revision: Option<RevisionArg>,
|
||||
/// Revision(s) to squash from (default: @)
|
||||
#[arg(
|
||||
long, short,
|
||||
conflicts_with = "revision",
|
||||
value_name = "REVSETS",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
from: Vec<RevisionArg>,
|
||||
|
@ -74,6 +80,7 @@ pub(crate) struct SquashArgs {
|
|||
long, short = 't',
|
||||
conflicts_with = "revision",
|
||||
visible_alias = "to",
|
||||
value_name = "REVSET",
|
||||
add = ArgValueCandidates::new(complete::mutable_revisions),
|
||||
)]
|
||||
into: Option<RevisionArg>,
|
||||
|
|
|
@ -38,7 +38,7 @@ use crate::ui::Ui;
|
|||
/// commit. This is true in general; it is not specific to this command.
|
||||
#[derive(clap::Args, Clone, Debug)]
|
||||
pub(crate) struct UnsquashArgs {
|
||||
#[arg(long, short, default_value = "@")]
|
||||
#[arg(long, short, default_value = "@", value_name = "REVSET")]
|
||||
revision: RevisionArg,
|
||||
/// Interactively choose which parts to unsquash
|
||||
// TODO: It doesn't make much sense to run this without -i. We should make that
|
||||
|
|
|
@ -68,7 +68,7 @@ pub struct WorkspaceAddArgs {
|
|||
/// the new working-copy commit will be created with all these revisions as
|
||||
/// parents, i.e. the working-copy commit will exist as if you had run `jj
|
||||
/// new r1 r2 r3 ...`.
|
||||
#[arg(long, short)]
|
||||
#[arg(long, short, value_name = "REVSETS")]
|
||||
revision: Vec<RevisionArg>,
|
||||
/// How to handle sparse patterns when creating a new workspace.
|
||||
#[arg(long, value_enum, default_value_t = SparseInheritance::Copy)]
|
||||
|
|
|
@ -210,11 +210,11 @@ Abandon a revision, rebasing descendants onto its parent(s). The behavior is sim
|
|||
|
||||
If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command.
|
||||
|
||||
**Usage:** `jj abandon [OPTIONS] [REVISIONS]...`
|
||||
**Usage:** `jj abandon [OPTIONS] [REVSETS]...`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<REVISIONS>` — The revision(s) to abandon
|
||||
* `<REVSETS>` — The revision(s) to abandon
|
||||
|
||||
Default value: `@`
|
||||
|
||||
|
@ -241,10 +241,10 @@ The modification made by `jj absorb` can be reviewed by `jj op show -p`.
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-f`, `--from <FROM>` — Source revision to absorb from
|
||||
* `-f`, `--from <REVSET>` — Source revision to absorb from
|
||||
|
||||
Default value: `@`
|
||||
* `-t`, `--into <INTO>` — Destination revisions to absorb into
|
||||
* `-t`, `--into <REVSETS>` — Destination revisions to absorb into
|
||||
|
||||
Only ancestors of the source revision will be considered.
|
||||
|
||||
|
@ -260,10 +260,10 @@ Apply the reverse of a revision on top of another revision
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revisions <REVISIONS>` — The revision(s) to apply the reverse of
|
||||
* `-r`, `--revisions <REVSETS>` — The revision(s) to apply the reverse of
|
||||
|
||||
Default value: `@`
|
||||
* `-d`, `--destination <DESTINATION>` — The revision to apply the reverse changes on top of
|
||||
* `-d`, `--destination <REVSETS>` — The revision to apply the reverse changes on top of
|
||||
|
||||
Default value: `@`
|
||||
|
||||
|
@ -303,7 +303,7 @@ Create a new bookmark
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — The bookmark's target revision
|
||||
* `-r`, `--revision <REVSET>` — The bookmark's target revision
|
||||
|
||||
|
||||
|
||||
|
@ -363,7 +363,7 @@ For information about bookmarks, see https://jj-vcs.github.io/jj/latest/bookmark
|
|||
By default, the specified remote name matches exactly. Use `glob:` prefix to select remotes by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns.
|
||||
* `-t`, `--tracked` — Show remote tracked bookmarks only. Omits local Git-tracking bookmarks by default
|
||||
* `-c`, `--conflicted` — Show conflicted bookmarks only
|
||||
* `-r`, `--revisions <REVISIONS>` — Show bookmarks whose local targets are in the given revisions
|
||||
* `-r`, `--revisions <REVSETS>` — Show bookmarks whose local targets are in the given revisions
|
||||
|
||||
Note that `-r deleted_bookmark` will not work since `deleted_bookmark` wouldn't have a local target.
|
||||
* `-T`, `--template <TEMPLATE>` — Render each bookmark using the given template
|
||||
|
@ -386,7 +386,7 @@ Example: pull up the nearest bookmarks to the working-copy parent
|
|||
|
||||
$ jj bookmark move --from 'heads(::@- & bookmarks())' --to @-
|
||||
|
||||
**Usage:** `jj bookmark move [OPTIONS] <--from <REVISIONS>|NAMES>`
|
||||
**Usage:** `jj bookmark move [OPTIONS] <--from <REVSETS>|NAMES>`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
|
@ -396,8 +396,8 @@ $ jj bookmark move --from 'heads(::@- & bookmarks())' --to @-
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `--from <REVISIONS>` — Move bookmarks from the given revisions
|
||||
* `--to <REVISION>` — Move bookmarks to this revision
|
||||
* `--from <REVSETS>` — Move bookmarks from the given revisions
|
||||
* `--to <REVSET>` — Move bookmarks to this revision
|
||||
|
||||
Default value: `@`
|
||||
* `-B`, `--allow-backwards` — Allow moving bookmarks backwards or sideways
|
||||
|
@ -431,7 +431,7 @@ Create or update a bookmark to point to a certain commit
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — The bookmark's target revision
|
||||
* `-r`, `--revision <REVSET>` — The bookmark's target revision
|
||||
* `-B`, `--allow-backwards` — Allow moving the bookmark backwards or sideways
|
||||
|
||||
|
||||
|
@ -644,11 +644,11 @@ Update the change description or other metadata
|
|||
|
||||
Starts an editor to let you edit the description of changes. The editor will be $EDITOR, or `pico` if that's not defined (`Notepad` on Windows).
|
||||
|
||||
**Usage:** `jj describe [OPTIONS] [REVISIONS]...`
|
||||
**Usage:** `jj describe [OPTIONS] [REVSETS]...`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<REVISIONS>` — The revision(s) whose description to edit
|
||||
* `<REVSETS>` — The revision(s) whose description to edit
|
||||
|
||||
Default value: `@`
|
||||
|
||||
|
@ -692,11 +692,11 @@ With the `--from` and/or `--to` options, shows the difference from/to the given
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — Show changes in this revision, compared to its parent(s)
|
||||
* `-r`, `--revision <REVSET>` — Show changes in this revision, compared to its parent(s)
|
||||
|
||||
If the revision is a merge commit, this shows changes *from* the automatic merge of the contents of all of its parents *to* the contents of the revision itself.
|
||||
* `-f`, `--from <FROM>` — Show changes from this revision
|
||||
* `-t`, `--to <TO>` — Show changes to this revision
|
||||
* `-f`, `--from <REVSET>` — Show changes from this revision
|
||||
* `-t`, `--to <REVSET>` — Show changes to this revision
|
||||
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
|
||||
* `--stat` — Show a histogram of the changes
|
||||
* `--types` — For each path, show only its type before and after
|
||||
|
@ -732,13 +732,13 @@ See `jj restore` if you want to move entire files from one revision to another.
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — The revision to touch up
|
||||
* `-r`, `--revision <REVSET>` — The revision to touch up
|
||||
|
||||
Defaults to @ if neither --to nor --from are specified.
|
||||
* `-f`, `--from <FROM>` — Show changes from this revision
|
||||
* `-f`, `--from <REVSET>` — Show changes from this revision
|
||||
|
||||
Defaults to @ if --to is specified.
|
||||
* `-t`, `--to <TO>` — Edit changes in this revision
|
||||
* `-t`, `--to <REVSET>` — Edit changes in this revision
|
||||
|
||||
Defaults to @ if --from is specified.
|
||||
* `--tool <NAME>` — Specify diff editor to be used
|
||||
|
@ -756,17 +756,17 @@ When none of the `--destination`, `--insert-after`, or `--insert-before` argumen
|
|||
|
||||
When any of the `--destination`, `--insert-after`, or `--insert-before` arguments are provided, the roots of the specified commits will be duplicated onto the destination indicated by the arguments. Other specified commits will be duplicated onto these newly duplicated commits. If the `--insert-after` or `--insert-before` arguments are provided, the new children indicated by the arguments will be rebased onto the heads of the specified commits.
|
||||
|
||||
**Usage:** `jj duplicate [OPTIONS] [REVISIONS]...`
|
||||
**Usage:** `jj duplicate [OPTIONS] [REVSETS]...`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<REVISIONS>` — The revision(s) to duplicate (default: @)
|
||||
* `<REVSETS>` — The revision(s) to duplicate (default: @)
|
||||
|
||||
###### **Options:**
|
||||
|
||||
* `-d`, `--destination <DESTINATION>` — The revision(s) to duplicate onto (can be repeated to create a merge commit)
|
||||
* `-A`, `--insert-after <INSERT_AFTER>` — The revision(s) to insert after (can be repeated to create a merge commit)
|
||||
* `-B`, `--insert-before <INSERT_BEFORE>` — The revision(s) to insert before (can be repeated to create a merge commit)
|
||||
* `-d`, `--destination <REVSETS>` — The revision(s) to duplicate onto (can be repeated to create a merge commit)
|
||||
* `-A`, `--insert-after <REVSETS>` — The revision(s) to insert after (can be repeated to create a merge commit)
|
||||
* `-B`, `--insert-before <REVSETS>` — The revision(s) to insert before (can be repeated to create a merge commit)
|
||||
|
||||
|
||||
|
||||
|
@ -778,11 +778,11 @@ Note: it is generally recommended to instead use `jj new` and `jj squash`.
|
|||
|
||||
For more information, see https://jj-vcs.github.io/jj/latest/FAQ#how-do-i-resume-working-on-an-existing-change
|
||||
|
||||
**Usage:** `jj edit <REVISION>`
|
||||
**Usage:** `jj edit <REVSET>`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<REVISION>` — The commit to edit
|
||||
* `<REVSET>` — The commit to edit
|
||||
|
||||
|
||||
|
||||
|
@ -796,7 +796,7 @@ Lists the previous commits which a change has pointed to. The current commit of
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>`
|
||||
* `-r`, `--revision <REVSET>`
|
||||
|
||||
Default value: `@`
|
||||
* `-n`, `--limit <LIMIT>` — Limit number of revisions to show
|
||||
|
@ -855,7 +855,7 @@ Annotates a revision line by line. Each line includes the source change that int
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — an optional revision to start at
|
||||
* `-r`, `--revision <REVSET>` — an optional revision to start at
|
||||
|
||||
|
||||
|
||||
|
@ -881,7 +881,7 @@ Unlike the POSIX `chmod`, `jj file chmod` also works on Windows, on conflicted f
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — The revision to update
|
||||
* `-r`, `--revision <REVSET>` — The revision to update
|
||||
|
||||
Default value: `@`
|
||||
|
||||
|
@ -899,7 +899,7 @@ List files in a revision
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — The revision to list files in
|
||||
* `-r`, `--revision <REVSET>` — The revision to list files in
|
||||
|
||||
Default value: `@`
|
||||
|
||||
|
@ -919,7 +919,7 @@ If the given path is a directory, files in the directory will be visited recursi
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — The revision to get the file contents from
|
||||
* `-r`, `--revision <REVSET>` — The revision to get the file contents from
|
||||
|
||||
Default value: `@`
|
||||
|
||||
|
@ -1031,7 +1031,7 @@ will be removed in a future version.
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-s`, `--source <SOURCE>` — Fix files in the specified revision(s) and their descendants. If no revisions are specified, this defaults to the `revsets.fix` setting, or `reachable(@, mutable())` if it is not set
|
||||
* `-s`, `--source <REVSETS>` — Fix files in the specified revision(s) and their descendants. If no revisions are specified, this defaults to the `revsets.fix` setting, or `reachable(@, mutable())` if it is not set
|
||||
* `--include-unchanged-files` — Fix unchanged files in addition to changed ones. If no paths are specified, all files in the repo will be fixed
|
||||
|
||||
|
||||
|
@ -1182,8 +1182,8 @@ Before the command actually moves, creates, or deletes a remote bookmark, it mak
|
|||
Newly-created remote bookmarks will be tracked automatically.
|
||||
* `--allow-empty-description` — Allow pushing commits with empty descriptions
|
||||
* `--allow-private` — Allow pushing commits that are private
|
||||
* `-r`, `--revisions <REVISIONS>` — Push bookmarks pointing to these commits (can be repeated)
|
||||
* `-c`, `--change <CHANGE>` — Push this commit by creating a bookmark based on its change ID (can be repeated)
|
||||
* `-r`, `--revisions <REVSETS>` — Push bookmarks pointing to these commits (can be repeated)
|
||||
* `-c`, `--change <REVSETS>` — Push this commit by creating a bookmark based on its change ID (can be repeated)
|
||||
|
||||
The created bookmark will be tracked automatically. Use the `git.push-bookmark-prefix` setting to change the prefix for generated names.
|
||||
* `--dry-run` — Only display what will change on the remote
|
||||
|
@ -1322,7 +1322,7 @@ Compare the changes of two commits
|
|||
|
||||
This excludes changes from other commits by temporarily rebasing `--from` onto `--to`'s parents. If you wish to compare the same change across versions, consider `jj evolog -p` instead.
|
||||
|
||||
**Usage:** `jj interdiff [OPTIONS] <--from <FROM>|--to <TO>> [FILESETS]...`
|
||||
**Usage:** `jj interdiff [OPTIONS] <--from <REVSET>|--to <REVSET>> [FILESETS]...`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
|
@ -1330,8 +1330,8 @@ This excludes changes from other commits by temporarily rebasing `--from` onto `
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-f`, `--from <FROM>` — Show changes from this revision
|
||||
* `-t`, `--to <TO>` — Show changes to this revision
|
||||
* `-f`, `--from <REVSET>` — Show changes from this revision
|
||||
* `-t`, `--to <REVSET>` — Show changes to this revision
|
||||
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
|
||||
* `--stat` — Show a histogram of the changes
|
||||
* `--types` — For each path, show only its type before and after
|
||||
|
@ -1367,7 +1367,7 @@ The working-copy commit is indicated by a `@` symbol in the graph. Immutable rev
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revisions <REVISIONS>` — Which revisions to show
|
||||
* `-r`, `--revisions <REVSETS>` — Which revisions to show
|
||||
|
||||
If no paths nor revisions are specified, this defaults to the `revsets.log` setting.
|
||||
* `--reversed` — Show revisions in the opposite order (older revisions first)
|
||||
|
@ -1410,11 +1410,11 @@ Note that you can create a merge commit by specifying multiple revisions as argu
|
|||
|
||||
For more information, see https://jj-vcs.github.io/jj/latest/working-copy/.
|
||||
|
||||
**Usage:** `jj new [OPTIONS] [REVISIONS]...`
|
||||
**Usage:** `jj new [OPTIONS] [REVSETS]...`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<REVISIONS>` — Parent(s) of the new change
|
||||
* `<REVSETS>` — Parent(s) of the new change
|
||||
|
||||
Default value: `@`
|
||||
|
||||
|
@ -1422,8 +1422,8 @@ For more information, see https://jj-vcs.github.io/jj/latest/working-copy/.
|
|||
|
||||
* `-m`, `--message <MESSAGE>` — The change description to use
|
||||
* `--no-edit` — Do not edit the newly created change
|
||||
* `-A`, `--insert-after <INSERT_AFTER>` — Insert the new change after the given commit(s)
|
||||
* `-B`, `--insert-before <INSERT_BEFORE>` — Insert the new change before the given commit(s)
|
||||
* `-A`, `--insert-after <REVSETS>` — Insert the new change after the given commit(s)
|
||||
* `-B`, `--insert-before <REVSETS>` — Insert the new change before the given commit(s)
|
||||
|
||||
|
||||
|
||||
|
@ -1710,11 +1710,11 @@ Therefore, `jj parallelize '1 | 3'` is a no-op. That's because 2, which is
|
|||
not in the target set, was a descendant of 1 before, so it remains a
|
||||
descendant, and it was an ancestor of 3 before, so it remains an ancestor.
|
||||
|
||||
**Usage:** `jj parallelize [REVISIONS]...`
|
||||
**Usage:** `jj parallelize [REVSETS]...`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<REVISIONS>` — Revisions to parallelize
|
||||
* `<REVSETS>` — Revisions to parallelize
|
||||
|
||||
|
||||
|
||||
|
@ -1857,28 +1857,28 @@ J J
|
|||
If a working-copy commit gets abandoned, it will be given a new, empty
|
||||
commit. This is true in general; it is not specific to this command.
|
||||
|
||||
**Usage:** `jj rebase [OPTIONS] <--destination <DESTINATION>|--insert-after <INSERT_AFTER>|--insert-before <INSERT_BEFORE>>`
|
||||
**Usage:** `jj rebase [OPTIONS] <--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>`
|
||||
|
||||
###### **Options:**
|
||||
|
||||
* `-b`, `--branch <BRANCH>` — Rebase the whole branch relative to destination's ancestors (can be repeated)
|
||||
* `-b`, `--branch <REVSETS>` — Rebase the whole branch relative to destination's ancestors (can be repeated)
|
||||
|
||||
`jj rebase -b=br -d=dst` is equivalent to `jj rebase '-s=roots(dst..br)' -d=dst`.
|
||||
|
||||
If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
|
||||
* `-s`, `--source <SOURCE>` — Rebase specified revision(s) together with their trees of descendants (can be repeated)
|
||||
* `-s`, `--source <REVSETS>` — Rebase specified revision(s) together with their trees of descendants (can be repeated)
|
||||
|
||||
Each specified revision will become a direct child of the destination revision(s), even if some of the source revisions are descendants of others.
|
||||
|
||||
If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
|
||||
* `-r`, `--revisions <REVISIONS>` — Rebase the given revisions, rebasing descendants onto this revision's parent(s)
|
||||
* `-r`, `--revisions <REVSETS>` — Rebase the given revisions, rebasing descendants onto this revision's parent(s)
|
||||
|
||||
Unlike `-s` or `-b`, you may `jj rebase -r` a revision `A` onto a descendant of `A`.
|
||||
|
||||
If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
|
||||
* `-d`, `--destination <DESTINATION>` — The revision(s) to rebase onto (can be repeated to create a merge commit)
|
||||
* `-A`, `--insert-after <INSERT_AFTER>` — The revision(s) to insert after (can be repeated to create a merge commit)
|
||||
* `-B`, `--insert-before <INSERT_BEFORE>` — The revision(s) to insert before (can be repeated to create a merge commit)
|
||||
* `-d`, `--destination <REVSETS>` — The revision(s) to rebase onto (can be repeated to create a merge commit)
|
||||
* `-A`, `--insert-after <REVSETS>` — The revision(s) to insert after (can be repeated to create a merge commit)
|
||||
* `-B`, `--insert-before <REVSETS>` — The revision(s) to insert before (can be repeated to create a merge commit)
|
||||
* `--skip-emptied` — If true, when rebasing would produce an empty commit, the commit is abandoned. It will not be abandoned if it was already empty before the rebase. Will never skip merge commits with multiple non-empty parents
|
||||
|
||||
|
||||
|
@ -1899,7 +1899,7 @@ Note that conflicts can also be resolved without using this command. You may edi
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>`
|
||||
* `-r`, `--revision <REVSET>`
|
||||
|
||||
Default value: `@`
|
||||
* `-l`, `--list` — Instead of resolving one conflict, list all the conflicts
|
||||
|
@ -1927,11 +1927,11 @@ See `jj diffedit` if you'd like to restore portions of files rather than entire
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-f`, `--from <FROM>` — Revision to restore from (source)
|
||||
* `-t`, `--to <TO>` — Revision to restore into (destination)
|
||||
* `-c`, `--changes-in <REVISION>` — Undo the changes in a revision as compared to the merge of its parents.
|
||||
* `-f`, `--from <REVSET>` — Revision to restore from (source)
|
||||
* `-t`, `--to <REVSETS>` — Revision to restore into (destination)
|
||||
* `-c`, `--changes-in <REVSET>` — Undo the changes in a revision as compared to the merge of its parents.
|
||||
|
||||
This undoes the changes that can be seen with `jj diff -r REVISION`. If `REVISION` only has a single parent, this option is equivalent to `jj restore --to REVISION --from REVISION-`.
|
||||
This undoes the changes that can be seen with `jj diff -r REVSET`. If `REVSET` only has a single parent, this option is equivalent to `jj restore --to REVSET --from REVSET-`.
|
||||
|
||||
The default behavior of `jj restore` is equivalent to `jj restore --changes-in @`.
|
||||
* `--restore-descendants` — Preserve the content (not the diff) when rebasing descendants
|
||||
|
@ -1950,11 +1950,11 @@ Show the current workspace root directory
|
|||
|
||||
Show commit description and changes in a revision
|
||||
|
||||
**Usage:** `jj show [OPTIONS] [REVISION]`
|
||||
**Usage:** `jj show [OPTIONS] [REVSET]`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<REVISION>` — Show changes in this revision, compared to its parent(s)
|
||||
* `<REVSET>` — Show changes in this revision, compared to its parent(s)
|
||||
|
||||
Default value: `@`
|
||||
|
||||
|
@ -1992,8 +1992,8 @@ In other words, for all (A, B, C) where A has (B, C) as parents and C is an ance
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-s`, `--source <SOURCE>` — Simplify specified revision(s) together with their trees of descendants (can be repeated)
|
||||
* `-r`, `--revisions <REVISIONS>` — Simplify specified revision(s) (can be repeated)
|
||||
* `-s`, `--source <REVSETS>` — Simplify specified revision(s) together with their trees of descendants (can be repeated)
|
||||
* `-r`, `--revisions <REVSETS>` — Simplify specified revision(s) (can be repeated)
|
||||
|
||||
If both `--source` and `--revisions` are not provided, this defaults to the `revsets.simplify-parents` setting, or `reachable(@, mutable())` if it is not set.
|
||||
|
||||
|
@ -2080,7 +2080,7 @@ Splitting an empty commit is not supported because the same effect can be achiev
|
|||
|
||||
This is the default if no filesets are provided.
|
||||
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
|
||||
* `-r`, `--revision <REVISION>` — The revision to split
|
||||
* `-r`, `--revision <REVSET>` — The revision to split
|
||||
|
||||
Default value: `@`
|
||||
* `-p`, `--parallel` — Split the revision into two parallel revisions instead of a parent and child
|
||||
|
@ -2109,9 +2109,9 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T
|
|||
|
||||
###### **Options:**
|
||||
|
||||
* `-r`, `--revision <REVISION>` — Revision to squash into its parent (default: @)
|
||||
* `-f`, `--from <FROM>` — Revision(s) to squash from (default: @)
|
||||
* `-t`, `--into <INTO>` — Revision to squash into (default: @)
|
||||
* `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @)
|
||||
* `-f`, `--from <REVSETS>` — Revision(s) to squash from (default: @)
|
||||
* `-t`, `--into <REVSET>` — Revision to squash into (default: @)
|
||||
* `-m`, `--message <MESSAGE>` — The description to use for squashed revision (don't open editor)
|
||||
* `-u`, `--use-destination-message` — Use the description of the destination revision and discard the description(s) of the source revision(s)
|
||||
* `-i`, `--interactive` — Interactively choose which parts to squash
|
||||
|
@ -2394,7 +2394,7 @@ By default, the new workspace inherits the sparse patterns of the current worksp
|
|||
* `--name <NAME>` — A name for the workspace
|
||||
|
||||
To override the default, which is the basename of the destination directory.
|
||||
* `-r`, `--revision <REVISION>` — A list of parent revisions for the working-copy commit of the newly created workspace. You may specify nothing, or any number of parents.
|
||||
* `-r`, `--revision <REVSETS>` — A list of parent revisions for the working-copy commit of the newly created workspace. You may specify nothing, or any number of parents.
|
||||
|
||||
If no revisions are specified, the new workspace will be created, and its working-copy commit will exist on top of the parent(s) of the working-copy commit in the current workspace, i.e. they will share the same parent(s).
|
||||
|
||||
|
|
|
@ -260,9 +260,9 @@ fn test_bookmark_move_matching() {
|
|||
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["bookmark", "move"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the following required arguments were not provided:
|
||||
<--from <REVISIONS>|NAMES>
|
||||
<--from <REVSETS>|NAMES>
|
||||
|
||||
Usage: jj bookmark move <--from <REVISIONS>|NAMES>
|
||||
Usage: jj bookmark move <--from <REVSETS>|NAMES>
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
|
|
@ -30,9 +30,9 @@ fn test_edit() {
|
|||
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["edit"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the following required arguments were not provided:
|
||||
<REVISION>
|
||||
<REVSET>
|
||||
|
||||
Usage: jj edit <REVISION>
|
||||
Usage: jj edit <REVSET>
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
|
|
@ -771,15 +771,15 @@ fn test_help() {
|
|||
let test_env = TestEnvironment::default();
|
||||
|
||||
let stdout = test_env.jj_cmd_success(test_env.env_root(), &["diffedit", "-h"]);
|
||||
insta::assert_snapshot!(stdout, @r"
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
Touch up the content changes in a revision with a diff editor
|
||||
|
||||
Usage: jj diffedit [OPTIONS]
|
||||
|
||||
Options:
|
||||
-r, --revision <REVISION> The revision to touch up
|
||||
-f, --from <FROM> Show changes from this revision
|
||||
-t, --to <TO> Edit changes in this revision
|
||||
-r, --revision <REVSET> The revision to touch up
|
||||
-f, --from <REVSET> Show changes from this revision
|
||||
-t, --to <REVSET> Edit changes in this revision
|
||||
--tool <NAME> Specify diff editor to be used
|
||||
--restore-descendants Preserve the content (not the diff) when rebasing descendants
|
||||
-h, --help Print help (see more with '--help')
|
||||
|
@ -795,7 +795,7 @@ fn test_help() {
|
|||
--no-pager Disable the pager
|
||||
--config <NAME=VALUE> Additional configuration options (can be repeated)
|
||||
--config-file <PATH> Additional configuration files (can be repeated)
|
||||
");
|
||||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -78,11 +78,11 @@ fn test_help() {
|
|||
"#);
|
||||
|
||||
let stderr = test_env.jj_cmd_cli_error(test_env.env_root(), &["help", "log", "--", "-r"]);
|
||||
insta::assert_snapshot!(stderr, @r#"
|
||||
error: a value is required for '--revisions <REVISIONS>' but none was supplied
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: a value is required for '--revisions <REVSETS>' but none was supplied
|
||||
|
||||
For more information, try '--help'.
|
||||
"#);
|
||||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -23,7 +23,7 @@ fn test_log_with_empty_revision() {
|
|||
|
||||
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["log", "-r="]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: a value is required for '--revisions <REVISIONS>' but none was supplied
|
||||
error: a value is required for '--revisions <REVSETS>' but none was supplied
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
|
|
@ -57,7 +57,7 @@ fn test_new() {
|
|||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the argument '--edit' cannot be used with '--no-edit'
|
||||
|
||||
Usage: jj new <REVISIONS>...
|
||||
Usage: jj new <REVSETS>...
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
@ -211,9 +211,9 @@ fn test_new_insert_after() {
|
|||
// --after cannot be used with revisions
|
||||
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["new", "--after", "B", "D"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the argument '--insert-after <INSERT_AFTER>' cannot be used with '[REVISIONS]...'
|
||||
error: the argument '--insert-after <REVSETS>' cannot be used with '[REVSETS]...'
|
||||
|
||||
Usage: jj new --insert-after <INSERT_AFTER> [REVISIONS]...
|
||||
Usage: jj new --insert-after <REVSETS> [REVSETS]...
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
@ -333,9 +333,9 @@ fn test_new_insert_before() {
|
|||
// --before cannot be used with revisions
|
||||
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["new", "--before", "B", "D"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the argument '--insert-before <INSERT_BEFORE>' cannot be used with '[REVISIONS]...'
|
||||
error: the argument '--insert-before <REVSETS>' cannot be used with '[REVSETS]...'
|
||||
|
||||
Usage: jj new --insert-before <INSERT_BEFORE> [REVISIONS]...
|
||||
Usage: jj new --insert-before <REVSETS> [REVSETS]...
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
|
|
@ -41,9 +41,9 @@ fn test_rebase_invalid() {
|
|||
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["rebase"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the following required arguments were not provided:
|
||||
<--destination <DESTINATION>|--insert-after <INSERT_AFTER>|--insert-before <INSERT_BEFORE>>
|
||||
<--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>
|
||||
|
||||
Usage: jj rebase <--destination <DESTINATION>|--insert-after <INSERT_AFTER>|--insert-before <INSERT_BEFORE>>
|
||||
Usage: jj rebase <--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
@ -52,9 +52,9 @@ fn test_rebase_invalid() {
|
|||
let stderr =
|
||||
test_env.jj_cmd_cli_error(&repo_path, &["rebase", "-r", "a", "-s", "a", "-d", "b"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the argument '--revisions <REVISIONS>' cannot be used with '--source <SOURCE>'
|
||||
error: the argument '--revisions <REVSETS>' cannot be used with '--source <REVSETS>'
|
||||
|
||||
Usage: jj rebase --revisions <REVISIONS> <--destination <DESTINATION>|--insert-after <INSERT_AFTER>|--insert-before <INSERT_BEFORE>>
|
||||
Usage: jj rebase --revisions <REVSETS> <--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
@ -63,9 +63,9 @@ fn test_rebase_invalid() {
|
|||
let stderr =
|
||||
test_env.jj_cmd_cli_error(&repo_path, &["rebase", "-b", "a", "-s", "a", "-d", "b"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the argument '--branch <BRANCH>' cannot be used with '--source <SOURCE>'
|
||||
error: the argument '--branch <REVSETS>' cannot be used with '--source <REVSETS>'
|
||||
|
||||
Usage: jj rebase --branch <BRANCH> <--destination <DESTINATION>|--insert-after <INSERT_AFTER>|--insert-before <INSERT_BEFORE>>
|
||||
Usage: jj rebase --branch <REVSETS> <--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
@ -76,9 +76,9 @@ fn test_rebase_invalid() {
|
|||
&["rebase", "-r", "a", "-d", "b", "--after", "b"],
|
||||
);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the argument '--destination <DESTINATION>' cannot be used with '--insert-after <INSERT_AFTER>'
|
||||
error: the argument '--destination <REVSETS>' cannot be used with '--insert-after <REVSETS>'
|
||||
|
||||
Usage: jj rebase --revisions <REVISIONS> <--destination <DESTINATION>|--insert-after <INSERT_AFTER>|--insert-before <INSERT_BEFORE>>
|
||||
Usage: jj rebase --revisions <REVSETS> <--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
@ -89,9 +89,9 @@ fn test_rebase_invalid() {
|
|||
&["rebase", "-r", "a", "-d", "b", "--before", "b"],
|
||||
);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
error: the argument '--destination <DESTINATION>' cannot be used with '--insert-before <INSERT_BEFORE>'
|
||||
error: the argument '--destination <REVSETS>' cannot be used with '--insert-before <REVSETS>'
|
||||
|
||||
Usage: jj rebase --revisions <REVISIONS> <--destination <DESTINATION>|--insert-after <INSERT_AFTER>|--insert-before <INSERT_BEFORE>>
|
||||
Usage: jj rebase --revisions <REVSETS> <--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>
|
||||
|
||||
For more information, try '--help'.
|
||||
"###);
|
||||
|
|
Loading…
Reference in a new issue