Page MenuHomePhabricator

D7668.diff

diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php
--- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php
+++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php
@@ -129,6 +129,7 @@
$commits = $this->addRepositoryCommitDataInformation($commits);
$commits = $this->addDifferentialInformation($commits);
+ $commits = $this->addManiphestInformation($commits);
foreach ($commits as $name => $commit) {
$results[$name] = $commit;
@@ -261,4 +262,31 @@
return $commits;
}
+ /**
+ * Enhances the commits list with Maniphest information.
+ */
+ private function addManiphestInformation(array $commits) {
+ $task_type = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK;
+
+ $commit_phids = ipull($commits, 'commitPHID');
+
+ $edge_query = id(new PhabricatorEdgeQuery())
+ ->withSourcePHIDs($commit_phids)
+ ->withEdgeTypes(array($task_type));
+
+ $edges = $edge_query->execute();
+
+ foreach ($commits as $name => $commit) {
+ $task_phids = $edge_query->getDestinationPHIDs(
+ array($commit['commitPHID']),
+ array($task_type));
+
+ $commits[$name] += array(
+ 'taskPHIDs' => $task_phids,
+ );
+ }
+
+ return $commits;
+ }
+
}

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/ov/4h/od4g33xdz5vaqynk
Default Alt Text
D7668.diff (1 KB)

Event Timeline