]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't advice using --less-context if already used
authorvrana <jakubv@fb.com>
Fri, 13 Apr 2012 23:21:23 +0000 (16:21 -0700)
committervrana <jakubv@fb.com>
Sun, 15 Apr 2012 04:50:52 +0000 (21:50 -0700)
Test Plan:
  arc diff
  arc diff --less-context

Reviewers: blair

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D2233

src/workflow/diff/ArcanistDiffWorkflow.php

index 13e6df2bf2595da24cc7f94f8cd41ed6632dd45e..e8e400785b96e0223cceae9220a0bcb00e55f74f 100644 (file)
@@ -733,8 +733,12 @@ EOTEXT
         $change_size = number_format($size);
         $byte_warning =
           "Diff for '{$file_name}' with context is {$change_size} bytes in ".
-          "length. Generally, source changes should not be this large. If ".
-          "this file is a huge text file, try using the '--less-context' flag.";
+          "length. Generally, source changes should not be this large.";
+        if (!$this->getArgument('less-context')) {
+          $byte_warning .=
+            " If this file is a huge text file, try using the ".
+            "'--less-context' flag.";
+        }
         if ($repository_api instanceof ArcanistSubversionAPI) {
           throw new ArcanistUsageException(
             "{$byte_warning} If the file is not a text file, mark it as ".