]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Introduce "arc diff --plan-changes"
authorXingyao Ye <xingyao@dev1163.prn1.facebook.com>
Wed, 5 Dec 2012 22:04:10 +0000 (14:04 -0800)
committerXingyao Ye <xingyao@dev1163.prn1.facebook.com>
Wed, 5 Dec 2012 22:04:11 +0000 (14:04 -0800)
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

src/workflow/ArcanistDiffWorkflow.php

index b42d27d056cecf3b5d591f581e6bd9f92adb8fd5..b184a99c6e0756ece09117bf12f4620c9555b790 100644 (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";