diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index cbc178ee66..ba266c91ed 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -239,7 +239,6 @@ phutil_register_library_map(array( 'ConduitAPI_releephwork_getbranch_Method' => 'applications/releeph/conduit/work/ConduitAPI_releephwork_getbranch_Method.php', 'ConduitAPI_releephwork_getbranchcommitmessage_Method' => 'applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php', 'ConduitAPI_releephwork_getcommitmessage_Method' => 'applications/releeph/conduit/work/ConduitAPI_releephwork_getcommitmessage_Method.php', - 'ConduitAPI_releephwork_getorigcommitmessage_Method' => 'applications/releeph/conduit/work/ConduitAPI_releephwork_getorigcommitmessage_Method.php', 'ConduitAPI_releephwork_nextrequest_Method' => 'applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php', 'ConduitAPI_releephwork_record_Method' => 'applications/releeph/conduit/work/ConduitAPI_releephwork_record_Method.php', 'ConduitAPI_releephwork_recordpickstatus_Method' => 'applications/releeph/conduit/work/ConduitAPI_releephwork_recordpickstatus_Method.php', @@ -2827,7 +2826,6 @@ phutil_register_library_map(array( 'ConduitAPI_releephwork_getbranch_Method' => 'ConduitAPI_releeph_Method', 'ConduitAPI_releephwork_getbranchcommitmessage_Method' => 'ConduitAPI_releeph_Method', 'ConduitAPI_releephwork_getcommitmessage_Method' => 'ConduitAPI_releeph_Method', - 'ConduitAPI_releephwork_getorigcommitmessage_Method' => 'ConduitAPI_releeph_Method', 'ConduitAPI_releephwork_nextrequest_Method' => 'ConduitAPI_releeph_Method', 'ConduitAPI_releephwork_record_Method' => 'ConduitAPI_releeph_Method', 'ConduitAPI_releephwork_recordpickstatus_Method' => 'ConduitAPI_releeph_Method', diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_querycommits_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_querycommits_Method.php index 9c5c3301d7..1b8cf5fa89 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_querycommits_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_querycommits_Method.php @@ -17,6 +17,7 @@ final class ConduitAPI_diffusion_querycommits_Method 'phids' => 'optional list', 'names' => 'optional list', 'repositoryPHID' => 'optional phid', + 'needMessages' => 'optional bool', ) + $this->getPagerParamTypes(); } @@ -25,9 +26,15 @@ final class ConduitAPI_diffusion_querycommits_Method } protected function execute(ConduitAPIRequest $request) { + $need_messages = $request->getValue('needMessages'); + $query = id(new DiffusionCommitQuery()) ->setViewer($request->getUser()); + if ($need_messages) { + $query->needCommitData(true); + } + $repository_phid = $request->getValue('repositoryPHID'); if ($repository_phid) { $repository = id(new PhabricatorRepositoryQuery()) @@ -67,7 +74,7 @@ final class ConduitAPI_diffusion_querycommits_Method $uri = '/r'.$callsign.$identifier; $uri = PhabricatorEnv::getProductionURI($uri); - $data[$commit->getPHID()] = array( + $dict = array( 'id' => $commit->getID(), 'phid' => $commit->getPHID(), 'repositoryPHID' => $commit->getRepository()->getPHID(), @@ -75,7 +82,19 @@ final class ConduitAPI_diffusion_querycommits_Method 'epoch' => $commit->getEpoch(), 'uri' => $uri, 'isImporting' => !$commit->isImported(), + 'summary' => $commit->getSummary(), ); + + if ($need_messages) { + $commit_data = $commit->getCommitData(); + if ($commit_data) { + $dict['message'] = $commit_data->getCommitMessage(); + } else { + $dict['message'] = null; + } + } + + $data[$commit->getPHID()] = $dict; } $result = array( diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getorigcommitmessage_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getorigcommitmessage_Method.php deleted file mode 100644 index 4c6efe55e2..0000000000 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getorigcommitmessage_Method.php +++ /dev/null @@ -1,35 +0,0 @@ - 'required string', - ); - } - - public function defineReturnType() { - return 'nonempty string'; - } - - public function defineErrorTypes() { - return array(); - } - - protected function execute(ConduitAPIRequest $request) { - $commit = id(new PhabricatorRepositoryCommit()) - ->loadOneWhere('phid = %s', $request->getValue('commitPHID')); - $commit_data = $commit->loadCommitData(); - $commit_message = $commit_data->getCommitMessage(); - return trim($commit_message); - } -} diff --git a/src/applications/releeph/controller/request/ReleephRequestEditController.php b/src/applications/releeph/controller/request/ReleephRequestEditController.php index b87e48794f..e161d94395 100644 --- a/src/applications/releeph/controller/request/ReleephRequestEditController.php +++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php @@ -109,15 +109,6 @@ final class ReleephRequestEditController extends ReleephBranchController { $errors[] = $e->getMessage(); } - $pr_commit_data = null; - if (!$errors) { - $pr_commit_data = $pr_commit->loadCommitData(); - if (!$pr_commit_data) { - $e_request_identifier = 'Not parsed yet'; - $errors[] = "The requested commit hasn't been parsed yet."; - } - } - if (!$errors) { $object_phid = $finder->getRequestedObjectPHID(); if (!$object_phid) {