From: vrana Date: Mon, 24 Sep 2012 18:32:38 +0000 (-0700) Subject: Unuse $argv in `arc diff --background` X-Git-Tag: conduit-6~106 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0a6be45f293822b3dd6d6655d565963b11f36464;p=arcanist.git Unuse $argv in `arc diff --background` Test Plan: This diff. Reviewers: epriestley Reviewed By: epriestley CC: zeeg, aran, Korvin Differential Revision: https://secure.phabricator.com/D3550 --- diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php index e9fcf83d..15031923 100644 --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -64,6 +64,7 @@ abstract class ArcanistBaseWorkflow { private $repositoryAPI; private $workingCopy; private $arguments; + private $passedArguments; private $command; private $repositoryEncoding; @@ -550,6 +551,10 @@ abstract class ArcanistBaseWorkflow { return idx($this->arguments, $key, $default); } + public function getPassedArguments() { + return $this->passedArguments; + } + final public function getCompleteArgumentSpecification() { $spec = $this->getArguments(); $arc_config = $this->getArcanistConfiguration(); @@ -559,6 +564,7 @@ abstract class ArcanistBaseWorkflow { } public function parseArguments(array $args) { + $this->passedArguments = $args; $spec = $this->getCompleteArgumentSpecification(); diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 5bccc159..9bbe7e7f 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -380,14 +380,14 @@ EOTEXT $background = $this->getArgument('background', !phutil_is_windows()); if ($background) { - $argv = $_SERVER['argv']; - // Insert after `arc diff`. - array_splice($argv, 2, 0, array('--recon', '--no-diff')); + $argv = $this->getPassedArguments(); if (!PhutilConsoleFormatter::getDisableANSI()) { - // Insert after `arc`. - array_splice($argv, 1, 0, array('--ansi')); + array_unshift($argv, '--ansi'); } - $lint_unit = new ExecFuture('php %Ls', $argv); + $lint_unit = new ExecFuture( + 'php %s --recon diff --no-diff %Ls', + phutil_get_library_root('arcanist').'/../scripts/arcanist.php', + $argv); $lint_unit->write('', true); $lint_unit->start(); }