]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Make `arc diff --background 1` default and disable it on Windows
authorvrana <jakubv@fb.com>
Tue, 18 Sep 2012 21:14:12 +0000 (14:14 -0700)
committervrana <jakubv@fb.com>
Fri, 21 Sep 2012 22:29:22 +0000 (15:29 -0700)
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

src/workflow/ArcanistDiffWorkflow.php

index f645cc82a84afb498500cd38ff87c790f8806803..0c8582a928a74678fbfe928a578a2e18febd44f3 100644 (file)
@@ -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();