diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -1124,10 +1124,10 @@ } if (empty($this->changeCache[$path])) { - if ($is_git) { - // This can legitimately occur under git if you make a change, "git - // commit" it, and then revert the change in the working copy and run - // "arc lint". + if ($is_git || $is_hg) { + // This can legitimately occur under git/hg if you make a change, + // "git/hg commit" it, and then revert the change in the working copy + // and run "arc lint". $change = new ArcanistDiffChange(); $change->setCurrentPath($path); return $change; diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -394,6 +394,11 @@ 'unit' => true, ), ), + 'auto-convert-binary' => array( + 'help' => + 'Mark file as binary without prompting in case that changes '. + 'to a file exceed the size limit.', + ), '*' => 'paths', ); @@ -999,7 +1004,8 @@ $confirm = "{$byte_warning} If the file is not a text file, you can ". "mark it 'binary'. Mark this file as 'binary' and continue?"; - if (phutil_console_confirm($confirm)) { + if ($this->getArgument('auto-convert-binary') || + phutil_console_confirm($confirm)) { $change->convertToBinaryChange($repository_api); } else { throw new ArcanistUsageException(