formatting only: switch to Item level import ganularity

This commit is contained in:
Matt Kulukundis 2024-08-22 14:18:15 -04:00 committed by Matt Fowles Kulukundis
parent c5af500724
commit 8ead72e99f
232 changed files with 2570 additions and 1092 deletions

View File

@ -19,20 +19,34 @@ use std::time::SystemTime;
use async_trait::async_trait; use async_trait::async_trait;
use futures::stream::BoxStream; use futures::stream::BoxStream;
use jj_cli::cli_util::{CliRunner, CommandHelper}; use jj_cli::cli_util::CliRunner;
use jj_cli::cli_util::CommandHelper;
use jj_cli::command_error::CommandError; use jj_cli::command_error::CommandError;
use jj_cli::ui::Ui; use jj_cli::ui::Ui;
use jj_lib::backend::{ use jj_lib::backend::Backend;
Backend, BackendInitError, BackendLoadError, BackendResult, ChangeId, Commit, CommitId, use jj_lib::backend::BackendInitError;
Conflict, ConflictId, CopyRecord, FileId, SigningFn, SymlinkId, Tree, TreeId, use jj_lib::backend::BackendLoadError;
}; use jj_lib::backend::BackendResult;
use jj_lib::backend::ChangeId;
use jj_lib::backend::Commit;
use jj_lib::backend::CommitId;
use jj_lib::backend::Conflict;
use jj_lib::backend::ConflictId;
use jj_lib::backend::CopyRecord;
use jj_lib::backend::FileId;
use jj_lib::backend::SigningFn;
use jj_lib::backend::SymlinkId;
use jj_lib::backend::Tree;
use jj_lib::backend::TreeId;
use jj_lib::git_backend::GitBackend; use jj_lib::git_backend::GitBackend;
use jj_lib::index::Index; use jj_lib::index::Index;
use jj_lib::repo::StoreFactories; use jj_lib::repo::StoreFactories;
use jj_lib::repo_path::{RepoPath, RepoPathBuf}; use jj_lib::repo_path::RepoPath;
use jj_lib::repo_path::RepoPathBuf;
use jj_lib::settings::UserSettings; use jj_lib::settings::UserSettings;
use jj_lib::signing::Signer; use jj_lib::signing::Signer;
use jj_lib::workspace::{Workspace, WorkspaceInitError}; use jj_lib::workspace::Workspace;
use jj_lib::workspace::WorkspaceInitError;
#[derive(clap::Parser, Clone, Debug)] #[derive(clap::Parser, Clone, Debug)]
enum CustomCommand { enum CustomCommand {

View File

@ -14,7 +14,9 @@
use std::io::Write as _; use std::io::Write as _;
use jj_cli::cli_util::{CliRunner, CommandHelper, RevisionArg}; use jj_cli::cli_util::CliRunner;
use jj_cli::cli_util::CommandHelper;
use jj_cli::cli_util::RevisionArg;
use jj_cli::command_error::CommandError; use jj_cli::command_error::CommandError;
use jj_cli::ui::Ui; use jj_cli::ui::Ui;

View File

@ -17,22 +17,27 @@ use std::rc::Rc;
use itertools::Itertools; use itertools::Itertools;
use jj_cli::cli_util::CliRunner; use jj_cli::cli_util::CliRunner;
use jj_cli::commit_templater::{ use jj_cli::commit_templater::CommitTemplateBuildFnTable;
CommitTemplateBuildFnTable, CommitTemplateLanguage, CommitTemplateLanguageExtension, use jj_cli::commit_templater::CommitTemplateLanguage;
}; use jj_cli::commit_templater::CommitTemplateLanguageExtension;
use jj_cli::template_builder::TemplateLanguage; use jj_cli::template_builder::TemplateLanguage;
use jj_cli::template_parser::{self, TemplateParseError}; use jj_cli::template_parser::TemplateParseError;
use jj_cli::template_parser::{self};
use jj_cli::templater::TemplatePropertyExt as _; use jj_cli::templater::TemplatePropertyExt as _;
use jj_lib::backend::CommitId; use jj_lib::backend::CommitId;
use jj_lib::commit::Commit; use jj_lib::commit::Commit;
use jj_lib::extensions_map::ExtensionsMap; use jj_lib::extensions_map::ExtensionsMap;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::revset::{ use jj_lib::revset::FunctionCallNode;
FunctionCallNode, PartialSymbolResolver, RevsetExpression, RevsetFilterExtension, use jj_lib::revset::PartialSymbolResolver;
RevsetFilterPredicate, RevsetParseContext, RevsetParseError, RevsetResolutionError, use jj_lib::revset::RevsetExpression;
SymbolResolverExtension, use jj_lib::revset::RevsetFilterExtension;
}; use jj_lib::revset::RevsetFilterPredicate;
use jj_lib::revset::RevsetParseContext;
use jj_lib::revset::RevsetParseError;
use jj_lib::revset::RevsetResolutionError;
use jj_lib::revset::SymbolResolverExtension;
use once_cell::sync::OnceCell; use once_cell::sync::OnceCell;
struct HexCounter; struct HexCounter;

View File

@ -13,11 +13,12 @@
// limitations under the License. // limitations under the License.
use jj_cli::cli_util::CliRunner; use jj_cli::cli_util::CliRunner;
use jj_cli::operation_templater::{ use jj_cli::operation_templater::OperationTemplateBuildFnTable;
OperationTemplateBuildFnTable, OperationTemplateLanguage, OperationTemplateLanguageExtension, use jj_cli::operation_templater::OperationTemplateLanguage;
}; use jj_cli::operation_templater::OperationTemplateLanguageExtension;
use jj_cli::template_builder::TemplateLanguage; use jj_cli::template_builder::TemplateLanguage;
use jj_cli::template_parser::{self, TemplateParseError}; use jj_cli::template_parser::TemplateParseError;
use jj_cli::template_parser::{self};
use jj_cli::templater::TemplatePropertyExt as _; use jj_cli::templater::TemplatePropertyExt as _;
use jj_lib::extensions_map::ExtensionsMap; use jj_lib::extensions_map::ExtensionsMap;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;

View File

@ -13,28 +13,39 @@
// limitations under the License. // limitations under the License.
use std::any::Any; use std::any::Any;
use std::path::{Path, PathBuf}; use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
use itertools::Itertools; use itertools::Itertools;
use jj_cli::cli_util::{CliRunner, CommandHelper}; use jj_cli::cli_util::CliRunner;
use jj_cli::cli_util::CommandHelper;
use jj_cli::command_error::CommandError; use jj_cli::command_error::CommandError;
use jj_cli::ui::Ui; use jj_cli::ui::Ui;
use jj_lib::backend::{Backend, MergedTreeId}; use jj_lib::backend::Backend;
use jj_lib::backend::MergedTreeId;
use jj_lib::commit::Commit; use jj_lib::commit::Commit;
use jj_lib::git_backend::GitBackend; use jj_lib::git_backend::GitBackend;
use jj_lib::local_working_copy::LocalWorkingCopy; use jj_lib::local_working_copy::LocalWorkingCopy;
use jj_lib::op_store::{OperationId, WorkspaceId}; use jj_lib::op_store::OperationId;
use jj_lib::op_store::WorkspaceId;
use jj_lib::repo::ReadonlyRepo; use jj_lib::repo::ReadonlyRepo;
use jj_lib::repo_path::RepoPathBuf; use jj_lib::repo_path::RepoPathBuf;
use jj_lib::settings::UserSettings; use jj_lib::settings::UserSettings;
use jj_lib::signing::Signer; use jj_lib::signing::Signer;
use jj_lib::store::Store; use jj_lib::store::Store;
use jj_lib::working_copy::{ use jj_lib::working_copy::CheckoutError;
CheckoutError, CheckoutStats, LockedWorkingCopy, ResetError, SnapshotError, SnapshotOptions, use jj_lib::working_copy::CheckoutStats;
WorkingCopy, WorkingCopyFactory, WorkingCopyStateError, use jj_lib::working_copy::LockedWorkingCopy;
}; use jj_lib::working_copy::ResetError;
use jj_lib::workspace::{WorkingCopyFactories, Workspace, WorkspaceInitError}; use jj_lib::working_copy::SnapshotError;
use jj_lib::working_copy::SnapshotOptions;
use jj_lib::working_copy::WorkingCopy;
use jj_lib::working_copy::WorkingCopyFactory;
use jj_lib::working_copy::WorkingCopyStateError;
use jj_lib::workspace::WorkingCopyFactories;
use jj_lib::workspace::Workspace;
use jj_lib::workspace::WorkspaceInitError;
#[derive(clap::Parser, Clone, Debug)] #[derive(clap::Parser, Clone, Debug)]
enum CustomCommand { enum CustomCommand {

View File

@ -1,5 +1,6 @@
use std::io; use std::io;
use std::sync::{Mutex, Once}; use std::sync::Mutex;
use std::sync::Once;
use slab::Slab; use slab::Slab;
use tracing::instrument; use tracing::instrument;
@ -46,13 +47,17 @@ impl Drop for CleanupGuard {
#[cfg(unix)] #[cfg(unix)]
mod platform { mod platform {
use std::os::unix::io::{IntoRawFd as _, RawFd}; use std::os::unix::io::IntoRawFd as _;
use std::os::unix::io::RawFd;
use std::os::unix::net::UnixDatagram; use std::os::unix::net::UnixDatagram;
use std::panic::AssertUnwindSafe; use std::panic::AssertUnwindSafe;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering;
use std::thread; use std::thread;
use libc::{c_int, SIGINT, SIGTERM}; use libc::c_int;
use libc::SIGINT;
use libc::SIGTERM;
use super::*; use super::*;

View File

@ -14,94 +14,156 @@
use core::fmt; use core::fmt;
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::{BTreeMap, HashSet}; use std::collections::BTreeMap;
use std::env::{self, ArgsOs, VarError}; use std::collections::HashSet;
use std::env::ArgsOs;
use std::env::VarError;
use std::env::{self};
use std::ffi::OsString; use std::ffi::OsString;
use std::fmt::Debug; use std::fmt::Debug;
use std::io::{self, Write as _}; use std::fs;
use std::path::{Path, PathBuf}; use std::io::Write as _;
use std::io::{self};
use std::mem;
use std::path::Path;
use std::path::PathBuf;
use std::process::ExitCode; use std::process::ExitCode;
use std::rc::Rc; use std::rc::Rc;
use std::str;
use std::str::FromStr; use std::str::FromStr;
use std::sync::Arc; use std::sync::Arc;
use std::time::SystemTime; use std::time::SystemTime;
use std::{fs, mem, str};
use bstr::ByteVec as _; use bstr::ByteVec as _;
use chrono::TimeZone; use chrono::TimeZone;
use clap::builder::{ use clap::builder::MapValueParser;
MapValueParser, NonEmptyStringValueParser, TypedValueParser, ValueParserFactory, use clap::builder::NonEmptyStringValueParser;
}; use clap::builder::TypedValueParser;
use clap::error::{ContextKind, ContextValue}; use clap::builder::ValueParserFactory;
use clap::{ArgAction, ArgMatches, Command, FromArgMatches}; use clap::error::ContextKind;
use indexmap::{IndexMap, IndexSet}; use clap::error::ContextValue;
use clap::ArgAction;
use clap::ArgMatches;
use clap::Command;
use clap::FromArgMatches;
use indexmap::IndexMap;
use indexmap::IndexSet;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::{ChangeId, CommitId, MergedTreeId, TreeValue}; use jj_lib::backend::ChangeId;
use jj_lib::backend::CommitId;
use jj_lib::backend::MergedTreeId;
use jj_lib::backend::TreeValue;
use jj_lib::commit::Commit; use jj_lib::commit::Commit;
use jj_lib::dag_walk;
use jj_lib::file_util;
use jj_lib::fileset;
use jj_lib::fileset::FilesetExpression; use jj_lib::fileset::FilesetExpression;
use jj_lib::git;
use jj_lib::git_backend::GitBackend; use jj_lib::git_backend::GitBackend;
use jj_lib::gitignore::{GitIgnoreError, GitIgnoreFile}; use jj_lib::gitignore::GitIgnoreError;
use jj_lib::gitignore::GitIgnoreFile;
use jj_lib::hex_util::to_reverse_hex; use jj_lib::hex_util::to_reverse_hex;
use jj_lib::id_prefix::IdPrefixContext; use jj_lib::id_prefix::IdPrefixContext;
use jj_lib::matchers::Matcher; use jj_lib::matchers::Matcher;
use jj_lib::merge::MergedTreeValue; use jj_lib::merge::MergedTreeValue;
use jj_lib::merged_tree::MergedTree; use jj_lib::merged_tree::MergedTree;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use jj_lib::op_store::{OpStoreError, OperationId, RefTarget, WorkspaceId}; use jj_lib::op_heads_store;
use jj_lib::op_store::OpStoreError;
use jj_lib::op_store::OperationId;
use jj_lib::op_store::RefTarget;
use jj_lib::op_store::WorkspaceId;
use jj_lib::op_walk;
use jj_lib::op_walk::OpsetEvaluationError; use jj_lib::op_walk::OpsetEvaluationError;
use jj_lib::operation::Operation; use jj_lib::operation::Operation;
use jj_lib::repo::{ use jj_lib::repo::merge_factories_map;
merge_factories_map, CheckOutCommitError, EditCommitError, MutableRepo, ReadonlyRepo, Repo, use jj_lib::repo::CheckOutCommitError;
RepoLoader, StoreFactories, StoreLoadError, use jj_lib::repo::EditCommitError;
}; use jj_lib::repo::MutableRepo;
use jj_lib::repo_path::{RepoPath, RepoPathBuf, RepoPathUiConverter, UiPathParseError}; use jj_lib::repo::ReadonlyRepo;
use jj_lib::revset::{ use jj_lib::repo::Repo;
RevsetAliasesMap, RevsetExpression, RevsetExtensions, RevsetFilterPredicate, RevsetFunction, use jj_lib::repo::RepoLoader;
RevsetIteratorExt, RevsetModifier, RevsetParseContext, RevsetWorkspaceContext, use jj_lib::repo::StoreFactories;
SymbolResolverExtension, use jj_lib::repo::StoreLoadError;
}; use jj_lib::repo_path::RepoPath;
use jj_lib::repo_path::RepoPathBuf;
use jj_lib::repo_path::RepoPathUiConverter;
use jj_lib::repo_path::UiPathParseError;
use jj_lib::revset;
use jj_lib::revset::RevsetAliasesMap;
use jj_lib::revset::RevsetExpression;
use jj_lib::revset::RevsetExtensions;
use jj_lib::revset::RevsetFilterPredicate;
use jj_lib::revset::RevsetFunction;
use jj_lib::revset::RevsetIteratorExt;
use jj_lib::revset::RevsetModifier;
use jj_lib::revset::RevsetParseContext;
use jj_lib::revset::RevsetWorkspaceContext;
use jj_lib::revset::SymbolResolverExtension;
use jj_lib::rewrite::restore_tree; use jj_lib::rewrite::restore_tree;
use jj_lib::settings::{ConfigResultExt as _, UserSettings}; use jj_lib::settings::ConfigResultExt as _;
use jj_lib::settings::UserSettings;
use jj_lib::signing::SignInitError; use jj_lib::signing::SignInitError;
use jj_lib::str_util::StringPattern; use jj_lib::str_util::StringPattern;
use jj_lib::transaction::Transaction; use jj_lib::transaction::Transaction;
use jj_lib::view::View; use jj_lib::view::View;
use jj_lib::working_copy::{ use jj_lib::working_copy::CheckoutStats;
CheckoutStats, LockedWorkingCopy, SnapshotOptions, WorkingCopy, WorkingCopyFactory, use jj_lib::working_copy::LockedWorkingCopy;
}; use jj_lib::working_copy::SnapshotOptions;
use jj_lib::workspace::{ use jj_lib::working_copy::WorkingCopy;
default_working_copy_factories, LockedWorkspace, WorkingCopyFactories, Workspace, use jj_lib::working_copy::WorkingCopyFactory;
WorkspaceLoadError, WorkspaceLoader, use jj_lib::workspace::default_working_copy_factories;
}; use jj_lib::workspace::LockedWorkspace;
use jj_lib::{dag_walk, file_util, fileset, git, op_heads_store, op_walk, revset}; use jj_lib::workspace::WorkingCopyFactories;
use jj_lib::workspace::Workspace;
use jj_lib::workspace::WorkspaceLoadError;
use jj_lib::workspace::WorkspaceLoader;
use once_cell::unsync::OnceCell; use once_cell::unsync::OnceCell;
use tracing::instrument; use tracing::instrument;
use tracing_chrome::ChromeLayerBuilder; use tracing_chrome::ChromeLayerBuilder;
use tracing_subscriber::prelude::*; use tracing_subscriber::prelude::*;
use crate::command_error::{ use crate::command_error::cli_error;
cli_error, config_error_with_message, handle_command_result, internal_error, use crate::command_error::config_error_with_message;
internal_error_with_message, user_error, user_error_with_hint, user_error_with_message, use crate::command_error::handle_command_result;
CommandError, use crate::command_error::internal_error;
}; use crate::command_error::internal_error_with_message;
use crate::commit_templater::{CommitTemplateLanguage, CommitTemplateLanguageExtension}; use crate::command_error::user_error;
use crate::config::{ use crate::command_error::user_error_with_hint;
new_config_path, AnnotatedValue, CommandNameAndArgs, ConfigNamePathBuf, ConfigSource, use crate::command_error::user_error_with_message;
LayeredConfigs, use crate::command_error::CommandError;
}; use crate::commit_templater::CommitTemplateLanguage;
use crate::diff_util::{self, DiffFormat, DiffFormatArgs, DiffRenderer}; use crate::commit_templater::CommitTemplateLanguageExtension;
use crate::formatter::{FormatRecorder, Formatter, PlainTextFormatter}; use crate::config::new_config_path;
use crate::git_util::{ use crate::config::AnnotatedValue;
is_colocated_git_workspace, print_failed_git_export, print_git_import_stats, use crate::config::CommandNameAndArgs;
}; use crate::config::ConfigNamePathBuf;
use crate::merge_tools::{DiffEditor, MergeEditor, MergeToolConfigError}; use crate::config::ConfigSource;
use crate::config::LayeredConfigs;
use crate::diff_util::DiffFormat;
use crate::diff_util::DiffFormatArgs;
use crate::diff_util::DiffRenderer;
use crate::diff_util::{self};
use crate::formatter::FormatRecorder;
use crate::formatter::Formatter;
use crate::formatter::PlainTextFormatter;
use crate::git_util::is_colocated_git_workspace;
use crate::git_util::print_failed_git_export;
use crate::git_util::print_git_import_stats;
use crate::merge_tools::DiffEditor;
use crate::merge_tools::MergeEditor;
use crate::merge_tools::MergeToolConfigError;
use crate::operation_templater::OperationTemplateLanguageExtension; use crate::operation_templater::OperationTemplateLanguageExtension;
use crate::revset_util;
use crate::revset_util::RevsetExpressionEvaluator; use crate::revset_util::RevsetExpressionEvaluator;
use crate::template_builder;
use crate::template_builder::TemplateLanguage; use crate::template_builder::TemplateLanguage;
use crate::template_parser::TemplateAliasesMap; use crate::template_parser::TemplateAliasesMap;
use crate::templater::{PropertyPlaceholder, TemplateRenderer}; use crate::templater::PropertyPlaceholder;
use crate::ui::{ColorChoice, Ui}; use crate::templater::TemplateRenderer;
use crate::{revset_util, template_builder, text_util}; use crate::text_util;
use crate::ui::ColorChoice;
use crate::ui::Ui;
#[derive(Clone)] #[derive(Clone)]
struct ChromeTracingFlushGuard { struct ChromeTracingFlushGuard {

View File

@ -12,37 +12,57 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use std::error;
use std::io;
use std::io::Write as _; use std::io::Write as _;
use std::iter;
use std::process::ExitCode; use std::process::ExitCode;
use std::str;
use std::sync::Arc; use std::sync::Arc;
use std::{error, io, iter, str};
use itertools::Itertools as _; use itertools::Itertools as _;
use jj_lib::backend::BackendError; use jj_lib::backend::BackendError;
use jj_lib::fileset::{FilePatternParseError, FilesetParseError, FilesetParseErrorKind}; use jj_lib::fileset::FilePatternParseError;
use jj_lib::git::{GitConfigParseError, GitExportError, GitImportError, GitRemoteManagementError}; use jj_lib::fileset::FilesetParseError;
use jj_lib::fileset::FilesetParseErrorKind;
use jj_lib::git::GitConfigParseError;
use jj_lib::git::GitExportError;
use jj_lib::git::GitImportError;
use jj_lib::git::GitRemoteManagementError;
use jj_lib::gitignore::GitIgnoreError; use jj_lib::gitignore::GitIgnoreError;
use jj_lib::op_heads_store::OpHeadResolutionError; use jj_lib::op_heads_store::OpHeadResolutionError;
use jj_lib::op_store::OpStoreError; use jj_lib::op_store::OpStoreError;
use jj_lib::op_walk::{OpsetEvaluationError, OpsetResolutionError}; use jj_lib::op_walk::OpsetEvaluationError;
use jj_lib::repo::{CheckOutCommitError, EditCommitError, RepoLoaderError, RewriteRootCommit}; use jj_lib::op_walk::OpsetResolutionError;
use jj_lib::repo_path::{RepoPathBuf, UiPathParseError}; use jj_lib::repo::CheckOutCommitError;
use jj_lib::revset::{ use jj_lib::repo::EditCommitError;
RevsetEvaluationError, RevsetParseError, RevsetParseErrorKind, RevsetResolutionError, use jj_lib::repo::RepoLoaderError;
}; use jj_lib::repo::RewriteRootCommit;
use jj_lib::repo_path::RepoPathBuf;
use jj_lib::repo_path::UiPathParseError;
use jj_lib::revset::RevsetEvaluationError;
use jj_lib::revset::RevsetParseError;
use jj_lib::revset::RevsetParseErrorKind;
use jj_lib::revset::RevsetResolutionError;
use jj_lib::signing::SignInitError; use jj_lib::signing::SignInitError;
use jj_lib::str_util::StringPatternParseError; use jj_lib::str_util::StringPatternParseError;
use jj_lib::working_copy::{ResetError, SnapshotError, WorkingCopyStateError}; use jj_lib::working_copy::ResetError;
use jj_lib::working_copy::SnapshotError;
use jj_lib::working_copy::WorkingCopyStateError;
use jj_lib::workspace::WorkspaceInitError; use jj_lib::workspace::WorkspaceInitError;
use thiserror::Error; use thiserror::Error;
use crate::cli_util::short_operation_hash; use crate::cli_util::short_operation_hash;
use crate::description_util::ParseBulkEditMessageError; use crate::description_util::ParseBulkEditMessageError;
use crate::diff_util::DiffRenderError; use crate::diff_util::DiffRenderError;
use crate::formatter::{FormatRecorder, Formatter}; use crate::formatter::FormatRecorder;
use crate::merge_tools::{ConflictResolveError, DiffEditError, MergeToolConfigError}; use crate::formatter::Formatter;
use crate::merge_tools::ConflictResolveError;
use crate::merge_tools::DiffEditError;
use crate::merge_tools::MergeToolConfigError;
use crate::revset_util::UserRevsetEvaluationError; use crate::revset_util::UserRevsetEvaluationError;
use crate::template_parser::{TemplateParseError, TemplateParseErrorKind}; use crate::template_parser::TemplateParseError;
use crate::template_parser::TemplateParseErrorKind;
use crate::ui::Ui; use crate::ui::Ui;
#[derive(Clone, Copy, Debug, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]

View File

@ -19,7 +19,8 @@ use jj_lib::commit::CommitIteratorExt;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -17,7 +17,8 @@ use jj_lib::object_id::ObjectId;
use jj_lib::rewrite::merge_commit_trees; use jj_lib::rewrite::merge_commit_trees;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -20,12 +20,20 @@ use std::time::Instant;
use clap::Subcommand; use clap::Subcommand;
use criterion::measurement::Measurement; use criterion::measurement::Measurement;
use criterion::{BatchSize, BenchmarkGroup, BenchmarkId, Criterion}; use criterion::BatchSize;
use criterion::BenchmarkGroup;
use criterion::BenchmarkId;
use criterion::Criterion;
use jj_lib::object_id::HexPrefix; use jj_lib::object_id::HexPrefix;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::revset::{self, DefaultSymbolResolver, RevsetExpression, SymbolResolverExtension}; use jj_lib::revset::DefaultSymbolResolver;
use jj_lib::revset::RevsetExpression;
use jj_lib::revset::SymbolResolverExtension;
use jj_lib::revset::{self};
use crate::cli_util::{CommandHelper, RevisionArg, WorkspaceCommandHelper}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::cli_util::WorkspaceCommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -17,8 +17,10 @@ use jj_lib::object_id::ObjectId as _;
use jj_lib::op_store::RefTarget; use jj_lib::op_store::RefTarget;
use super::has_tracked_remote_branches; use super::has_tracked_remote_branches;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error_with_hint, CommandError}; use crate::cli_util::RevisionArg;
use crate::command_error::user_error_with_hint;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Create a new branch /// Create a new branch

View File

@ -13,7 +13,9 @@
// limitations under the License. // limitations under the License.
use itertools::Itertools as _; use itertools::Itertools as _;
use jj_lib::op_store::{BranchTarget, RefTarget, RemoteRef}; use jj_lib::op_store::BranchTarget;
use jj_lib::op_store::RefTarget;
use jj_lib::op_store::RemoteRef;
use jj_lib::str_util::StringPattern; use jj_lib::str_util::StringPattern;
use jj_lib::view::View; use jj_lib::view::View;

View File

@ -18,9 +18,11 @@ use jj_lib::git;
use jj_lib::revset::RevsetExpression; use jj_lib::revset::RevsetExpression;
use jj_lib::str_util::StringPattern; use jj_lib::str_util::StringPattern;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::commit_templater::{CommitTemplateLanguage, RefName}; use crate::commit_templater::CommitTemplateLanguage;
use crate::commit_templater::RefName;
use crate::ui::Ui; use crate::ui::Ui;
/// List branches and their targets /// List branches and their targets

View File

@ -25,22 +25,35 @@ mod untrack;
use itertools::Itertools as _; use itertools::Itertools as _;
use jj_lib::backend::CommitId; use jj_lib::backend::CommitId;
use jj_lib::git; use jj_lib::git;
use jj_lib::op_store::{RefTarget, RemoteRef}; use jj_lib::op_store::RefTarget;
use jj_lib::op_store::RemoteRef;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::str_util::StringPattern; use jj_lib::str_util::StringPattern;
use jj_lib::view::View; use jj_lib::view::View;
use self::create::{cmd_branch_create, BranchCreateArgs}; use self::create::cmd_branch_create;
use self::delete::{cmd_branch_delete, BranchDeleteArgs}; use self::create::BranchCreateArgs;
use self::forget::{cmd_branch_forget, BranchForgetArgs}; use self::delete::cmd_branch_delete;
use self::list::{cmd_branch_list, BranchListArgs}; use self::delete::BranchDeleteArgs;
use self::r#move::{cmd_branch_move, BranchMoveArgs}; use self::forget::cmd_branch_forget;
use self::rename::{cmd_branch_rename, BranchRenameArgs}; use self::forget::BranchForgetArgs;
use self::set::{cmd_branch_set, BranchSetArgs}; use self::list::cmd_branch_list;
use self::track::{cmd_branch_track, BranchTrackArgs}; use self::list::BranchListArgs;
use self::untrack::{cmd_branch_untrack, BranchUntrackArgs}; use self::r#move::cmd_branch_move;
use crate::cli_util::{CommandHelper, RemoteBranchName, RemoteBranchNamePattern}; use self::r#move::BranchMoveArgs;
use crate::command_error::{user_error, CommandError}; use self::rename::cmd_branch_rename;
use self::rename::BranchRenameArgs;
use self::set::cmd_branch_set;
use self::set::BranchSetArgs;
use self::track::cmd_branch_track;
use self::track::BranchTrackArgs;
use self::untrack::cmd_branch_untrack;
use self::untrack::BranchUntrackArgs;
use crate::cli_util::CommandHelper;
use crate::cli_util::RemoteBranchName;
use crate::cli_util::RemoteBranchNamePattern;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Manage branches /// Manage branches

View File

@ -18,9 +18,12 @@ use jj_lib::object_id::ObjectId as _;
use jj_lib::op_store::RefTarget; use jj_lib::op_store::RefTarget;
use jj_lib::str_util::StringPattern; use jj_lib::str_util::StringPattern;
use super::{find_branches_with, is_fast_forward}; use super::find_branches_with;
use crate::cli_util::{CommandHelper, RevisionArg}; use super::is_fast_forward;
use crate::command_error::{user_error_with_hint, CommandError}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::user_error_with_hint;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Move existing branches to target revision /// Move existing branches to target revision

View File

@ -16,7 +16,8 @@ use jj_lib::op_store::RefTarget;
use super::has_tracked_remote_branches; use super::has_tracked_remote_branches;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Rename `old` branch name to `new` branch name /// Rename `old` branch name to `new` branch name

View File

@ -16,9 +16,12 @@ use clap::builder::NonEmptyStringValueParser;
use jj_lib::object_id::ObjectId as _; use jj_lib::object_id::ObjectId as _;
use jj_lib::op_store::RefTarget; use jj_lib::op_store::RefTarget;
use super::{has_tracked_remote_branches, is_fast_forward}; use super::has_tracked_remote_branches;
use crate::cli_util::{CommandHelper, RevisionArg}; use super::is_fast_forward;
use crate::command_error::{user_error_with_hint, CommandError}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::user_error_with_hint;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Create or update a branch to point to a certain commit /// Create or update a branch to point to a certain commit

View File

@ -17,9 +17,11 @@ use std::collections::HashMap;
use itertools::Itertools as _; use itertools::Itertools as _;
use super::find_remote_branches; use super::find_remote_branches;
use crate::cli_util::{CommandHelper, RemoteBranchNamePattern}; use crate::cli_util::CommandHelper;
use crate::cli_util::RemoteBranchNamePattern;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::commit_templater::{CommitTemplateLanguage, RefName}; use crate::commit_templater::CommitTemplateLanguage;
use crate::commit_templater::RefName;
use crate::ui::Ui; use crate::ui::Ui;
/// Start tracking given remote branches /// Start tracking given remote branches

View File

@ -16,7 +16,8 @@ use itertools::Itertools as _;
use jj_lib::git; use jj_lib::git;
use super::find_remote_branches; use super::find_remote_branches;
use crate::cli_util::{CommandHelper, RemoteBranchNamePattern}; use crate::cli_util::CommandHelper;
use crate::cli_util::RemoteBranchNamePattern;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -15,7 +15,8 @@
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::description_util::join_message_paragraphs; use crate::description_util::join_message_paragraphs;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -17,8 +17,11 @@ use jj_lib::repo::Repo;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::description_util::{description_template, edit_description, join_message_paragraphs}; use crate::command_error::CommandError;
use crate::description_util::description_template;
use crate::description_util::edit_description;
use crate::description_util::join_message_paragraphs;
use crate::ui::Ui; use crate::ui::Ui;
/// Update the description and create a new change on top. /// Update the description and create a new change on top.

View File

@ -15,7 +15,9 @@
use tracing::instrument; use tracing::instrument;
use super::ConfigLevelArgs; use super::ConfigLevelArgs;
use crate::cli_util::{get_new_config_file_path, run_ui_editor, CommandHelper}; use crate::cli_util::get_new_config_file_path;
use crate::cli_util::run_ui_editor;
use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -17,7 +17,8 @@ use std::io::Write as _;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{config_error, CommandError}; use crate::command_error::config_error;
use crate::command_error::CommandError;
use crate::config::ConfigNamePathBuf; use crate::config::ConfigNamePathBuf;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -17,7 +17,10 @@ use tracing::instrument;
use super::ConfigLevelArgs; use super::ConfigLevelArgs;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::config::{to_toml_value, AnnotatedValue, ConfigNamePathBuf, ConfigSource}; use crate::config::to_toml_value;
use crate::config::AnnotatedValue;
use crate::config::ConfigNamePathBuf;
use crate::config::ConfigSource;
use crate::generic_templater::GenericTemplateLanguage; use crate::generic_templater::GenericTemplateLanguage;
use crate::template_builder::TemplateLanguage as _; use crate::template_builder::TemplateLanguage as _;
use crate::templater::TemplatePropertyExt as _; use crate::templater::TemplatePropertyExt as _;

View File

@ -20,11 +20,16 @@ mod set;
use tracing::instrument; use tracing::instrument;
use self::edit::{cmd_config_edit, ConfigEditArgs}; use self::edit::cmd_config_edit;
use self::get::{cmd_config_get, ConfigGetArgs}; use self::edit::ConfigEditArgs;
use self::list::{cmd_config_list, ConfigListArgs}; use self::get::cmd_config_get;
use self::path::{cmd_config_path, ConfigPathArgs}; use self::get::ConfigGetArgs;
use self::set::{cmd_config_set, ConfigSetArgs}; use self::list::cmd_config_list;
use self::list::ConfigListArgs;
use self::path::cmd_config_path;
use self::path::ConfigPathArgs;
use self::set::cmd_config_set;
use self::set::ConfigSetArgs;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::config::ConfigSource; use crate::config::ConfigSource;

View File

@ -17,8 +17,10 @@ use std::io::Write as _;
use tracing::instrument; use tracing::instrument;
use super::ConfigLevelArgs; use super::ConfigLevelArgs;
use crate::cli_util::{get_new_config_file_path, CommandHelper}; use crate::cli_util::get_new_config_file_path;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Print the path to the config file /// Print the path to the config file

View File

@ -19,11 +19,14 @@ use jj_lib::repo::Repo;
use tracing::instrument; use tracing::instrument;
use super::ConfigLevelArgs; use super::ConfigLevelArgs;
use crate::cli_util::{get_new_config_file_path, CommandHelper, WorkspaceCommandHelper}; use crate::cli_util::get_new_config_file_path;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::config::{ use crate::cli_util::WorkspaceCommandHelper;
parse_toml_value_or_bare_string, write_config_value_to_file, ConfigNamePathBuf, use crate::command_error::user_error;
}; use crate::command_error::CommandError;
use crate::config::parse_toml_value_or_bare_string;
use crate::config::write_config_value_to_file;
use crate::config::ConfigNamePathBuf;
use crate::ui::Ui; use crate::ui::Ui;
/// Update config file to set the given option to a given value. /// Update config file to set the given option to a given value.

View File

@ -16,9 +16,11 @@ use std::fmt::Debug;
use std::io::Write as _; use std::io::Write as _;
use futures::executor::block_on_stream; use futures::executor::block_on_stream;
use jj_lib::backend::{Backend, CopyRecord}; use jj_lib::backend::Backend;
use jj_lib::backend::CopyRecord;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -15,10 +15,13 @@
use std::fmt::Debug; use std::fmt::Debug;
use std::io::Write as _; use std::io::Write as _;
use jj_lib::default_index::{AsCompositeIndex as _, DefaultReadonlyIndex}; use jj_lib::default_index::AsCompositeIndex as _;
use jj_lib::default_index::DefaultReadonlyIndex;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{internal_error, user_error, CommandError}; use crate::command_error::internal_error;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Show commit index stats /// Show commit index stats

View File

@ -31,20 +31,33 @@ use std::fmt::Debug;
use clap::Subcommand; use clap::Subcommand;
use jj_lib::local_working_copy::LocalWorkingCopy; use jj_lib::local_working_copy::LocalWorkingCopy;
use self::copy_detection::{cmd_debug_copy_detection, CopyDetectionArgs}; use self::copy_detection::cmd_debug_copy_detection;
use self::fileset::{cmd_debug_fileset, DebugFilesetArgs}; use self::copy_detection::CopyDetectionArgs;
use self::index::{cmd_debug_index, DebugIndexArgs}; use self::fileset::cmd_debug_fileset;
use self::local_working_copy::{cmd_debug_local_working_copy, DebugLocalWorkingCopyArgs}; use self::fileset::DebugFilesetArgs;
use self::operation::{cmd_debug_operation, DebugOperationArgs}; use self::index::cmd_debug_index;
use self::reindex::{cmd_debug_reindex, DebugReindexArgs}; use self::index::DebugIndexArgs;
use self::revset::{cmd_debug_revset, DebugRevsetArgs}; use self::local_working_copy::cmd_debug_local_working_copy;
use self::snapshot::{cmd_debug_snapshot, DebugSnapshotArgs}; use self::local_working_copy::DebugLocalWorkingCopyArgs;
use self::template::{cmd_debug_template, DebugTemplateArgs}; use self::operation::cmd_debug_operation;
use self::tree::{cmd_debug_tree, DebugTreeArgs}; use self::operation::DebugOperationArgs;
use self::watchman::{cmd_debug_watchman, DebugWatchmanCommand}; use self::reindex::cmd_debug_reindex;
use self::working_copy::{cmd_debug_working_copy, DebugWorkingCopyArgs}; use self::reindex::DebugReindexArgs;
use self::revset::cmd_debug_revset;
use self::revset::DebugRevsetArgs;
use self::snapshot::cmd_debug_snapshot;
use self::snapshot::DebugSnapshotArgs;
use self::template::cmd_debug_template;
use self::template::DebugTemplateArgs;
use self::tree::cmd_debug_tree;
use self::tree::DebugTreeArgs;
use self::watchman::cmd_debug_watchman;
use self::watchman::DebugWatchmanCommand;
use self::working_copy::cmd_debug_working_copy;
use self::working_copy::DebugWorkingCopyArgs;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Low-level commands not intended for users /// Low-level commands not intended for users

View File

@ -15,10 +15,13 @@
use std::fmt::Debug; use std::fmt::Debug;
use std::io::Write as _; use std::io::Write as _;
use jj_lib::default_index::{AsCompositeIndex as _, DefaultIndexStore}; use jj_lib::default_index::AsCompositeIndex as _;
use jj_lib::default_index::DefaultIndexStore;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{internal_error, user_error, CommandError}; use crate::command_error::internal_error;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Rebuild commit index /// Rebuild commit index

View File

@ -20,8 +20,10 @@ use jj_lib::merged_tree::MergedTree;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::repo_path::RepoPathBuf; use jj_lib::repo_path::RepoPathBuf;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// List the recursive entries of a tree. /// List the recursive entries of a tree.

View File

@ -20,12 +20,15 @@ use std::io::Write as _;
use clap::Subcommand; use clap::Subcommand;
#[cfg(feature = "watchman")] #[cfg(feature = "watchman")]
use jj_lib::fsmonitor::{FsmonitorSettings, WatchmanConfig}; use jj_lib::fsmonitor::FsmonitorSettings;
#[cfg(feature = "watchman")]
use jj_lib::fsmonitor::WatchmanConfig;
#[cfg(feature = "watchman")] #[cfg(feature = "watchman")]
use jj_lib::local_working_copy::LocalWorkingCopy; use jj_lib::local_working_copy::LocalWorkingCopy;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
#[derive(Subcommand, Clone, Debug)] #[derive(Subcommand, Clone, Debug)]

View File

@ -13,19 +13,23 @@
// limitations under the License. // limitations under the License.
use std::collections::HashMap; use std::collections::HashMap;
use std::io::{self, Read}; use std::io::Read;
use std::io::{self};
use itertools::Itertools; use itertools::Itertools;
use jj_lib::commit::CommitIteratorExt; use jj_lib::commit::CommitIteratorExt;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::RevisionArg;
use crate::description_util::{ use crate::command_error::user_error;
description_template, edit_description, edit_multiple_descriptions, join_message_paragraphs, use crate::command_error::CommandError;
ParsedBulkEditMessage, use crate::description_util::description_template;
}; use crate::description_util::edit_description;
use crate::description_util::edit_multiple_descriptions;
use crate::description_util::join_message_paragraphs;
use crate::description_util::ParsedBulkEditMessage;
use crate::ui::Ui; use crate::ui::Ui;
/// Update the change description or other metadata /// Update the change description or other metadata

View File

@ -18,9 +18,12 @@ use jj_lib::repo::Repo;
use jj_lib::rewrite::merge_commit_trees; use jj_lib::rewrite::merge_commit_trees;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{print_unmatched_explicit_paths, CommandHelper, RevisionArg}; use crate::cli_util::print_unmatched_explicit_paths;
use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::diff_util::{get_copy_records, DiffFormatArgs}; use crate::diff_util::get_copy_records;
use crate::diff_util::DiffFormatArgs;
use crate::ui::Ui; use crate::ui::Ui;
/// Compare file contents between two revisions /// Compare file contents between two revisions

View File

@ -20,7 +20,8 @@ use jj_lib::object_id::ObjectId;
use jj_lib::rewrite::merge_commit_trees; use jj_lib::rewrite::merge_commit_trees;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -20,8 +20,11 @@ use jj_lib::commit::Commit;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{short_commit_hash, CommandHelper, RevisionArg}; use crate::cli_util::short_commit_hash;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Create a new change with the same content as an existing one /// Create a new change with the same content as an existing one

View File

@ -17,7 +17,8 @@ use std::io::Write;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -17,8 +17,11 @@ use jj_lib::merged_tree::MergedTreeBuilder;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{print_unmatched_explicit_paths, CommandHelper, RevisionArg}; use crate::cli_util::print_unmatched_explicit_paths;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)]

View File

@ -16,7 +16,8 @@ use std::io::Write;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -12,21 +12,26 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use std::io::{self, Write}; use std::io::Write;
use std::io::{self};
use jj_lib::backend::BackendResult; use jj_lib::backend::BackendResult;
use jj_lib::conflicts::{materialize_tree_value, MaterializedTreeValue}; use jj_lib::conflicts::materialize_tree_value;
use jj_lib::fileset::{FilePattern, FilesetExpression}; use jj_lib::conflicts::MaterializedTreeValue;
use jj_lib::fileset::FilePattern;
use jj_lib::fileset::FilesetExpression;
use jj_lib::merge::MergedTreeValue; use jj_lib::merge::MergedTreeValue;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPath;
use pollster::FutureExt; use pollster::FutureExt;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{ use crate::cli_util::print_unmatched_explicit_paths;
print_unmatched_explicit_paths, CommandHelper, RevisionArg, WorkspaceCommandHelper, use crate::cli_util::CommandHelper;
}; use crate::cli_util::RevisionArg;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::WorkspaceCommandHelper;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Print contents of files in a revision /// Print contents of files in a revision

View File

@ -12,29 +12,41 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use std::collections::{HashMap, HashSet}; use std::collections::HashMap;
use std::collections::HashSet;
use std::io::Write; use std::io::Write;
use std::process::Stdio; use std::process::Stdio;
use std::sync::mpsc::channel; use std::sync::mpsc::channel;
use futures::StreamExt; use futures::StreamExt;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::{BackendError, CommitId, FileId, TreeValue}; use jj_lib::backend::BackendError;
use jj_lib::fileset::{self, FilesetExpression}; use jj_lib::backend::CommitId;
use jj_lib::matchers::{EverythingMatcher, Matcher}; use jj_lib::backend::FileId;
use jj_lib::merged_tree::{MergedTreeBuilder, TreeDiffEntry}; use jj_lib::backend::TreeValue;
use jj_lib::fileset::FilesetExpression;
use jj_lib::fileset::{self};
use jj_lib::matchers::EverythingMatcher;
use jj_lib::matchers::Matcher;
use jj_lib::merged_tree::MergedTreeBuilder;
use jj_lib::merged_tree::TreeDiffEntry;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::repo_path::{RepoPathBuf, RepoPathUiConverter}; use jj_lib::repo_path::RepoPathBuf;
use jj_lib::revset::{RevsetExpression, RevsetIteratorExt}; use jj_lib::repo_path::RepoPathUiConverter;
use jj_lib::revset::RevsetExpression;
use jj_lib::revset::RevsetIteratorExt;
use jj_lib::store::Store; use jj_lib::store::Store;
use pollster::FutureExt; use pollster::FutureExt;
use rayon::iter::IntoParallelIterator; use rayon::iter::IntoParallelIterator;
use rayon::prelude::ParallelIterator; use rayon::prelude::ParallelIterator;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{config_error, CommandError}; use crate::cli_util::RevisionArg;
use crate::config::{to_toml_value, CommandNameAndArgs}; use crate::command_error::config_error;
use crate::command_error::CommandError;
use crate::config::to_toml_value;
use crate::config::CommandNameAndArgs;
use crate::ui::Ui; use crate::ui::Ui;
/// Update files with formatting fixes or other changes /// Update files with formatting fixes or other changes

View File

@ -12,20 +12,32 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use std::fs;
use std::io;
use std::io::Write; use std::io::Write;
use std::path::{Path, PathBuf}; use std::path::Path;
use std::{fs, io}; use std::path::PathBuf;
use jj_lib::git::{self, GitFetchError, GitFetchStats}; use jj_lib::git::GitFetchError;
use jj_lib::git::GitFetchStats;
use jj_lib::git::{self};
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::str_util::StringPattern; use jj_lib::str_util::StringPattern;
use jj_lib::workspace::Workspace; use jj_lib::workspace::Workspace;
use crate::cli_util::{CommandHelper, WorkspaceCommandHelper}; use crate::cli_util::CommandHelper;
use crate::command_error::{cli_error, user_error, user_error_with_message, CommandError}; use crate::cli_util::WorkspaceCommandHelper;
use crate::commands::git::{map_git_error, maybe_add_gitignore}; use crate::command_error::cli_error;
use crate::config::{write_config_value_to_file, ConfigNamePathBuf}; use crate::command_error::user_error;
use crate::git_util::{get_git_repo, print_git_import_stats, with_remote_git_callbacks}; use crate::command_error::user_error_with_message;
use crate::command_error::CommandError;
use crate::commands::git::map_git_error;
use crate::commands::git::maybe_add_gitignore;
use crate::config::write_config_value_to_file;
use crate::config::ConfigNamePathBuf;
use crate::git_util::get_git_repo;
use crate::git_util::print_git_import_stats;
use crate::git_util::with_remote_git_callbacks;
use crate::ui::Ui; use crate::ui::Ui;
/// Create a new repo backed by a clone of a Git repo /// Create a new repo backed by a clone of a Git repo

View File

@ -13,15 +13,22 @@
// limitations under the License. // limitations under the License.
use itertools::Itertools; use itertools::Itertools;
use jj_lib::git::{self, GitFetchError}; use jj_lib::git::GitFetchError;
use jj_lib::git::{self};
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::settings::{ConfigResultExt as _, UserSettings}; use jj_lib::settings::ConfigResultExt as _;
use jj_lib::settings::UserSettings;
use jj_lib::str_util::StringPattern; use jj_lib::str_util::StringPattern;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, user_error_with_hint, CommandError}; use crate::command_error::user_error;
use crate::commands::git::{get_single_remote, map_git_error}; use crate::command_error::user_error_with_hint;
use crate::git_util::{get_git_repo, print_git_import_stats, with_remote_git_callbacks}; use crate::command_error::CommandError;
use crate::commands::git::get_single_remote;
use crate::commands::git::map_git_error;
use crate::git_util::get_git_repo;
use crate::git_util::print_git_import_stats;
use crate::git_util::with_remote_git_callbacks;
use crate::ui::Ui; use crate::ui::Ui;
/// Fetch from a Git remote /// Fetch from a Git remote

View File

@ -13,23 +13,32 @@
// limitations under the License. // limitations under the License.
use std::io::Write; use std::io::Write;
use std::path::{Path, PathBuf}; use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
use jj_lib::git::{parse_git_ref, RefName}; use jj_lib::file_util;
use jj_lib::repo::{ReadonlyRepo, Repo}; use jj_lib::git;
use jj_lib::git::parse_git_ref;
use jj_lib::git::RefName;
use jj_lib::repo::ReadonlyRepo;
use jj_lib::repo::Repo;
use jj_lib::workspace::Workspace; use jj_lib::workspace::Workspace;
use jj_lib::{file_util, git};
use crate::cli_util::{print_trackable_remote_branches, start_repo_transaction, CommandHelper}; use crate::cli_util::print_trackable_remote_branches;
use crate::command_error::{ use crate::cli_util::start_repo_transaction;
cli_error, user_error_with_hint, user_error_with_message, CommandError, use crate::cli_util::CommandHelper;
}; use crate::command_error::cli_error;
use crate::command_error::user_error_with_hint;
use crate::command_error::user_error_with_message;
use crate::command_error::CommandError;
use crate::commands::git::maybe_add_gitignore; use crate::commands::git::maybe_add_gitignore;
use crate::config::{write_config_value_to_file, ConfigNamePathBuf}; use crate::config::write_config_value_to_file;
use crate::git_util::{ use crate::config::ConfigNamePathBuf;
get_git_repo, is_colocated_git_workspace, print_failed_git_export, print_git_import_stats, use crate::git_util::get_git_repo;
}; use crate::git_util::is_colocated_git_workspace;
use crate::git_util::print_failed_git_export;
use crate::git_util::print_git_import_stats;
use crate::ui::Ui; use crate::ui::Ui;
/// Create a new Git backed repo. /// Create a new Git backed repo.

View File

@ -23,18 +23,28 @@ pub mod submodule;
use clap::Subcommand; use clap::Subcommand;
use self::clone::{cmd_git_clone, GitCloneArgs}; use self::clone::cmd_git_clone;
use self::export::{cmd_git_export, GitExportArgs}; use self::clone::GitCloneArgs;
use self::fetch::{cmd_git_fetch, GitFetchArgs}; use self::export::cmd_git_export;
use self::import::{cmd_git_import, GitImportArgs}; use self::export::GitExportArgs;
use self::init::{cmd_git_init, GitInitArgs}; use self::fetch::cmd_git_fetch;
use self::push::{cmd_git_push, GitPushArgs}; use self::fetch::GitFetchArgs;
use self::remote::{cmd_git_remote, RemoteCommand}; use self::import::cmd_git_import;
use self::submodule::{cmd_git_submodule, GitSubmoduleCommand}; use self::import::GitImportArgs;
use crate::cli_util::{CommandHelper, WorkspaceCommandHelper}; use self::init::cmd_git_init;
use crate::command_error::{ use self::init::GitInitArgs;
user_error, user_error_with_hint, user_error_with_message, CommandError, use self::push::cmd_git_push;
}; use self::push::GitPushArgs;
use self::remote::cmd_git_remote;
use self::remote::RemoteCommand;
use self::submodule::cmd_git_submodule;
use self::submodule::GitSubmoduleCommand;
use crate::cli_util::CommandHelper;
use crate::cli_util::WorkspaceCommandHelper;
use crate::command_error::user_error;
use crate::command_error::user_error_with_hint;
use crate::command_error::user_error_with_message;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Commands for working with Git remotes and the underlying Git repo /// Commands for working with Git remotes and the underlying Git repo

View File

@ -12,32 +12,45 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use std::collections::{HashMap, HashSet}; use std::collections::HashMap;
use std::collections::HashSet;
use std::fmt;
use std::io;
use std::io::Write; use std::io::Write;
use std::{fmt, io};
use clap::ArgGroup; use clap::ArgGroup;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::CommitId; use jj_lib::backend::CommitId;
use jj_lib::git::{self, GitBranchPushTargets, GitPushError}; use jj_lib::git::GitBranchPushTargets;
use jj_lib::git::GitPushError;
use jj_lib::git::{self};
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use jj_lib::op_store::RefTarget; use jj_lib::op_store::RefTarget;
use jj_lib::refs::{ use jj_lib::refs::classify_branch_push_action;
classify_branch_push_action, BranchPushAction, BranchPushUpdate, LocalAndRemoteRef, use jj_lib::refs::BranchPushAction;
}; use jj_lib::refs::BranchPushUpdate;
use jj_lib::refs::LocalAndRemoteRef;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::revset::RevsetExpression; use jj_lib::revset::RevsetExpression;
use jj_lib::settings::{ConfigResultExt as _, UserSettings}; use jj_lib::settings::ConfigResultExt as _;
use jj_lib::settings::UserSettings;
use jj_lib::str_util::StringPattern; use jj_lib::str_util::StringPattern;
use jj_lib::view::View; use jj_lib::view::View;
use crate::cli_util::{ use crate::cli_util::short_change_hash;
short_change_hash, short_commit_hash, CommandHelper, RevisionArg, WorkspaceCommandHelper, use crate::cli_util::short_commit_hash;
WorkspaceCommandTransaction, use crate::cli_util::CommandHelper;
}; use crate::cli_util::RevisionArg;
use crate::command_error::{user_error, user_error_with_hint, CommandError}; use crate::cli_util::WorkspaceCommandHelper;
use crate::commands::git::{get_single_remote, map_git_error}; use crate::cli_util::WorkspaceCommandTransaction;
use crate::git_util::{get_git_repo, with_remote_git_callbacks, GitSidebandProgressMessageWriter}; use crate::command_error::user_error;
use crate::command_error::user_error_with_hint;
use crate::command_error::CommandError;
use crate::commands::git::get_single_remote;
use crate::commands::git::map_git_error;
use crate::git_util::get_git_repo;
use crate::git_util::with_remote_git_callbacks;
use crate::git_util::GitSidebandProgressMessageWriter;
use crate::revset_util; use crate::revset_util;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -20,11 +20,16 @@ pub mod set_url;
use clap::Subcommand; use clap::Subcommand;
use self::add::{cmd_git_remote_add, GitRemoteAddArgs}; use self::add::cmd_git_remote_add;
use self::list::{cmd_git_remote_list, GitRemoteListArgs}; use self::add::GitRemoteAddArgs;
use self::remove::{cmd_git_remote_remove, GitRemoteRemoveArgs}; use self::list::cmd_git_remote_list;
use self::rename::{cmd_git_remote_rename, GitRemoteRenameArgs}; use self::list::GitRemoteListArgs;
use self::set_url::{cmd_git_remote_set_url, GitRemoteSetUrlArgs}; use self::remove::cmd_git_remote_remove;
use self::remove::GitRemoteRemoveArgs;
use self::rename::cmd_git_remote_rename;
use self::rename::GitRemoteRenameArgs;
use self::set_url::cmd_git_remote_set_url;
use self::set_url::GitRemoteSetUrlArgs;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -20,8 +20,10 @@ use jj_lib::git::parse_gitmodules;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPath;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// FOR INTERNAL USE ONLY Interact with git submodules /// FOR INTERNAL USE ONLY Interact with git submodules

View File

@ -21,9 +21,10 @@ use tracing::instrument;
use super::git; use super::git;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{ use crate::command_error::cli_error;
cli_error, user_error_with_hint, user_error_with_message, CommandError, use crate::command_error::user_error_with_hint;
}; use crate::command_error::user_error_with_message;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Create a new repo in the given directory /// Create a new repo in the given directory

View File

@ -18,7 +18,8 @@ use clap::ArgGroup;
use jj_lib::rewrite::rebase_to_dest_parent; use jj_lib::rewrite::rebase_to_dest_parent;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::diff_util::DiffFormatArgs; use crate::diff_util::DiffFormatArgs;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -13,16 +13,24 @@
// limitations under the License. // limitations under the License.
use jj_lib::backend::CommitId; use jj_lib::backend::CommitId;
use jj_lib::graph::{GraphEdgeType, ReverseGraphIterator, TopoGroupedGraphIterator}; use jj_lib::graph::GraphEdgeType;
use jj_lib::graph::ReverseGraphIterator;
use jj_lib::graph::TopoGroupedGraphIterator;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::revset::{RevsetExpression, RevsetFilterPredicate, RevsetIteratorExt}; use jj_lib::revset::RevsetExpression;
use jj_lib::revset::RevsetFilterPredicate;
use jj_lib::revset::RevsetIteratorExt;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{format_template, CommandHelper, LogContentFormat, RevisionArg}; use crate::cli_util::format_template;
use crate::cli_util::CommandHelper;
use crate::cli_util::LogContentFormat;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::commit_templater::CommitTemplateLanguage; use crate::commit_templater::CommitTemplateLanguage;
use crate::diff_util::DiffFormatArgs; use crate::diff_util::DiffFormatArgs;
use crate::graphlog::{get_graphlog, Edge}; use crate::graphlog::get_graphlog;
use crate::graphlog::Edge;
use crate::ui::Ui; use crate::ui::Ui;
/// Show revision history /// Show revision history

View File

@ -16,7 +16,8 @@ use tracing::instrument;
use super::new; use super::new;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{cli_error, CommandError}; use crate::command_error::cli_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
#[instrument(skip_all)] #[instrument(skip_all)]

View File

@ -59,11 +59,15 @@ mod workspace;
use std::fmt::Debug; use std::fmt::Debug;
use clap::{CommandFactory, FromArgMatches, Subcommand}; use clap::CommandFactory;
use clap::FromArgMatches;
use clap::Subcommand;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{Args, CommandHelper}; use crate::cli_util::Args;
use crate::command_error::{user_error_with_hint, CommandError}; use crate::cli_util::CommandHelper;
use crate::command_error::user_error_with_hint;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
#[derive(clap::Parser, Clone, Debug)] #[derive(clap::Parser, Clone, Debug)]

View File

@ -16,9 +16,12 @@ use clap::ArgGroup;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use tracing::instrument; use tracing::instrument;
use super::squash::{move_diff, SquashedDescription}; use super::squash::move_diff;
use crate::cli_util::{CommandHelper, RevisionArg}; use super::squash::SquashedDescription;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Move changes from one revision into another (DEPRECATED, use `jj squash`) /// Move changes from one revision into another (DEPRECATED, use `jj squash`)

View File

@ -19,13 +19,19 @@ use std::rc::Rc;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::CommitId; use jj_lib::backend::CommitId;
use jj_lib::commit::CommitIteratorExt; use jj_lib::commit::CommitIteratorExt;
use jj_lib::repo::{ReadonlyRepo, Repo}; use jj_lib::repo::ReadonlyRepo;
use jj_lib::revset::{RevsetExpression, RevsetIteratorExt}; use jj_lib::repo::Repo;
use jj_lib::rewrite::{merge_commit_trees, rebase_commit}; use jj_lib::revset::RevsetExpression;
use jj_lib::revset::RevsetIteratorExt;
use jj_lib::rewrite::merge_commit_trees;
use jj_lib::rewrite::rebase_commit;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{short_commit_hash, CommandHelper, RevisionArg}; use crate::cli_util::short_commit_hash;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::description_util::join_message_paragraphs; use crate::description_util::join_message_paragraphs;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -14,7 +14,9 @@
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::movement_util::{move_to_commit, Direction, MovementArgs}; use crate::movement_util::move_to_commit;
use crate::movement_util::Direction;
use crate::movement_util::MovementArgs;
use crate::ui::Ui; use crate::ui::Ui;
/// Move the working-copy commit to the child revision /// Move the working-copy commit to the child revision

View File

@ -20,12 +20,17 @@ use jj_lib::repo::Repo;
use jj_lib::rewrite::rebase_to_dest_parent; use jj_lib::rewrite::rebase_to_dest_parent;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{format_template, CommandHelper, LogContentFormat, RevisionArg}; use crate::cli_util::format_template;
use crate::cli_util::CommandHelper;
use crate::cli_util::LogContentFormat;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::commit_templater::CommitTemplateLanguage; use crate::commit_templater::CommitTemplateLanguage;
use crate::diff_util::{DiffFormatArgs, DiffRenderer}; use crate::diff_util::DiffFormatArgs;
use crate::diff_util::DiffRenderer;
use crate::formatter::Formatter; use crate::formatter::Formatter;
use crate::graphlog::{get_graphlog, Edge}; use crate::graphlog::get_graphlog;
use crate::graphlog::Edge;
use crate::ui::Ui; use crate::ui::Ui;
/// Show how a change has evolved over time /// Show how a change has evolved over time

View File

@ -13,14 +13,18 @@
// limitations under the License. // limitations under the License.
use std::io::Write as _; use std::io::Write as _;
use std::{iter, slice}; use std::iter;
use std::slice;
use itertools::Itertools as _; use itertools::Itertools as _;
use jj_lib::op_walk; use jj_lib::op_walk;
use jj_lib::operation::Operation; use jj_lib::operation::Operation;
use crate::cli_util::{short_operation_hash, CommandHelper}; use crate::cli_util::short_operation_hash;
use crate::command_error::{cli_error, user_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::command_error::cli_error;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Abandon operation history /// Abandon operation history

View File

@ -17,23 +17,36 @@ use std::sync::Arc;
use indexmap::IndexMap; use indexmap::IndexMap;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::{ChangeId, CommitId}; use jj_lib::backend::ChangeId;
use jj_lib::backend::CommitId;
use jj_lib::commit::Commit; use jj_lib::commit::Commit;
use jj_lib::dag_walk;
use jj_lib::git::REMOTE_NAME_FOR_LOCAL_GIT_REPO; use jj_lib::git::REMOTE_NAME_FOR_LOCAL_GIT_REPO;
use jj_lib::graph::{GraphEdge, TopoGroupedGraphIterator}; use jj_lib::graph::GraphEdge;
use jj_lib::graph::TopoGroupedGraphIterator;
use jj_lib::matchers::EverythingMatcher; use jj_lib::matchers::EverythingMatcher;
use jj_lib::op_store::{RefTarget, RemoteRef, RemoteRefState}; use jj_lib::op_store::RefTarget;
use jj_lib::refs::{diff_named_ref_targets, diff_named_remote_refs}; use jj_lib::op_store::RemoteRef;
use jj_lib::repo::{ReadonlyRepo, Repo}; use jj_lib::op_store::RemoteRefState;
use jj_lib::refs::diff_named_ref_targets;
use jj_lib::refs::diff_named_remote_refs;
use jj_lib::repo::ReadonlyRepo;
use jj_lib::repo::Repo;
use jj_lib::revset;
use jj_lib::revset::RevsetIteratorExt as _; use jj_lib::revset::RevsetIteratorExt as _;
use jj_lib::rewrite::rebase_to_dest_parent; use jj_lib::rewrite::rebase_to_dest_parent;
use jj_lib::{dag_walk, revset};
use crate::cli_util::{short_change_hash, short_operation_hash, CommandHelper, LogContentFormat}; use crate::cli_util::short_change_hash;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::short_operation_hash;
use crate::diff_util::{DiffFormatArgs, DiffRenderer}; use crate::cli_util::CommandHelper;
use crate::cli_util::LogContentFormat;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::diff_util::DiffFormatArgs;
use crate::diff_util::DiffRenderer;
use crate::formatter::Formatter; use crate::formatter::Formatter;
use crate::graphlog::{get_graphlog, Edge}; use crate::graphlog::get_graphlog;
use crate::graphlog::Edge;
use crate::templater::TemplateRenderer; use crate::templater::TemplateRenderer;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -16,9 +16,12 @@ use std::slice;
use jj_lib::op_walk; use jj_lib::op_walk;
use crate::cli_util::{format_template, CommandHelper, LogContentFormat}; use crate::cli_util::format_template;
use crate::cli_util::CommandHelper;
use crate::cli_util::LogContentFormat;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::graphlog::{get_graphlog, Edge}; use crate::graphlog::get_graphlog;
use crate::graphlog::Edge;
use crate::operation_templater::OperationTemplateLanguage; use crate::operation_templater::OperationTemplateLanguage;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -19,13 +19,19 @@ mod restore;
mod show; mod show;
pub mod undo; pub mod undo;
use abandon::{cmd_op_abandon, OperationAbandonArgs}; use abandon::cmd_op_abandon;
use abandon::OperationAbandonArgs;
use clap::Subcommand; use clap::Subcommand;
use diff::{cmd_op_diff, OperationDiffArgs}; use diff::cmd_op_diff;
use log::{cmd_op_log, OperationLogArgs}; use diff::OperationDiffArgs;
use restore::{cmd_op_restore, OperationRestoreArgs}; use log::cmd_op_log;
use show::{cmd_op_show, OperationShowArgs}; use log::OperationLogArgs;
use undo::{cmd_op_undo, OperationUndoArgs}; use restore::cmd_op_restore;
use restore::OperationRestoreArgs;
use show::cmd_op_show;
use show::OperationShowArgs;
use undo::cmd_op_undo;
use undo::OperationUndoArgs;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;

View File

@ -14,7 +14,9 @@
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use super::{view_with_desired_portions_restored, UndoWhatToRestore, DEFAULT_UNDO_WHAT}; use super::view_with_desired_portions_restored;
use super::UndoWhatToRestore;
use super::DEFAULT_UNDO_WHAT;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -15,8 +15,10 @@
use itertools::Itertools; use itertools::Itertools;
use super::diff::show_op_diff; use super::diff::show_op_diff;
use crate::cli_util::{CommandHelper, LogContentFormat}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::LogContentFormat;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::diff_util::DiffFormatArgs; use crate::diff_util::DiffFormatArgs;
use crate::operation_templater::OperationTemplateLanguage; use crate::operation_templater::OperationTemplateLanguage;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -15,9 +15,12 @@
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use super::{view_with_desired_portions_restored, UndoWhatToRestore, DEFAULT_UNDO_WHAT}; use super::view_with_desired_portions_restored;
use super::UndoWhatToRestore;
use super::DEFAULT_UNDO_WHAT;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Create a new operation that undoes an earlier operation /// Create a new operation that undoes an earlier operation

View File

@ -17,10 +17,12 @@ use std::collections::HashMap;
use indexmap::IndexSet; use indexmap::IndexSet;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::CommitId; use jj_lib::backend::CommitId;
use jj_lib::commit::{Commit, CommitIteratorExt}; use jj_lib::commit::Commit;
use jj_lib::commit::CommitIteratorExt;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -14,7 +14,9 @@
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::movement_util::{move_to_commit, Direction, MovementArgs}; use crate::movement_util::move_to_commit;
use crate::movement_util::Direction;
use crate::movement_util::MovementArgs;
use crate::ui::Ui; use crate::ui::Ui;
/// Change the working copy revision relative to the parent revision /// Change the working copy revision relative to the parent revision
/// ///

View File

@ -21,22 +21,30 @@ use clap::ArgGroup;
use indexmap::IndexSet; use indexmap::IndexSet;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::CommitId; use jj_lib::backend::CommitId;
use jj_lib::commit::{Commit, CommitIteratorExt}; use jj_lib::commit::Commit;
use jj_lib::commit::CommitIteratorExt;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use jj_lib::repo::{ReadonlyRepo, Repo}; use jj_lib::repo::ReadonlyRepo;
use jj_lib::revset::{RevsetExpression, RevsetIteratorExt}; use jj_lib::repo::Repo;
use jj_lib::rewrite::{ use jj_lib::revset::RevsetExpression;
move_commits, rebase_commit_with_options, CommitRewriter, EmptyBehaviour, MoveCommitsStats, use jj_lib::revset::RevsetIteratorExt;
RebaseOptions, use jj_lib::rewrite::move_commits;
}; use jj_lib::rewrite::rebase_commit_with_options;
use jj_lib::rewrite::CommitRewriter;
use jj_lib::rewrite::EmptyBehaviour;
use jj_lib::rewrite::MoveCommitsStats;
use jj_lib::rewrite::RebaseOptions;
use jj_lib::settings::UserSettings; use jj_lib::settings::UserSettings;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{ use crate::cli_util::short_commit_hash;
short_commit_hash, CommandHelper, RevisionArg, WorkspaceCommandHelper, use crate::cli_util::CommandHelper;
WorkspaceCommandTransaction, use crate::cli_util::RevisionArg;
}; use crate::cli_util::WorkspaceCommandHelper;
use crate::command_error::{cli_error, user_error, CommandError}; use crate::cli_util::WorkspaceCommandTransaction;
use crate::command_error::cli_error;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Move revisions to different parent(s) /// Move revisions to different parent(s)

View File

@ -18,8 +18,11 @@ use itertools::Itertools;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{print_conflicted_paths, CommandHelper, RevisionArg}; use crate::cli_util::print_conflicted_paths;
use crate::command_error::{cli_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::cli_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Resolve a conflicted file with an external merge tool /// Resolve a conflicted file with an external merge tool

View File

@ -18,8 +18,10 @@ use jj_lib::object_id::ObjectId;
use jj_lib::rewrite::restore_tree; use jj_lib::rewrite::restore_tree;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Restore paths from another revision /// Restore paths from another revision

View File

@ -17,7 +17,8 @@ use std::io::Write as _;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Show the current workspace root directory /// Show the current workspace root directory

View File

@ -16,8 +16,10 @@
use itertools::Itertools as _; use itertools::Itertools as _;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// (**Stub**, does not work yet) Run a command across a set of revisions. /// (**Stub**, does not work yet) Run a command across a set of revisions.

View File

@ -15,7 +15,8 @@
use jj_lib::matchers::EverythingMatcher; use jj_lib::matchers::EverythingMatcher;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::diff_util::DiffFormatArgs; use crate::diff_util::DiffFormatArgs;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -23,12 +23,14 @@ use jj_lib::repo_path::RepoPathBuf;
use jj_lib::settings::UserSettings; use jj_lib::settings::UserSettings;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{ use crate::cli_util::edit_temp_file;
edit_temp_file, print_checkout_stats, CommandHelper, WorkspaceCommandHelper, use crate::cli_util::print_checkout_stats;
}; use crate::cli_util::CommandHelper;
use crate::command_error::{ use crate::cli_util::WorkspaceCommandHelper;
internal_error, internal_error_with_message, user_error_with_message, CommandError, use crate::command_error::internal_error;
}; use crate::command_error::internal_error_with_message;
use crate::command_error::user_error_with_message;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Manage which paths from the working-copy commit are present in the working /// Manage which paths from the working-copy commit are present in the working

View File

@ -17,9 +17,12 @@ use jj_lib::object_id::ObjectId;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error_with_hint, CommandError}; use crate::cli_util::RevisionArg;
use crate::description_util::{description_template, edit_description}; use crate::command_error::user_error_with_hint;
use crate::command_error::CommandError;
use crate::description_util::description_template;
use crate::description_util::edit_description;
use crate::ui::Ui; use crate::ui::Ui;
/// Split a revision in two /// Split a revision in two

View File

@ -13,7 +13,8 @@
// limitations under the License. // limitations under the License.
use itertools::Itertools as _; use itertools::Itertools as _;
use jj_lib::commit::{Commit, CommitIteratorExt}; use jj_lib::commit::Commit;
use jj_lib::commit::CommitIteratorExt;
use jj_lib::matchers::Matcher; use jj_lib::matchers::Matcher;
use jj_lib::merged_tree::MergedTree; use jj_lib::merged_tree::MergedTree;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
@ -21,9 +22,14 @@ use jj_lib::repo::Repo;
use jj_lib::settings::UserSettings; use jj_lib::settings::UserSettings;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, DiffSelector, RevisionArg, WorkspaceCommandTransaction}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::DiffSelector;
use crate::description_util::{combine_messages, join_message_paragraphs}; use crate::cli_util::RevisionArg;
use crate::cli_util::WorkspaceCommandTransaction;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::description_util::combine_messages;
use crate::description_util::join_message_paragraphs;
use crate::ui::Ui; use crate::ui::Ui;
/// Move changes from a revision into another revision /// Move changes from a revision into another revision

View File

@ -14,10 +14,12 @@
use itertools::Itertools; use itertools::Itertools;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::revset::{RevsetExpression, RevsetFilterPredicate}; use jj_lib::revset::RevsetExpression;
use jj_lib::revset::RevsetFilterPredicate;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{print_conflicted_paths, CommandHelper}; use crate::cli_util::print_conflicted_paths;
use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::diff_util::DiffFormat; use crate::diff_util::DiffFormat;
use crate::revset_util; use crate::revset_util;

View File

@ -16,7 +16,8 @@ use jj_lib::str_util::StringPattern;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::commit_templater::{CommitTemplateLanguage, RefName}; use crate::commit_templater::CommitTemplateLanguage;
use crate::commit_templater::RefName;
use crate::ui::Ui; use crate::ui::Ui;
/// Manage tags. /// Manage tags.

View File

@ -16,8 +16,10 @@ use jj_lib::matchers::EverythingMatcher;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::RevisionArg;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::description_util::combine_messages; use crate::description_util::combine_messages;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -22,7 +22,8 @@ use jj_lib::working_copy::SnapshotOptions;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error_with_hint, CommandError}; use crate::command_error::user_error_with_hint;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Stop tracking specified paths in the working copy /// Stop tracking specified paths in the working copy

View File

@ -14,14 +14,17 @@
use std::io::Write; use std::io::Write;
use std::slice; use std::slice;
use std::time::{Duration, SystemTime}; use std::time::Duration;
use std::time::SystemTime;
use clap::{Command, Subcommand}; use clap::Command;
use clap::Subcommand;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Infrequently used commands such as for generating shell completions /// Infrequently used commands such as for generating shell completions
@ -229,7 +232,8 @@ fn cmd_util_config_schema(
impl ShellCompletion { impl ShellCompletion {
fn generate(&self, cmd: &mut Command) -> Vec<u8> { fn generate(&self, cmd: &mut Command) -> Vec<u8> {
use clap_complete::{generate, Shell}; use clap_complete::generate;
use clap_complete::Shell;
use clap_complete_nushell::Nushell; use clap_complete_nushell::Nushell;
let mut buf = Vec::new(); let mut buf = Vec::new();

View File

@ -24,8 +24,11 @@ use jj_lib::rewrite::merge_commit_trees;
use jj_lib::workspace::Workspace; use jj_lib::workspace::Workspace;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{CommandHelper, RevisionArg}; use crate::cli_util::CommandHelper;
use crate::command_error::{internal_error_with_message, user_error, CommandError}; use crate::cli_util::RevisionArg;
use crate::command_error::internal_error_with_message;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Add a workspace /// Add a workspace

View File

@ -17,7 +17,8 @@ use jj_lib::op_store::WorkspaceId;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Stop tracking a workspace's working-copy commit in the repo /// Stop tracking a workspace's working-copy commit in the repo

View File

@ -21,11 +21,16 @@ mod update_stale;
use clap::Subcommand; use clap::Subcommand;
use tracing::instrument; use tracing::instrument;
use self::add::{cmd_workspace_add, WorkspaceAddArgs}; use self::add::cmd_workspace_add;
use self::forget::{cmd_workspace_forget, WorkspaceForgetArgs}; use self::add::WorkspaceAddArgs;
use self::list::{cmd_workspace_list, WorkspaceListArgs}; use self::forget::cmd_workspace_forget;
use self::root::{cmd_workspace_root, WorkspaceRootArgs}; use self::forget::WorkspaceForgetArgs;
use self::update_stale::{cmd_workspace_update_stale, WorkspaceUpdateStaleArgs}; use self::list::cmd_workspace_list;
use self::list::WorkspaceListArgs;
use self::root::cmd_workspace_root;
use self::root::WorkspaceRootArgs;
use self::update_stale::cmd_workspace_update_stale;
use self::update_stale::WorkspaceUpdateStaleArgs;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -17,7 +17,8 @@ use std::io::Write;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::CommandHelper; use crate::cli_util::CommandHelper;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Show the current workspace root directory /// Show the current workspace root directory

View File

@ -17,14 +17,19 @@ use std::sync::Arc;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use jj_lib::op_store::OpStoreError; use jj_lib::op_store::OpStoreError;
use jj_lib::operation::Operation; use jj_lib::operation::Operation;
use jj_lib::repo::{ReadonlyRepo, Repo}; use jj_lib::repo::ReadonlyRepo;
use jj_lib::repo::Repo;
use tracing::instrument; use tracing::instrument;
use crate::cli_util::{ use crate::cli_util::check_stale_working_copy;
check_stale_working_copy, print_checkout_stats, short_commit_hash, CommandHelper, use crate::cli_util::print_checkout_stats;
WorkingCopyFreshness, WorkspaceCommandHelper, use crate::cli_util::short_commit_hash;
}; use crate::cli_util::CommandHelper;
use crate::command_error::{internal_error_with_message, user_error, CommandError}; use crate::cli_util::WorkingCopyFreshness;
use crate::cli_util::WorkspaceCommandHelper;
use crate::command_error::internal_error_with_message;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
/// Update a workspace that has become stale /// Update a workspace that has become stale

View File

@ -20,37 +20,59 @@ use std::rc::Rc;
use futures::stream::BoxStream; use futures::stream::BoxStream;
use itertools::Itertools as _; use itertools::Itertools as _;
use jj_lib::backend::{BackendResult, ChangeId, CommitId}; use jj_lib::backend::BackendResult;
use jj_lib::backend::ChangeId;
use jj_lib::backend::CommitId;
use jj_lib::commit::Commit; use jj_lib::commit::Commit;
use jj_lib::copies::{CopiesTreeDiffEntry, CopyRecords}; use jj_lib::copies::CopiesTreeDiffEntry;
use jj_lib::copies::CopyRecords;
use jj_lib::extensions_map::ExtensionsMap; use jj_lib::extensions_map::ExtensionsMap;
use jj_lib::fileset::{self, FilesetExpression}; use jj_lib::fileset::FilesetExpression;
use jj_lib::fileset::{self};
use jj_lib::git; use jj_lib::git;
use jj_lib::hex_util::to_reverse_hex; use jj_lib::hex_util::to_reverse_hex;
use jj_lib::id_prefix::IdPrefixContext; use jj_lib::id_prefix::IdPrefixContext;
use jj_lib::matchers::Matcher; use jj_lib::matchers::Matcher;
use jj_lib::merged_tree::MergedTree; use jj_lib::merged_tree::MergedTree;
use jj_lib::object_id::ObjectId as _; use jj_lib::object_id::ObjectId as _;
use jj_lib::op_store::{RefTarget, RemoteRef, WorkspaceId}; use jj_lib::op_store::RefTarget;
use jj_lib::op_store::RemoteRef;
use jj_lib::op_store::WorkspaceId;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::repo_path::RepoPathUiConverter; use jj_lib::repo_path::RepoPathUiConverter;
use jj_lib::revset::{self, Revset, RevsetExpression, RevsetModifier, RevsetParseContext}; use jj_lib::revset::Revset;
use jj_lib::revset::RevsetExpression;
use jj_lib::revset::RevsetModifier;
use jj_lib::revset::RevsetParseContext;
use jj_lib::revset::{self};
use jj_lib::store::Store; use jj_lib::store::Store;
use once_cell::unsync::OnceCell; use once_cell::unsync::OnceCell;
use crate::diff_util;
use crate::formatter::Formatter; use crate::formatter::Formatter;
use crate::template_builder::{ use crate::revset_util;
self, merge_fn_map, BuildContext, CoreTemplateBuildFnTable, CoreTemplatePropertyKind, use crate::template_builder::merge_fn_map;
IntoTemplateProperty, TemplateBuildMethodFnMap, TemplateLanguage, use crate::template_builder::BuildContext;
}; use crate::template_builder::CoreTemplateBuildFnTable;
use crate::template_parser::{ use crate::template_builder::CoreTemplatePropertyKind;
self, ExpressionNode, FunctionCallNode, TemplateParseError, TemplateParseResult, use crate::template_builder::IntoTemplateProperty;
}; use crate::template_builder::TemplateBuildMethodFnMap;
use crate::templater::{ use crate::template_builder::TemplateLanguage;
self, PlainTextFormattedProperty, SizeHint, Template, TemplateFormatter, TemplateProperty, use crate::template_builder::{self};
TemplatePropertyError, TemplatePropertyExt as _, use crate::template_parser::ExpressionNode;
}; use crate::template_parser::FunctionCallNode;
use crate::{diff_util, revset_util, text_util}; use crate::template_parser::TemplateParseError;
use crate::template_parser::TemplateParseResult;
use crate::template_parser::{self};
use crate::templater::PlainTextFormattedProperty;
use crate::templater::SizeHint;
use crate::templater::Template;
use crate::templater::TemplateFormatter;
use crate::templater::TemplateProperty;
use crate::templater::TemplatePropertyError;
use crate::templater::TemplatePropertyExt as _;
use crate::templater::{self};
use crate::text_util;
pub trait CommitTemplateLanguageExtension { pub trait CommitTemplateLanguageExtension {
fn build_fn_table<'repo>(&self) -> CommitTemplateBuildFnTable<'repo>; fn build_fn_table<'repo>(&self) -> CommitTemplateBuildFnTable<'repo>;

View File

@ -13,20 +13,27 @@
// limitations under the License. // limitations under the License.
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::{HashMap, HashSet}; use std::collections::HashMap;
use std::path::{Path, PathBuf}; use std::collections::HashSet;
use std::env;
use std::fmt;
use std::path::Path;
use std::path::PathBuf;
use std::process::Command; use std::process::Command;
use std::slice;
use std::str::FromStr; use std::str::FromStr;
use std::{env, fmt, slice};
use config::Source; use config::Source;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::settings::ConfigResultExt as _; use jj_lib::settings::ConfigResultExt as _;
use regex::{Captures, Regex}; use regex::Captures;
use regex::Regex;
use thiserror::Error; use thiserror::Error;
use tracing::instrument; use tracing::instrument;
use crate::command_error::{user_error, user_error_with_message, CommandError}; use crate::command_error::user_error;
use crate::command_error::user_error_with_message;
use crate::command_error::CommandError;
/// Parses a TOML value expression. Interprets the given value as string if it /// Parses a TOML value expression. Interprets the given value as string if it
/// can't be parsed. /// can't be parsed.

View File

@ -11,7 +11,9 @@ use jj_lib::repo::ReadonlyRepo;
use jj_lib::settings::UserSettings; use jj_lib::settings::UserSettings;
use thiserror::Error; use thiserror::Error;
use crate::cli_util::{edit_temp_file, short_commit_hash, WorkspaceCommandTransaction}; use crate::cli_util::edit_temp_file;
use crate::cli_util::short_commit_hash;
use crate::cli_util::WorkspaceCommandTransaction;
use crate::command_error::CommandError; use crate::command_error::CommandError;
use crate::formatter::PlainTextFormatter; use crate::formatter::PlainTextFormatter;
use crate::text_util; use crate::text_util;

View File

@ -15,29 +15,42 @@
use std::borrow::Borrow; use std::borrow::Borrow;
use std::cmp::max; use std::cmp::max;
use std::collections::HashSet; use std::collections::HashSet;
use std::io;
use std::mem;
use std::ops::Range; use std::ops::Range;
use std::path::{Path, PathBuf}; use std::path::Path;
use std::{io, mem}; use std::path::PathBuf;
use futures::executor::block_on_stream; use futures::executor::block_on_stream;
use futures::stream::BoxStream; use futures::stream::BoxStream;
use futures::StreamExt; use futures::StreamExt;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::{BackendError, BackendResult, CommitId, CopyRecord, TreeValue}; use jj_lib::backend::BackendError;
use jj_lib::backend::BackendResult;
use jj_lib::backend::CommitId;
use jj_lib::backend::CopyRecord;
use jj_lib::backend::TreeValue;
use jj_lib::commit::Commit; use jj_lib::commit::Commit;
use jj_lib::conflicts::{ use jj_lib::conflicts::materialized_diff_stream;
materialized_diff_stream, MaterializedTreeDiffEntry, MaterializedTreeValue, use jj_lib::conflicts::MaterializedTreeDiffEntry;
}; use jj_lib::conflicts::MaterializedTreeValue;
use jj_lib::copies::{CopiesTreeDiffEntry, CopyRecords}; use jj_lib::copies::CopiesTreeDiffEntry;
use jj_lib::diff::{Diff, DiffHunk}; use jj_lib::copies::CopyRecords;
use jj_lib::files::{DiffLine, DiffLineHunkSide, DiffLineIterator, DiffLineNumber}; use jj_lib::diff::Diff;
use jj_lib::diff::DiffHunk;
use jj_lib::files::DiffLine;
use jj_lib::files::DiffLineHunkSide;
use jj_lib::files::DiffLineIterator;
use jj_lib::files::DiffLineNumber;
use jj_lib::matchers::Matcher; use jj_lib::matchers::Matcher;
use jj_lib::merge::MergedTreeValue; use jj_lib::merge::MergedTreeValue;
use jj_lib::merged_tree::MergedTree; use jj_lib::merged_tree::MergedTree;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::repo_path::{RepoPath, RepoPathUiConverter}; use jj_lib::repo_path::RepoPath;
use jj_lib::settings::{ConfigResultExt as _, UserSettings}; use jj_lib::repo_path::RepoPathUiConverter;
use jj_lib::settings::ConfigResultExt as _;
use jj_lib::settings::UserSettings;
use jj_lib::store::Store; use jj_lib::store::Store;
use pollster::FutureExt; use pollster::FutureExt;
use thiserror::Error; use thiserror::Error;
@ -46,10 +59,13 @@ use unicode_width::UnicodeWidthStr as _;
use crate::config::CommandNameAndArgs; use crate::config::CommandNameAndArgs;
use crate::formatter::Formatter; use crate::formatter::Formatter;
use crate::merge_tools::{ use crate::merge_tools::generate_diff;
self, generate_diff, invoke_external_diff, new_utf8_temp_dir, DiffGenerateError, DiffToolMode, use crate::merge_tools::invoke_external_diff;
ExternalMergeTool, use crate::merge_tools::new_utf8_temp_dir;
}; use crate::merge_tools::DiffGenerateError;
use crate::merge_tools::DiffToolMode;
use crate::merge_tools::ExternalMergeTool;
use crate::merge_tools::{self};
use crate::text_util; use crate::text_util;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -14,13 +14,20 @@
use std::borrow::BorrowMut; use std::borrow::BorrowMut;
use std::collections::HashMap; use std::collections::HashMap;
use std::io::{Error, Write}; use std::fmt;
use std::io;
use std::io::Error;
use std::io::Write;
use std::mem;
use std::ops::Range; use std::ops::Range;
use std::sync::Arc; use std::sync::Arc;
use std::{fmt, io, mem};
use crossterm::queue; use crossterm::queue;
use crossterm::style::{Attribute, Color, SetAttribute, SetBackgroundColor, SetForegroundColor}; use crossterm::style::Attribute;
use crossterm::style::Color;
use crossterm::style::SetAttribute;
use crossterm::style::SetBackgroundColor;
use crossterm::style::SetForegroundColor;
use itertools::Itertools; use itertools::Itertools;
// Lets the caller label strings and translates the labels to colors // Lets the caller label strings and translates the labels to colors

View File

@ -14,12 +14,17 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::template_builder::{ use crate::template_builder::BuildContext;
self, BuildContext, CoreTemplateBuildFnTable, CoreTemplatePropertyKind, IntoTemplateProperty, use crate::template_builder::CoreTemplateBuildFnTable;
TemplateLanguage, use crate::template_builder::CoreTemplatePropertyKind;
}; use crate::template_builder::IntoTemplateProperty;
use crate::template_parser::{self, FunctionCallNode, TemplateParseResult}; use crate::template_builder::TemplateLanguage;
use crate::templater::{Template, TemplateProperty}; use crate::template_builder::{self};
use crate::template_parser::FunctionCallNode;
use crate::template_parser::TemplateParseResult;
use crate::template_parser::{self};
use crate::templater::Template;
use crate::templater::TemplateProperty;
/// General-purpose template language for basic value types. /// General-purpose template language for basic value types.
/// ///

View File

@ -14,22 +14,32 @@
//! Git utilities shared by various commands. //! Git utilities shared by various commands.
use std::io::{Read, Write}; use std::error;
use std::path::{Path, PathBuf}; use std::io::Read;
use std::io::Write;
use std::iter;
use std::path::Path;
use std::path::PathBuf;
use std::process::Stdio; use std::process::Stdio;
use std::time::Instant; use std::time::Instant;
use std::{error, iter};
use itertools::Itertools; use itertools::Itertools;
use jj_lib::git::{self, FailedRefExport, FailedRefExportReason, GitImportStats, RefName}; use jj_lib::git::FailedRefExport;
use jj_lib::git::FailedRefExportReason;
use jj_lib::git::GitImportStats;
use jj_lib::git::RefName;
use jj_lib::git::{self};
use jj_lib::git_backend::GitBackend; use jj_lib::git_backend::GitBackend;
use jj_lib::op_store::{RefTarget, RemoteRef}; use jj_lib::op_store::RefTarget;
use jj_lib::repo::{ReadonlyRepo, Repo}; use jj_lib::op_store::RemoteRef;
use jj_lib::repo::ReadonlyRepo;
use jj_lib::repo::Repo;
use jj_lib::store::Store; use jj_lib::store::Store;
use jj_lib::workspace::Workspace; use jj_lib::workspace::Workspace;
use unicode_width::UnicodeWidthStr; use unicode_width::UnicodeWidthStr;
use crate::command_error::{user_error, CommandError}; use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::formatter::Formatter; use crate::formatter::Formatter;
use crate::progress::Progress; use crate::progress::Progress;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -18,7 +18,9 @@ use std::io::Write;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::settings::UserSettings; use jj_lib::settings::UserSettings;
use renderdag::{Ancestor, GraphRowRenderer, Renderer}; use renderdag::Ancestor;
use renderdag::GraphRowRenderer;
use renderdag::Renderer;
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]
// An edge to another node in the graph // An edge to another node in the graph

View File

@ -2,17 +2,30 @@ use std::borrow::Cow;
use std::path::Path; use std::path::Path;
use std::sync::Arc; use std::sync::Arc;
use futures::{StreamExt, TryFutureExt, TryStreamExt}; use futures::StreamExt;
use futures::TryFutureExt;
use futures::TryStreamExt;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::{BackendError, BackendResult, FileId, MergedTreeId, TreeValue}; use jj_lib::backend::BackendError;
use jj_lib::conflicts::{materialize_tree_value, MaterializedTreeValue}; use jj_lib::backend::BackendResult;
use jj_lib::diff::{Diff, DiffHunk}; use jj_lib::backend::FileId;
use jj_lib::files::{self, ContentHunk, MergeResult}; use jj_lib::backend::MergedTreeId;
use jj_lib::backend::TreeValue;
use jj_lib::conflicts::materialize_tree_value;
use jj_lib::conflicts::MaterializedTreeValue;
use jj_lib::diff::Diff;
use jj_lib::diff::DiffHunk;
use jj_lib::files::ContentHunk;
use jj_lib::files::MergeResult;
use jj_lib::files::{self};
use jj_lib::matchers::Matcher; use jj_lib::matchers::Matcher;
use jj_lib::merge::Merge; use jj_lib::merge::Merge;
use jj_lib::merged_tree::{MergedTree, MergedTreeBuilder, TreeDiffEntry}; use jj_lib::merged_tree::MergedTree;
use jj_lib::merged_tree::MergedTreeBuilder;
use jj_lib::merged_tree::TreeDiffEntry;
use jj_lib::object_id::ObjectId; use jj_lib::object_id::ObjectId;
use jj_lib::repo_path::{RepoPath, RepoPathBuf}; use jj_lib::repo_path::RepoPath;
use jj_lib::repo_path::RepoPathBuf;
use jj_lib::store::Store; use jj_lib::store::Store;
use pollster::FutureExt; use pollster::FutureExt;
use thiserror::Error; use thiserror::Error;

View File

@ -1,19 +1,24 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::fs::File; use std::fs::File;
use std::io::{self, Write}; use std::io::Write;
use std::path::{Path, PathBuf}; use std::io::{self};
use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
use futures::StreamExt; use futures::StreamExt;
use jj_lib::backend::MergedTreeId; use jj_lib::backend::MergedTreeId;
use jj_lib::fsmonitor::FsmonitorSettings; use jj_lib::fsmonitor::FsmonitorSettings;
use jj_lib::gitignore::GitIgnoreFile; use jj_lib::gitignore::GitIgnoreFile;
use jj_lib::local_working_copy::{TreeState, TreeStateError}; use jj_lib::local_working_copy::TreeState;
use jj_lib::local_working_copy::TreeStateError;
use jj_lib::matchers::Matcher; use jj_lib::matchers::Matcher;
use jj_lib::merged_tree::{MergedTree, TreeDiffEntry}; use jj_lib::merged_tree::MergedTree;
use jj_lib::merged_tree::TreeDiffEntry;
use jj_lib::repo_path::RepoPathBuf; use jj_lib::repo_path::RepoPathBuf;
use jj_lib::store::Store; use jj_lib::store::Store;
use jj_lib::working_copy::{CheckoutError, SnapshotOptions}; use jj_lib::working_copy::CheckoutError;
use jj_lib::working_copy::SnapshotOptions;
use pollster::FutureExt; use pollster::FutureExt;
use tempfile::TempDir; use tempfile::TempDir;
use thiserror::Error; use thiserror::Error;

View File

@ -1,24 +1,38 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::io::{self, Write}; use std::io::Write;
use std::process::{Command, ExitStatus, Stdio}; use std::io::{self};
use std::process::Command;
use std::process::ExitStatus;
use std::process::Stdio;
use std::sync::Arc; use std::sync::Arc;
use itertools::Itertools; use itertools::Itertools;
use jj_lib::backend::{FileId, MergedTreeId, TreeValue}; use jj_lib::backend::FileId;
use jj_lib::conflicts::{self, materialize_merge_result}; use jj_lib::backend::MergedTreeId;
use jj_lib::backend::TreeValue;
use jj_lib::conflicts::materialize_merge_result;
use jj_lib::conflicts::{self};
use jj_lib::gitignore::GitIgnoreFile; use jj_lib::gitignore::GitIgnoreFile;
use jj_lib::matchers::Matcher; use jj_lib::matchers::Matcher;
use jj_lib::merge::{Merge, MergedTreeValue}; use jj_lib::merge::Merge;
use jj_lib::merged_tree::{MergedTree, MergedTreeBuilder}; use jj_lib::merge::MergedTreeValue;
use jj_lib::merged_tree::MergedTree;
use jj_lib::merged_tree::MergedTreeBuilder;
use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPath;
use pollster::FutureExt; use pollster::FutureExt;
use thiserror::Error; use thiserror::Error;
use super::diff_working_copies::{ use super::diff_working_copies::check_out_trees;
check_out_trees, new_utf8_temp_dir, set_readonly_recursively, DiffEditWorkingCopies, DiffSide, use super::diff_working_copies::new_utf8_temp_dir;
}; use super::diff_working_copies::set_readonly_recursively;
use super::{ConflictResolveError, DiffEditError, DiffGenerateError}; use super::diff_working_copies::DiffEditWorkingCopies;
use crate::config::{find_all_variables, interpolate_variables, CommandNameAndArgs}; use super::diff_working_copies::DiffSide;
use super::ConflictResolveError;
use super::DiffEditError;
use super::DiffGenerateError;
use crate::config::find_all_variables;
use crate::config::interpolate_variables;
use crate::config::CommandNameAndArgs;
use crate::ui::Ui; use crate::ui::Ui;
/// Merge/diff tool loaded from the settings. /// Merge/diff tool loaded from the settings.

View File

@ -24,17 +24,25 @@ use jj_lib::conflicts::extract_as_single_hunk;
use jj_lib::gitignore::GitIgnoreFile; use jj_lib::gitignore::GitIgnoreFile;
use jj_lib::matchers::Matcher; use jj_lib::matchers::Matcher;
use jj_lib::merged_tree::MergedTree; use jj_lib::merged_tree::MergedTree;
use jj_lib::repo_path::{RepoPath, RepoPathBuf}; use jj_lib::repo_path::RepoPath;
use jj_lib::settings::{ConfigResultExt as _, UserSettings}; use jj_lib::repo_path::RepoPathBuf;
use jj_lib::settings::ConfigResultExt as _;
use jj_lib::settings::UserSettings;
use jj_lib::working_copy::SnapshotError; use jj_lib::working_copy::SnapshotError;
use pollster::FutureExt; use pollster::FutureExt;
use thiserror::Error; use thiserror::Error;
use self::builtin::{edit_diff_builtin, edit_merge_builtin, BuiltinToolError}; use self::builtin::edit_diff_builtin;
use self::builtin::edit_merge_builtin;
use self::builtin::BuiltinToolError;
pub(crate) use self::diff_working_copies::new_utf8_temp_dir; pub(crate) use self::diff_working_copies::new_utf8_temp_dir;
use self::diff_working_copies::DiffCheckoutError; use self::diff_working_copies::DiffCheckoutError;
use self::external::{edit_diff_external, ExternalToolError}; use self::external::edit_diff_external;
pub use self::external::{generate_diff, invoke_external_diff, DiffToolMode, ExternalMergeTool}; pub use self::external::generate_diff;
pub use self::external::invoke_external_diff;
pub use self::external::DiffToolMode;
pub use self::external::ExternalMergeTool;
use self::external::ExternalToolError;
use crate::config::CommandNameAndArgs; use crate::config::CommandNameAndArgs;
use crate::ui::Ui; use crate::ui::Ui;

View File

@ -19,10 +19,15 @@ use itertools::Itertools;
use jj_lib::backend::CommitId; use jj_lib::backend::CommitId;
use jj_lib::commit::Commit; use jj_lib::commit::Commit;
use jj_lib::repo::Repo; use jj_lib::repo::Repo;
use jj_lib::revset::{RevsetExpression, RevsetFilterPredicate, RevsetIteratorExt}; use jj_lib::revset::RevsetExpression;
use jj_lib::revset::RevsetFilterPredicate;
use jj_lib::revset::RevsetIteratorExt;
use crate::cli_util::{short_commit_hash, CommandHelper, WorkspaceCommandHelper}; use crate::cli_util::short_commit_hash;
use crate::command_error::{user_error, CommandError}; use crate::cli_util::CommandHelper;
use crate::cli_util::WorkspaceCommandHelper;
use crate::command_error::user_error;
use crate::command_error::CommandError;
use crate::ui::Ui; use crate::ui::Ui;
#[derive(Clone, Debug, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq)]

Some files were not shown because too many files have changed in this diff Show More