]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't amend existing revision with `arc diff --create`
authorvrana <jakubv@fb.com>
Fri, 22 Feb 2013 17:52:00 +0000 (09:52 -0800)
committervrana <jakubv@fb.com>
Fri, 22 Feb 2013 22:16:32 +0000 (14:16 -0800)
Summary: If there's other revision in last commit message and I said `--create` then it is clear that I want to create a new commit.

Test Plan:
  $ arc diff --create # in dirty working copy on top of my open revision

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D5078

src/workflow/ArcanistBaseWorkflow.php

index 421e250669669681d0f3863398ed925912f0edc0..6cf149028ece03eb82f45c68416723b780e15634 100644 (file)
@@ -871,10 +871,11 @@ abstract class ArcanistBaseWorkflow extends Phobject {
     if (!$commits) {
       return false;
     }
-    $commit = reset($commits);
 
+    $commit = reset($commits);
     $message = ArcanistDifferentialCommitMessage::newFromRawCorpus(
       $commit['message']);
+
     if ($message->getGitSVNBaseRevision()) {
       return false;
     }
@@ -883,6 +884,10 @@ abstract class ArcanistBaseWorkflow extends Phobject {
       return false;
     }
 
+    if ($message->getRevisionID() && $this->getArgument('create')) {
+      return false;
+    }
+
     // TODO: Check commits since tracking branch. If empty then return false.
 
     $repository = $this->loadProjectRepository();