1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 08:52:39 +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:
Xingyao Ye 2012-12-05 14:04:10 -08:00
parent ba1a17ac31
commit 6c3418a0e8

View file

@ -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";