Page MenuHomePhabricator

D7668.id17315.diff

D7668.id17315.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) {
+ $commit_phids = ipull($commits, 'commitPHID');
+
+ $edge_query = id(new PhabricatorEdgeQuery())
+ ->withSourcePHIDs($commit_phids)
+ ->withEdgeTypes(array(PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK));
+
+ $edges = $edge_query->execute();
+
+ foreach ($commits as $name => $commit) {
+ if (isset($edges[$commit['commitPHID']])) {
+ $task_phids = array_keys(
+ $edges[$commit['commitPHID']][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK]);
+ } else {
+ $task_phids = array();
+ }
+ $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/ye/sw/lhkjwjrdcg4gss3h
Default Alt Text
D7668.id17315.diff (1 KB)

Event Timeline