diff --git a/src/future/exec/PhutilExecPassthru.php b/src/future/exec/PhutilExecPassthru.php --- a/src/future/exec/PhutilExecPassthru.php +++ b/src/future/exec/PhutilExecPassthru.php @@ -10,8 +10,8 @@ * This is primarily useful for executing things like `$EDITOR` from command * line scripts. * - * $exec = new PhutilExecPassthru('ls %s', $dir); - * $err = $exec->execute(); + * $exec = new PhutilExecPassthru('nano -- %s', $filename); + * $err = $exec->resolve(); * * You can set the current working directory for the command with * @{method:setCWD}, and set the environment with @{method:setEnv}. @@ -30,6 +30,14 @@ /* -( Executing Passthru Commands )---------------------------------------- */ + public function execute() { + phlog( + pht( + 'The "execute()" method of "PhutilExecPassthru" is deprecated and '. + 'calls should be replaced with "resolve()". See T13660.')); + return $this->resolve(); + } + /** * Execute this command. * @@ -37,7 +45,7 @@ * * @task command */ - public function execute() { + private function executeCommand() { $command = $this->getCommand(); $is_write = ($this->stdinData !== null); @@ -116,7 +124,7 @@ // make it easier to share code with ExecFuture. if (!$this->hasResult()) { - $result = $this->execute(); + $result = $this->executeCommand(); $this->setResult($result); } diff --git a/src/future/exec/__tests__/ExecPassthruTestCase.php b/src/future/exec/__tests__/ExecPassthruTestCase.php --- a/src/future/exec/__tests__/ExecPassthruTestCase.php +++ b/src/future/exec/__tests__/ExecPassthruTestCase.php @@ -11,7 +11,7 @@ $bin = $this->getSupportExecutable('exit'); $exec = new PhutilExecPassthru('php -f %R', $bin); - $err = $exec->execute(); + $err = $exec->resolve(); $this->assertEqual(0, $err); } diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php --- a/src/workflow/ArcanistPatchWorkflow.php +++ b/src/workflow/ArcanistPatchWorkflow.php @@ -707,7 +707,7 @@ 'git apply --whitespace nowarn --index --reject -- %s', $patchfile); $passthru->setCWD($repository_api->getPath()); - $err = $passthru->execute(); + $err = $passthru->resolve(); if ($err) { echo phutil_console_format(