From d099dfd4fc29b0408daeacb465f6e3460cdc3258 Mon Sep 17 00:00:00 2001 From: Philip Metzger Date: Tue, 2 May 2023 16:30:25 +0200 Subject: [PATCH] WIP: run: Request the to be used working-copies from the WorkingCopyStore backend. NOTE: This should after its child, as the caching backend is not clear yet. This also cleans up the `revisions: Vec` to a `RevisionArg` which was a leftover from a previous patch. --- cli/src/commands/run.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/src/commands/run.rs b/cli/src/commands/run.rs index cbcab0296f..4dc1c4417c 100644 --- a/cli/src/commands/run.rs +++ b/cli/src/commands/run.rs @@ -39,7 +39,7 @@ pub struct RunArgs { shell_command: String, /// The revisions to change. #[arg(long, short, default_value = "@")] - revisions: Vec, + revisions: RevisionArg, /// A no-op option to match the interface of `git rebase -x`. #[arg(short = 'x', hide = true)] unused_command: bool, @@ -52,7 +52,7 @@ pub fn cmd_run(ui: &mut Ui, command: &CommandHelper, args: &RunArgs) -> Result<( let workspace_command = command.workspace_helper(ui)?; let _resolved_commits: Vec<_> = workspace_command .parse_union_revsets(&args.revisions)? - .evaluate_to_commits()? + .evaluate_to_commits() .try_collect()?; // Jobs are resolved in this order: // 1. Commandline argument iff > 0. @@ -65,5 +65,9 @@ pub fn cmd_run(ui: &mut Ui, command: &CommandHelper, args: &RunArgs) -> Result<( } // Fallback to a single user-visible job. .unwrap_or(1usize); + + let repo = workspace_command.repo(); + let cache_backend = repo.working_copy_store(); + let _wc_copies = cache_backend.get_or_create_stores(_resolved_commits)?; Err(user_error("This is a stub, do not use")) }