mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +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:
parent
67239a08a5
commit
03ddc17032
1 changed files with 12 additions and 21 deletions
|
@ -1,9 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates git commit messages after a revision is "Accepted".
|
* Synchronizes commit messages from Differential.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistAmendWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistAmendWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
@ -21,8 +19,8 @@ EOTEXT
|
||||||
public function getCommandHelp() {
|
public function getCommandHelp() {
|
||||||
return phutil_console_format(<<<EOTEXT
|
return phutil_console_format(<<<EOTEXT
|
||||||
Supports: git, hg
|
Supports: git, hg
|
||||||
Amend the working copy after a revision has been accepted, so commits
|
Amend the working copy, synchronizing the local commit message from
|
||||||
can be marked 'committed' and pushed upstream.
|
Differential.
|
||||||
|
|
||||||
Supported in Mercurial 2.2 and newer.
|
Supported in Mercurial 2.2 and newer.
|
||||||
EOTEXT
|
EOTEXT
|
||||||
|
@ -48,14 +46,16 @@ EOTEXT
|
||||||
public function getArguments() {
|
public function getArguments() {
|
||||||
return array(
|
return array(
|
||||||
'show' => array(
|
'show' => array(
|
||||||
'help' =>
|
'help' => pht(
|
||||||
"Show the amended commit message, without modifying the working copy."
|
'Show the amended commit message, without modifying the '.
|
||||||
|
'working copy.'),
|
||||||
),
|
),
|
||||||
'revision' => array(
|
'revision' => array(
|
||||||
'param' => 'revision_id',
|
'param' => 'revision_id',
|
||||||
'help' =>
|
'help' => pht(
|
||||||
"Amend a specific revision. If you do not specify a revision, ".
|
'Use the message from a specific revision. If you do not specify '.
|
||||||
"arc will look in the commit message at HEAD.",
|
'a revision, arc will guess which revision is in the working '.
|
||||||
|
'copy.'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@ EOTEXT
|
||||||
throw new ArcanistUsageException(
|
throw new ArcanistUsageException(
|
||||||
"This project is marked as adhering to a conservative history ".
|
"This project is marked as adhering to a conservative history ".
|
||||||
"mutability doctrine (having an immutable local history), which ".
|
"mutability doctrine (having an immutable local history), which ".
|
||||||
"precludes amending commit messages. You can use 'arc merge' to ".
|
"precludes amending commit messages.");
|
||||||
"merge feature branches instead.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($repository_api->getUncommittedChanges()) {
|
if ($repository_api->getUncommittedChanges()) {
|
||||||
throw new ArcanistUsageException(
|
throw new ArcanistUsageException(
|
||||||
"You have uncommitted changes in this branch. Stage and commit (or ".
|
"You have uncommitted changes in this branch. Stage and commit (or ".
|
||||||
|
@ -166,20 +166,11 @@ EOTEXT
|
||||||
"D{$revision_id}: {$revision_title}");
|
"D{$revision_id}: {$revision_title}");
|
||||||
|
|
||||||
$repository_api->amendCommit($message);
|
$repository_api->amendCommit($message);
|
||||||
|
|
||||||
$mark_workflow = $this->buildChildWorkflow(
|
|
||||||
'close-revision',
|
|
||||||
array(
|
|
||||||
'--finalize',
|
|
||||||
$revision_id,
|
|
||||||
));
|
|
||||||
$mark_workflow->run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getSupportedRevisionControlSystems() {
|
protected function getSupportedRevisionControlSystems() {
|
||||||
return array('git', 'hg');
|
return array('git', 'hg');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue