diff --git a/src/applications/conduit/method/differential/getrevision/ConduitAPI_differential_getrevision_Method.php b/src/applications/conduit/method/differential/getrevision/ConduitAPI_differential_getrevision_Method.php index 687a95fc5e..be5b6a016f 100644 --- a/src/applications/conduit/method/differential/getrevision/ConduitAPI_differential_getrevision_Method.php +++ b/src/applications/conduit/method/differential/getrevision/ConduitAPI_differential_getrevision_Method.php @@ -63,10 +63,23 @@ class ConduitAPI_differential_getrevision_Method extends ConduitAPIMethod { ConduitAPI_differential_getdiff_Method::createDiffDict($diff); } + $commit_dicts = array(); + $commit_phids = $revision->loadCommitPHIDs(); + $handles = id(new PhabricatorObjectHandleData($commit_phids)) + ->loadHandles(); + + foreach ($commit_phids as $commit_phid) { + $commit_dicts[] = array( + 'fullname' => $handles[$commit_phid]->getFullName(), + 'dateCommitted' => $handles[$commit_phid]->getTimestamp(), + ); + } + $dict = array( 'id' => $revision->getID(), 'phid' => $revision->getPHID(), 'authorPHID' => $revision->getAuthorPHID(), + 'uri' => PhabricatorEnv::getURI('/D'.$revision->getID()), 'title' => $revision->getTitle(), 'status' => $revision->getStatus(), 'statusName' => DifferentialRevisionStatus::getNameForRevisionStatus( @@ -75,10 +88,10 @@ class ConduitAPI_differential_getrevision_Method extends ConduitAPIMethod { 'testPlan' => $revision->getTestPlan(), 'revertPlan' => $revision->getRevertPlan(), 'blameRevision' => $revision->getBlameRevision(), - 'dateCommitted' => $revision->getDateCommitted(), 'lineCount' => $revision->getLineCount(), 'reviewerPHIDs' => $reviewer_phids, 'diffs' => $diff_dicts, + 'commits' => $commit_dicts, ); return $dict; diff --git a/src/applications/conduit/method/differential/getrevision/__init__.php b/src/applications/conduit/method/differential/getrevision/__init__.php index 5434b75d52..64388c9bea 100644 --- a/src/applications/conduit/method/differential/getrevision/__init__.php +++ b/src/applications/conduit/method/differential/getrevision/__init__.php @@ -11,6 +11,8 @@ phutil_require_module('phabricator', 'applications/conduit/method/differential/g phutil_require_module('phabricator', 'applications/conduit/protocol/exception'); phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus'); phutil_require_module('phabricator', 'applications/differential/storage/revision'); +phutil_require_module('phabricator', 'applications/phid/handle/data'); +phutil_require_module('phabricator', 'infrastructure/env'); phutil_require_module('phutil', 'utils'); diff --git a/src/applications/phid/handle/PhabricatorObjectHandle.php b/src/applications/phid/handle/PhabricatorObjectHandle.php index aaad0886fd..173bdd7d5c 100644 --- a/src/applications/phid/handle/PhabricatorObjectHandle.php +++ b/src/applications/phid/handle/PhabricatorObjectHandle.php @@ -25,6 +25,7 @@ class PhabricatorObjectHandle { private $email; private $fullName; private $imageURI; + private $timestamp; public function setURI($uri) { $this->uri = $uri; @@ -92,6 +93,15 @@ class PhabricatorObjectHandle { return $this->imageURI; } + public function setTimestamp($timestamp) { + $this->timestamp = $timestamp; + return $this; + } + + public function getTimestamp() { + return $this->timestamp; + } + public function renderLink() { switch ($this->getType()) { diff --git a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php index a5cf8a0355..db2a5d505b 100644 --- a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php @@ -160,6 +160,7 @@ class PhabricatorObjectHandleData { $handle->setName('Commit '.'r'.$callsign.$commit_identifier); $handle->setURI('/r'.$callsign.$commit_identifier); $handle->setFullName('r'.$callsign.$commit_identifier); + $handle->setTimestamp($commit->getEpoch()); } $handles[$phid] = $handle; }