mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
Introduce "arc diff --plan-changes"
Summary: Allow authors to publish a new or updated revision to Phabricator without requesting code reviews. The revision will have status "Needs Revision" instead of "Needs Review". In order to avoid a change of Conduit API, this is done by adding a comment with the "plan changes" action immediately after the revision is published. Test Plan: Using my local repository, run "./bin/arc diff --plan-changes" Check the resulting diff in Phabricator. Reviewers: vrana Reviewed By: vrana CC: aran, epriestley Maniphest Tasks: T2024 Differential Revision: https://secure.phabricator.com/D4084
This commit is contained in:
parent
ba1a17ac31
commit
6c3418a0e8
1 changed files with 19 additions and 2 deletions
|
@ -206,6 +206,14 @@ EOTEXT
|
|||
'message' => '--preview does not update any revision.',
|
||||
),
|
||||
),
|
||||
'plan-changes' => array(
|
||||
'help' =>
|
||||
"Create or update a revision without requesting a code review.",
|
||||
'conflicts' => array(
|
||||
'only' => '--only does not affect revisions.',
|
||||
'preview' => '--preview does not affect revisions.',
|
||||
),
|
||||
),
|
||||
'encoding' => array(
|
||||
'param' => 'encoding',
|
||||
'help' =>
|
||||
|
@ -514,10 +522,9 @@ EOTEXT
|
|||
$revision['diffid'] = $this->getDiffID();
|
||||
|
||||
if ($commit_message->getRevisionID()) {
|
||||
$future = $conduit->callMethod(
|
||||
$result = $conduit->callMethodSynchronous(
|
||||
'differential.updaterevision',
|
||||
$revision);
|
||||
$result = $future->resolve();
|
||||
|
||||
foreach (array('edit-messages.json', 'update-messages.json') as $file) {
|
||||
$messages = $this->readScratchJSONFile($file);
|
||||
|
@ -559,6 +566,16 @@ EOTEXT
|
|||
echo phutil_console_format(
|
||||
" **Revision URI:** __%s__\n\n",
|
||||
$uri);
|
||||
|
||||
if ($this->getArgument('plan-changes')) {
|
||||
$conduit->callMethodSynchronous(
|
||||
'differential.createcomment',
|
||||
array(
|
||||
'revision_id' => $result['revisionid'],
|
||||
'action' => 'rethink',
|
||||
));
|
||||
echo "Planned changes to the revision.\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Included changes:\n";
|
||||
|
|
Loading…
Reference in a new issue