]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Reuse code in close-revision workflow
authorvrana <jakubv@fb.com>
Sat, 8 Dec 2012 02:02:09 +0000 (18:02 -0800)
committervrana <jakubv@fb.com>
Sat, 8 Dec 2012 02:22:23 +0000 (18:22 -0800)
Test Plan: Will test it by closing this revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4122

src/workflow/ArcanistCloseRevisionWorkflow.php

index 995ce4ce5caacab67204bf0cfa958eef4f06c305..0c832a1845cfeb5503eae2a2e9fafd986565f226 100644 (file)
@@ -115,17 +115,10 @@ EOTEXT
 
       $actually_close = true;
       if ($is_finalize) {
-        $project_id = $this->getWorkingCopy()->getProjectID();
-        if ($project_id) {
-          $project_info = $conduit->callMethodSynchronous(
-            'arcanist.projectinfo',
-            array(
-              'name' => $project_id,
-            ));
-          if ($project_info['tracked'] ||
-              $revision['status'] != $status_accepted) {
-            $actually_close = false;
-          }
+        $project_info = $this->getProjectInfo();
+        if (idx($project_info, 'tracked') ||
+            $revision['status'] != $status_accepted) {
+          $actually_close = false;
         }
       }
       if ($actually_close) {