]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Make "arc diff --raw -C HEAD" work correctly
authorepriestley <git@epriestley.com>
Mon, 5 Mar 2012 18:08:50 +0000 (10:08 -0800)
committerepriestley <git@epriestley.com>
Mon, 5 Mar 2012 18:08:50 +0000 (10:08 -0800)
Summary:
There's no reason this can't work now, we're just not quite careful enough about definitions.

NOTE: If you use a message which has a revision ID in it already, this will fail in an obtuse way when launching the update editor fails because stdin isn't a tty. I'll clean this all up after T614 is fully sorted.

Test Plan: Ran "arc diff --raw -C HEAD".

Reviewers: btrahan, yairlivne

Reviewed By: btrahan

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

src/workflow/diff/ArcanistDiffWorkflow.php

index b650868e9bf6eb73e186cf626139905eafad25ff..bfae80aa821e211b8c8c0c4ce1b7292ed82d8607 100644 (file)
@@ -73,7 +73,15 @@ EOTEXT
   }
 
   public function requiresRepositoryAPI() {
-    return !$this->isRawDiffSource();
+    if (!$this->isRawDiffSource()) {
+      return true;
+    }
+
+    if ($this->getArgument('use-commit-message')) {
+      return true;
+    }
+
+    return false;
   }
 
   public function getDiffID() {
@@ -451,7 +459,7 @@ EOTEXT
             'revision_id' => $result['revisionid'],
           ));
 
-        if ($this->requiresRepositoryAPI()) {
+        if (!$this->isRawDiffSource()) {
           $repository_api = $this->getRepositoryAPI();
           if (($repository_api instanceof ArcanistGitAPI) &&
               $this->shouldAmend()) {
@@ -1621,7 +1629,7 @@ EOTEXT
   private function getDefaultCreateFields() {
     $empty = array(array(), array());
 
-    if (!$this->requiresRepositoryAPI()) {
+    if ($this->isRawDiffSource()) {
       return $empty;
     }
 
@@ -1669,7 +1677,7 @@ EOTEXT
   }
 
   private function getDefaultUpdateMessage() {
-    if (!$this->requiresRepositoryAPI()) {
+    if ($this->isRawDiffSource()) {
       return null;
     }
 
@@ -1857,7 +1865,7 @@ EOTEXT
     $source_path    = null;
     $branch         = null;
 
-    if ($this->requiresRepositoryAPI()) {
+    if (!$this->isRawDiffSource()) {
       $repository_api = $this->getRepositoryAPI();
 
       $base_revision  = $repository_api->getSourceControlBaseRevision();