From cc865e549bcddb68544c6ae7415c4e19a7db095d Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 6 Nov 2017 10:38:43 -0800 Subject: [PATCH] Provide revision parent/child edges in `edge.search`, and more information in `differential.revision.search` Summary: See PHI195. This bulks out these API methods since all the requests are pretty straightforward. Test Plan: Ran `edge.search` and `differential.revision.search`. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D18762 --- ...entialRevisionDependedOnByRevisionEdgeType.php | 14 ++++++++++++++ ...ferentialRevisionDependsOnRevisionEdgeType.php | 13 +++++++++++++ .../differential/storage/DifferentialRevision.php | 15 +++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/src/applications/differential/edge/DifferentialRevisionDependedOnByRevisionEdgeType.php b/src/applications/differential/edge/DifferentialRevisionDependedOnByRevisionEdgeType.php index 02a24effcf..a6940b536e 100644 --- a/src/applications/differential/edge/DifferentialRevisionDependedOnByRevisionEdgeType.php +++ b/src/applications/differential/edge/DifferentialRevisionDependedOnByRevisionEdgeType.php @@ -13,6 +13,20 @@ final class DifferentialRevisionDependedOnByRevisionEdgeType return true; } + public function getConduitKey() { + return 'revision.child'; + } + + public function getConduitName() { + return pht('Revision Has Child'); + } + + public function getConduitDescription() { + return pht( + 'The source revision makes changes required by the destination '. + 'revision.'); + } + public function getTransactionAddString( $actor, $add_count, diff --git a/src/applications/differential/edge/DifferentialRevisionDependsOnRevisionEdgeType.php b/src/applications/differential/edge/DifferentialRevisionDependsOnRevisionEdgeType.php index 4613ad8a34..e826f554c6 100644 --- a/src/applications/differential/edge/DifferentialRevisionDependsOnRevisionEdgeType.php +++ b/src/applications/differential/edge/DifferentialRevisionDependsOnRevisionEdgeType.php @@ -17,6 +17,19 @@ final class DifferentialRevisionDependsOnRevisionEdgeType return true; } + public function getConduitKey() { + return 'revision.parent'; + } + + public function getConduitName() { + return pht('Revision Has Parent'); + } + + public function getConduitDescription() { + return pht( + 'The source revision depends on changes in the destination revision.'); + } + public function getTransactionAddString( $actor, $add_count, diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index 61f934f13b..bf4bec0abc 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -986,6 +986,18 @@ final class DifferentialRevision extends DifferentialDAO ->setKey('status') ->setType('map') ->setDescription(pht('Information about revision status.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('repositoryPHID') + ->setType('phid?') + ->setDescription(pht('Revision repository PHID.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('diffPHID') + ->setType('phid') + ->setDescription(pht('Active diff PHID.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('summary') + ->setType('string') + ->setDescription(pht('Revision summary.')), ); } @@ -1002,6 +1014,9 @@ final class DifferentialRevision extends DifferentialDAO 'title' => $this->getTitle(), 'authorPHID' => $this->getAuthorPHID(), 'status' => $status_info, + 'repositoryPHID' => $this->getRepositoryPHID(), + 'diffPHID' => $this->getActiveDiffPHID(), + 'summary' => $this->getSummary(), ); }