forked from mirrors/jj
cli: move cmd_operation() dispatcher fn next to type definition
This commit is contained in:
parent
15e0d62380
commit
b72f2827d0
1 changed files with 13 additions and 13 deletions
|
@ -39,6 +39,19 @@ pub enum OperationCommand {
|
|||
Restore(OperationRestoreArgs),
|
||||
}
|
||||
|
||||
pub fn cmd_operation(
|
||||
ui: &mut Ui,
|
||||
command: &CommandHelper,
|
||||
subcommand: &OperationCommand,
|
||||
) -> Result<(), CommandError> {
|
||||
match subcommand {
|
||||
OperationCommand::Abandon(args) => cmd_op_abandon(ui, command, args),
|
||||
OperationCommand::Log(args) => cmd_op_log(ui, command, args),
|
||||
OperationCommand::Restore(args) => cmd_op_restore(ui, command, args),
|
||||
OperationCommand::Undo(args) => cmd_op_undo(ui, command, args),
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)]
|
||||
pub enum UndoWhatToRestore {
|
||||
/// The jj repo state and local branches
|
||||
|
@ -77,16 +90,3 @@ fn view_with_desired_portions_restored(
|
|||
wc_commit_ids: repo_source.wc_commit_ids.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cmd_operation(
|
||||
ui: &mut Ui,
|
||||
command: &CommandHelper,
|
||||
subcommand: &OperationCommand,
|
||||
) -> Result<(), CommandError> {
|
||||
match subcommand {
|
||||
OperationCommand::Abandon(args) => cmd_op_abandon(ui, command, args),
|
||||
OperationCommand::Log(args) => cmd_op_log(ui, command, args),
|
||||
OperationCommand::Restore(args) => cmd_op_restore(ui, command, args),
|
||||
OperationCommand::Undo(args) => cmd_op_undo(ui, command, args),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue