Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14006082
D7668.id17315.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.id17315.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) {
+ $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
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 29, 12:46 AM (2 w, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6753326
Default Alt Text
D7668.id17315.diff (1 KB)
Attached To
Mode
D7668: Attach TaskPHIDs to commits in diffusion.getcommits
Attached
Detach File
Event Timeline
Log In to Comment