1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Don't close revisions on "arc amend"

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
This commit is contained in:
epriestley 2014-03-13 18:00:20 -07:00
parent 67239a08a5
commit 03ddc17032

View 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');
}