]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't close revisions on "arc amend"
authorepriestley <git@epriestley.com>
Fri, 14 Mar 2014 01:00:20 +0000 (18:00 -0700)
committerepriestley <git@epriestley.com>
Fri, 14 Mar 2014 01:00:20 +0000 (18:00 -0700)
Summary:
Ref T4603. This workflow predates `arc land` and doesn't make much sense in modern Phabricator/Arcanist. It is surprising that `arc amend` will sometimes close accepted revisions, and we're better at detecting that repositories are tracked, and tracking repositories is easier.

Also fix some inaccuracies and old claims in the documenation and help.

Test Plan: Ran `arc amend`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: aran, epriestley

Maniphest Tasks: T4603

Differential Revision: https://secure.phabricator.com/D8522

src/workflow/ArcanistAmendWorkflow.php

index 1866f100028afdaec4c21b8529acceec6ae81ff1..3d7d3c09cf59683259d9129bf3c74e2bdd6d0fc0 100644 (file)
@@ -1,9 +1,7 @@
 <?php
 
 /**
- * Updates git commit messages after a revision is "Accepted".
- *
- * @group workflow
+ * Synchronizes commit messages from Differential.
  */
 final class ArcanistAmendWorkflow extends ArcanistBaseWorkflow {
 
@@ -21,8 +19,8 @@ EOTEXT
   public function getCommandHelp() {
     return phutil_console_format(<<<EOTEXT
           Supports: git, hg
-          Amend the working copy after a revision has been accepted, so commits
-          can be marked 'committed' and pushed upstream.
+          Amend the working copy, synchronizing the local commit message from
+          Differential.
 
           Supported in Mercurial 2.2 and newer.
 EOTEXT
@@ -48,14 +46,16 @@ EOTEXT
   public function getArguments() {
     return array(
       'show' => array(
-        'help' =>
-          "Show the amended commit message, without modifying the working copy."
+        'help' => pht(
+          'Show the amended commit message, without modifying the '.
+          'working copy.'),
       ),
       'revision' => array(
         'param' => 'revision_id',
-        'help' =>
-          "Amend a specific revision. If you do not specify a revision, ".
-          "arc will look in the commit message at HEAD.",
+        'help' => pht(
+          'Use the message from a specific revision. If you do not specify '.
+          'a revision, arc will guess which revision is in the working '.
+          'copy.'),
       ),
     );
   }
@@ -75,9 +75,9 @@ EOTEXT
         throw new ArcanistUsageException(
           "This project is marked as adhering to a conservative history ".
           "mutability doctrine (having an immutable local history), which ".
-          "precludes amending commit messages. You can use 'arc merge' to ".
-          "merge feature branches instead.");
+          "precludes amending commit messages.");
       }
+
       if ($repository_api->getUncommittedChanges()) {
         throw new ArcanistUsageException(
           "You have uncommitted changes in this branch. Stage and commit (or ".
@@ -166,20 +166,11 @@ EOTEXT
         "D{$revision_id}: {$revision_title}");
 
       $repository_api->amendCommit($message);
-
-      $mark_workflow = $this->buildChildWorkflow(
-        'close-revision',
-        array(
-          '--finalize',
-          $revision_id,
-        ));
-      $mark_workflow->run();
     }
 
     return 0;
   }
 
-
   protected function getSupportedRevisionControlSystems() {
     return array('git', 'hg');
   }