]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Flush output before printing lint and unit results in diff
authorvrana <jakubv@fb.com>
Fri, 21 Sep 2012 22:27:36 +0000 (15:27 -0700)
committervrana <jakubv@fb.com>
Mon, 24 Sep 2012 18:04:02 +0000 (11:04 -0700)
Summary:
Under HPHP, output buffer size is ignored.
Flush any buffered output before printing anything from `arc diff` to reduce user's confusion.

Test Plan:
  $ arc diff --preview --background 1
  $ arc diff --preview --background 0

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3543

src/workflow/ArcanistDiffWorkflow.php

index 0c8582a928a74678fbfe928a578a2e18febd44f3..af2d932f0428e0a796c7f6b4a6717314a859eb48 100644 (file)
@@ -1235,6 +1235,7 @@ EOTEXT
       }
 
       $lint_result = $lint_workflow->run();
+      $this->flushOutput();
 
       switch ($lint_result) {
         case ArcanistLintWorkflow::RESULT_OKAY:
@@ -1307,6 +1308,7 @@ EOTEXT
       }
       $unit_workflow = $this->buildChildWorkflow('unit', $argv);
       $unit_result = $unit_workflow->run();
+      $this->flushOutput();
 
       switch ($unit_result) {
         case ArcanistUnitWorkflow::RESULT_OKAY:
@@ -1379,6 +1381,12 @@ EOTEXT
     return $return;
   }
 
+  private function flushOutput() {
+    if ($this->getArgument('no-diff')) {
+      ob_flush();
+    }
+  }
+
 
 /* -(  Commit and Update Messages  )----------------------------------------- */