From 710bceab10319beec84c7e4cb204c5462a88a30d Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 8 Jul 2020 13:31:55 -0700 Subject: [PATCH] When "arc land" fails a Mercurial push, actually raise it as an exception Summary: See PHI1808. Some refactoring of the "passthru" API resulted in error conditinos here being dropped. Instead, raise them as exceptions. Test Plan: Forced "hg push" to fail, used "arc land" against a failed push, saw error behavior instead of "success" feedback. Differential Revision: https://secure.phabricator.com/D21394 --- src/land/engine/ArcanistMercurialLandEngine.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/land/engine/ArcanistMercurialLandEngine.php b/src/land/engine/ArcanistMercurialLandEngine.php index 59ccabab..cbab0033 100644 --- a/src/land/engine/ArcanistMercurialLandEngine.php +++ b/src/land/engine/ArcanistMercurialLandEngine.php @@ -834,7 +834,12 @@ final class ArcanistMercurialLandEngine try { foreach ($body as $command) { - $this->newPassthru('%Ls', $command); + $err = $this->newPassthru('%Ls', $command); + if ($err) { + throw new ArcanistUsageException( + pht( + 'Push failed! Fix the error and run "arc land" again.')); + } } } finally { foreach ($tail as $command) {