]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Throw a helpful message when users run "arc diff --raw --update".
authorepriestley <git@epriestley.com>
Tue, 20 Mar 2012 02:15:58 +0000 (19:15 -0700)
committerepriestley <git@epriestley.com>
Tue, 20 Mar 2012 02:15:58 +0000 (19:15 -0700)
Summary: We crash and burn right now, trying to launch an interactive editor against a non-tty stdin. Raise a helpful error message instead.

Test Plan: Will run "arc diff --raw --update".

Reviewers: btrahan, yairlivne

Reviewed By: btrahan

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

src/workflow/diff/ArcanistDiffWorkflow.php

index 18e365b1a32a2ecf8f6c8b5f76b812bb18b055da..0d94264ba1bca555f8531f671d5cd57fd50eb801 100644 (file)
@@ -92,16 +92,10 @@ EOTEXT
     return array(
       'message' => array(
         'short'       => 'm',
-        'supports'    => array(
-          'git',
-        ),
-        'nosupport'   => array(
-          'svn' => 'Edit revisions via the web interface when using SVN.',
-        ),
         'param'       => 'message',
         'help' =>
-          "When updating a revision under git, use the specified message ".
-          "instead of prompting.",
+          "When updating a revision, use the specified message instead of ".
+          "prompting.",
       ),
       'message-file' => array(
         'short' => 'F',
@@ -1472,6 +1466,13 @@ EOTEXT
       return $comments;
     }
 
+    if ($this->getArgument('raw')) {
+      throw new ArcanistUsageException(
+        "When using '--raw' to update a revision, specify an update message ".
+        "with '--message'. (Normally, we'd launch an editor to ask you for a ".
+        "message, but can not do that because stdin is a diff source.)");
+    }
+
     // When updating a revision using git without specifying '--message', try
     // to prefill with the message in HEAD if it isn't a template message. The
     // idea is that if you do: