From 448e820eb6be33614cceef4792afb34b4cc567fc Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 23 Oct 2012 15:21:01 -0700 Subject: [PATCH] Run unit on background also in waiting for confirmation with `arc diff --excuse` Test Plan: Made lint error, slept in test, verified that tests are finished when I confirm `arc diff --excuse`. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3803 --- src/workflow/ArcanistDiffWorkflow.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 2088f463..81637bef 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -1372,11 +1372,10 @@ EOTEXT private function getErrorExcuse($type, $prompt, $history) { if ($this->getArgument('excuse')) { - $prompt .= " Ignore them?"; - if (!$this->console->confirm($prompt)) { - throw new ArcanistUserAbortException(); - } - $this->excuses[$type] = $this->getArgument('excuse'); + $this->console->sendMessage(array( + 'type' => $type, + 'confirm' => $prompt." Ignore them?", + )); return; } @@ -1393,7 +1392,12 @@ EOTEXT public function handleServerMessage(PhutilConsoleMessage $message) { $data = $message->getData(); - $response = phutil_console_prompt($data['prompt'], idx($data, 'history')); + $response = ''; + if (isset($data['prompt'])) { + $response = phutil_console_prompt($data['prompt'], idx($data, 'history')); + } else if (phutil_console_confirm($data['confirm'])) { + $response = $this->getArgument('excuse'); + } if ($response == '') { throw new ArcanistUserAbortException(); }