diff --git a/cli/src/commands/debug/working_copy.rs b/cli/src/commands/debug/local_working_copy.rs similarity index 89% rename from cli/src/commands/debug/working_copy.rs rename to cli/src/commands/debug/local_working_copy.rs index 202fb379af5..165a8476c28 100644 --- a/cli/src/commands/debug/working_copy.rs +++ b/cli/src/commands/debug/local_working_copy.rs @@ -22,14 +22,14 @@ use crate::cli_util::CommandHelper; use crate::command_error::CommandError; use crate::ui::Ui; -/// Show information about the working copy state +/// Show information about the local working copy state #[derive(clap::Args, Clone, Debug)] -pub struct WorkingCopyArgs {} +pub struct LocalWorkingCopyArgs {} -pub fn cmd_debug_working_copy( +pub fn cmd_debug_local_working_copy( ui: &mut Ui, command: &CommandHelper, - _args: &WorkingCopyArgs, + _args: &LocalWorkingCopyArgs, ) -> Result<(), CommandError> { let workspace_command = command.workspace_helper(ui)?; let wc = check_local_disk_wc(workspace_command.working_copy().as_any())?; diff --git a/cli/src/commands/debug/mod.rs b/cli/src/commands/debug/mod.rs index f7fb4ed7a09..5f9f46e05aa 100644 --- a/cli/src/commands/debug/mod.rs +++ b/cli/src/commands/debug/mod.rs @@ -21,7 +21,7 @@ pub mod snapshot; pub mod template; pub mod tree; pub mod watchman; -pub mod working_copy; +pub mod local_working_copy; use std::any::Any; use std::fmt::Debug; @@ -38,7 +38,7 @@ use self::snapshot::{cmd_debug_snapshot, SnapshotArgs}; use self::template::{cmd_debug_template, TemplateArgs}; use self::tree::{cmd_debug_tree, TreeArgs}; use self::watchman::{cmd_debug_watchman, WatchmanCommand}; -use self::working_copy::{cmd_debug_working_copy, WorkingCopyArgs}; +use self::local_working_copy::{cmd_debug_local_working_copy, LocalWorkingCopyArgs}; use crate::cli_util::CommandHelper; use crate::command_error::{user_error, CommandError}; use crate::ui::Ui; @@ -49,6 +49,7 @@ use crate::ui::Ui; pub enum DebugCommand { Fileset(FilesetArgs), Index(IndexArgs), + LocalWorkingCopy(LocalWorkingCopyArgs), #[command(visible_alias = "view")] Operation(OperationArgs), Reindex(ReindexArgs), @@ -58,7 +59,6 @@ pub enum DebugCommand { Tree(TreeArgs), #[command(subcommand)] Watchman(WatchmanCommand), - WorkingCopy(WorkingCopyArgs), } pub fn cmd_debug( @@ -69,6 +69,7 @@ pub fn cmd_debug( match subcommand { DebugCommand::Fileset(args) => cmd_debug_fileset(ui, command, args), DebugCommand::Index(args) => cmd_debug_index(ui, command, args), + DebugCommand::LocalWorkingCopy(args) => cmd_debug_local_working_copy(ui, command, args), DebugCommand::Operation(args) => cmd_debug_operation(ui, command, args), DebugCommand::Reindex(args) => cmd_debug_reindex(ui, command, args), DebugCommand::Revset(args) => cmd_debug_revset(ui, command, args), @@ -76,7 +77,6 @@ pub fn cmd_debug( DebugCommand::Template(args) => cmd_debug_template(ui, command, args), DebugCommand::Tree(args) => cmd_debug_tree(ui, command, args), DebugCommand::Watchman(args) => cmd_debug_watchman(ui, command, args), - DebugCommand::WorkingCopy(args) => cmd_debug_working_copy(ui, command, args), } } diff --git a/cli/tests/test_operations.rs b/cli/tests/test_operations.rs index e6a5b160bd2..5b140adf89b 100644 --- a/cli/tests/test_operations.rs +++ b/cli/tests/test_operations.rs @@ -381,7 +381,7 @@ fn test_op_abandon_ancestors() { Abandoned 3 operations and reparented 1 descendant operations. "###); insta::assert_snapshot!( - test_env.jj_cmd_success(&repo_path, &["debug", "working-copy", "--ignore-working-copy"]), @r###" + test_env.jj_cmd_success(&repo_path, &["debug", "local-working-copy", "--ignore-working-copy"]), @r###" Current operation: OperationId("10e856d0579c4aca88972ffea0a515f47f8c09dceaa2b1a5d531c83b04350f7aa64a3eff422def01eebd65df26089ef5e0f925f247a8f929c8cc858d16306e53") Current tree: Merge(Resolved(TreeId("4b825dc642cb6eb9a060e54bf8d69288fbee4904"))) "###); @@ -430,7 +430,7 @@ fn test_op_abandon_ancestors() { Abandoned 1 operations and reparented 1 descendant operations. "###); insta::assert_snapshot!( - test_env.jj_cmd_success(&repo_path, &["debug", "working-copy", "--ignore-working-copy"]), @r###" + test_env.jj_cmd_success(&repo_path, &["debug", "local-working-copy", "--ignore-working-copy"]), @r###" Current operation: OperationId("445e93662d714f53fb97e450eb3793a8e1a9a4cca1e329d5a9096e65085fb96d5bb51659531145c8abf0db5da803cd11c4cecdcf9025391bc97fc6a42204a0fe") Current tree: Merge(Resolved(TreeId("4b825dc642cb6eb9a060e54bf8d69288fbee4904"))) "###); @@ -475,7 +475,7 @@ fn test_op_abandon_without_updating_working_copy() { Abandoned 1 operations and reparented 1 descendant operations. "###); insta::assert_snapshot!( - test_env.jj_cmd_success(&repo_path, &["debug", "working-copy", "--ignore-working-copy"]), @r###" + test_env.jj_cmd_success(&repo_path, &["debug", "local-working-copy", "--ignore-working-copy"]), @r###" Current operation: OperationId("61aeade2493b190412c61b9b0711025c2cccf95966870a5f7dc2e34ab313fbef64da70d00cab2cd69ad39816faeb80a6bc866927549b84dce6cb5a437e0e515b") Current tree: Merge(Resolved(TreeId("4b825dc642cb6eb9a060e54bf8d69288fbee4904"))) "###); @@ -495,7 +495,7 @@ fn test_op_abandon_without_updating_working_copy() { Warning: The working copy operation 61aeade2493b is not updated because it differs from the repo ae6364994418. "###); insta::assert_snapshot!( - test_env.jj_cmd_success(&repo_path, &["debug", "working-copy", "--ignore-working-copy"]), @r###" + test_env.jj_cmd_success(&repo_path, &["debug", "local-working-copy", "--ignore-working-copy"]), @r###" Current operation: OperationId("61aeade2493b190412c61b9b0711025c2cccf95966870a5f7dc2e34ab313fbef64da70d00cab2cd69ad39816faeb80a6bc866927549b84dce6cb5a437e0e515b") Current tree: Merge(Resolved(TreeId("4b825dc642cb6eb9a060e54bf8d69288fbee4904"))) "###);