diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php index 7e35a1e3..51e8c36e 100644 --- a/src/repository/api/ArcanistMercurialAPI.php +++ b/src/repository/api/ArcanistMercurialAPI.php @@ -442,6 +442,12 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { } private function getFileDataAtRevision($path, $revision) { + // Mozilla: an added file has no old path and a deleted one no new path. + // Passing null to "hg cat" is deprecated in PHP 8, which arc turns into an + // exception, so return what a failed "hg cat" would. + if ($path === null) { + return null; + } list($err, $stdout) = $this->execManualLocal( 'cat --rev %s -- %s', $revision, diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index f8a627d7..8e7b0b51 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -1011,7 +1011,11 @@ EOTEXT $file_list = ' '.implode("\n ", $file_list); echo $file_list; - if (!phutil_console_confirm($confirm, $default_no = false)) { + // Mozilla: without a TTY (as in Updatebot's automation) nobody can + // answer, so take the default and mark the files as binary. + $interactive = !function_exists('posix_isatty') || posix_isatty(STDIN); + if ($interactive && + !phutil_console_confirm($confirm, $default_no = false)) { throw new ArcanistUsageException(pht('Aborted workflow to fix UTF-8.')); } else { foreach ($utf8_problems as $change) {