From: vrana Date: Tue, 18 Sep 2012 21:14:12 +0000 (-0700) Subject: Make `arc diff --background 1` default and disable it on Windows X-Git-Tag: conduit-6~109 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e1b2d787c9b34b04e02a11d83bbf8451ca8b05e9;p=arcanist.git Make `arc diff --background 1` default and disable it on Windows Summary: I am using it for about a month. It works even in Facebook www. Test Plan: $ arc diff --background 1 # hundreds of times Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3495 --- diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index f645cc82..0c8582a9 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -92,7 +92,7 @@ EOTEXT } public function getArguments() { - return array( + $arguments = array( 'message' => array( 'short' => 'm', 'param' => 'message', @@ -349,10 +349,16 @@ EOTEXT 'param' => 'bool', 'help' => 'Run lint and unit tests on background. '. - '"0" to disable (default), "1" to enable.', + '"0" to disable, "1" to enable (default).', ), '*' => 'paths', ); + + if (phutil_is_windows()) { + unset($arguments['background']); + } + + return $arguments; } public function isRawDiffSource() { @@ -371,7 +377,9 @@ EOTEXT $this->runDiffSetupBasics(); - if ($this->getArgument('background')) { + $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')); @@ -394,7 +402,7 @@ EOTEXT $revision = $this->buildRevisionFromCommitMessage($commit_message); } - if ($this->getArgument('background')) { + if ($background) { $server = new PhutilConsoleServer(); $server->addExecFutureClient($lint_unit); $server->run();