Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13974802
D7668.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7668.diff
View Options
Index: src/applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php
===================================================================
--- src/applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php
+++ 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
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 19, 7:26 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730968
Default Alt Text
D7668.diff (1 KB)
Attached To
Mode
D7668: Attach TaskPHIDs to commits in diffusion.getcommits
Attached
Detach File
Event Timeline
Log In to Comment