From: Xingyao Ye Date: Wed, 5 Dec 2012 22:04:10 +0000 (-0800) Subject: Introduce "arc diff --plan-changes" X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=6c3418a0e8f0f9033650f1cdab601bb1ef6477dd;p=arcanist.git 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 --- diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index b42d27d0..b184a99c 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -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";