Page MenuHomePhabricator

D8823.diff
No OneTemporary

D8823.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -239,7 +239,6 @@
'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 @@
'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
--- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_querycommits_Method.php
+++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_querycommits_Method.php
@@ -17,6 +17,7 @@
'phids' => 'optional list<phid>',
'names' => 'optional list<string>',
'repositoryPHID' => 'optional phid',
+ 'needMessages' => 'optional bool',
) + $this->getPagerParamTypes();
}
@@ -25,9 +26,15 @@
}
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 @@
$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 @@
'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
--- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getorigcommitmessage_Method.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-final class ConduitAPI_releephwork_getorigcommitmessage_Method
- extends ConduitAPI_releeph_Method {
-
- public function getMethodStatus() {
- return self::METHOD_STATUS_UNSTABLE;
- }
-
- public function getMethodDescription() {
- return "Return the original commit message for the given commit.";
- }
-
- public function defineParamTypes() {
- return array(
- 'commitPHID' => '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
--- a/src/applications/releeph/controller/request/ReleephRequestEditController.php
+++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php
@@ -109,15 +109,6 @@
$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) {

File Metadata

Mime Type
text/plain
Expires
Thu, May 9, 8:28 PM (3 w, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6276821
Default Alt Text
D8823.diff (5 KB)

Event Timeline