@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added commit information to 'getrevision' conduit call.

Summary:
differential.getrevision now returns commits for a given revision.
URI is also return in differential.getrevision.

Test Plan:
Tested from Conduit Console UI that the calls were working
correctly.

Reviewed By: jungejason
Reviewers: jungejason
CC: epriestley, simpkins, dpepper, jungejason
Differential Revision: 163

+27 -1
+14 -1
src/applications/conduit/method/differential/getrevision/ConduitAPI_differential_getrevision_Method.php
··· 63 63 ConduitAPI_differential_getdiff_Method::createDiffDict($diff); 64 64 } 65 65 66 + $commit_dicts = array(); 67 + $commit_phids = $revision->loadCommitPHIDs(); 68 + $handles = id(new PhabricatorObjectHandleData($commit_phids)) 69 + ->loadHandles(); 70 + 71 + foreach ($commit_phids as $commit_phid) { 72 + $commit_dicts[] = array( 73 + 'fullname' => $handles[$commit_phid]->getFullName(), 74 + 'dateCommitted' => $handles[$commit_phid]->getTimestamp(), 75 + ); 76 + } 77 + 66 78 $dict = array( 67 79 'id' => $revision->getID(), 68 80 'phid' => $revision->getPHID(), 69 81 'authorPHID' => $revision->getAuthorPHID(), 82 + 'uri' => PhabricatorEnv::getURI('/D'.$revision->getID()), 70 83 'title' => $revision->getTitle(), 71 84 'status' => $revision->getStatus(), 72 85 'statusName' => DifferentialRevisionStatus::getNameForRevisionStatus( ··· 75 88 'testPlan' => $revision->getTestPlan(), 76 89 'revertPlan' => $revision->getRevertPlan(), 77 90 'blameRevision' => $revision->getBlameRevision(), 78 - 'dateCommitted' => $revision->getDateCommitted(), 79 91 'lineCount' => $revision->getLineCount(), 80 92 'reviewerPHIDs' => $reviewer_phids, 81 93 'diffs' => $diff_dicts, 94 + 'commits' => $commit_dicts, 82 95 ); 83 96 84 97 return $dict;
+2
src/applications/conduit/method/differential/getrevision/__init__.php
··· 11 11 phutil_require_module('phabricator', 'applications/conduit/protocol/exception'); 12 12 phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus'); 13 13 phutil_require_module('phabricator', 'applications/differential/storage/revision'); 14 + phutil_require_module('phabricator', 'applications/phid/handle/data'); 15 + phutil_require_module('phabricator', 'infrastructure/env'); 14 16 15 17 phutil_require_module('phutil', 'utils'); 16 18
+10
src/applications/phid/handle/PhabricatorObjectHandle.php
··· 25 25 private $email; 26 26 private $fullName; 27 27 private $imageURI; 28 + private $timestamp; 28 29 29 30 public function setURI($uri) { 30 31 $this->uri = $uri; ··· 90 91 91 92 public function getImageURI() { 92 93 return $this->imageURI; 94 + } 95 + 96 + public function setTimestamp($timestamp) { 97 + $this->timestamp = $timestamp; 98 + return $this; 99 + } 100 + 101 + public function getTimestamp() { 102 + return $this->timestamp; 93 103 } 94 104 95 105 public function renderLink() {
+1
src/applications/phid/handle/data/PhabricatorObjectHandleData.php
··· 160 160 $handle->setName('Commit '.'r'.$callsign.$commit_identifier); 161 161 $handle->setURI('/r'.$callsign.$commit_identifier); 162 162 $handle->setFullName('r'.$callsign.$commit_identifier); 163 + $handle->setTimestamp($commit->getEpoch()); 163 164 } 164 165 $handles[$phid] = $handle; 165 166 }