Page MenuHomePhabricator

D16101.diff
No OneTemporary

D16101.diff

Index: src/__phutil_library_map__.php
===================================================================
--- src/__phutil_library_map__.php
+++ src/__phutil_library_map__.php
@@ -626,6 +626,7 @@
'DiffusionCommitRevisionReviewersHeraldField' => 'applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php',
'DiffusionCommitRevisionSubscribersHeraldField' => 'applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php',
'DiffusionCommitTagsController' => 'applications/diffusion/controller/DiffusionCommitTagsController.php',
+ 'DiffusionCommitTagsHeraldField' => 'applications/diffusion/herald/DiffusionCommitTagsHeraldField.php',
'DiffusionConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionConduitAPIMethod.php',
'DiffusionController' => 'applications/diffusion/controller/DiffusionController.php',
'DiffusionCreateCommentConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php',
@@ -4907,6 +4908,7 @@
'DiffusionCommitRevisionReviewersHeraldField' => 'DiffusionCommitHeraldField',
'DiffusionCommitRevisionSubscribersHeraldField' => 'DiffusionCommitHeraldField',
'DiffusionCommitTagsController' => 'DiffusionController',
+ 'DiffusionCommitTagsHeraldField' => 'DiffusionCommitHeraldField',
'DiffusionConduitAPIMethod' => 'ConduitAPIMethod',
'DiffusionController' => 'PhabricatorController',
'DiffusionCreateCommentConduitAPIMethod' => 'DiffusionConduitAPIMethod',
Index: src/applications/diffusion/herald/DiffusionCommitTagsHeraldField.php
===================================================================
--- /dev/null
+++ src/applications/diffusion/herald/DiffusionCommitTagsHeraldField.php
@@ -0,0 +1,34 @@
+<?php
+
+final class DiffusionCommitTagsHeraldField
+ extends DiffusionCommitHeraldField {
+
+ const FIELDCONST = 'diffusion.commit.tags';
+
+ public function getHeraldFieldName() {
+ return pht('Tags');
+ }
+
+ public function getHeraldFieldValue($object) {
+ $commit = $object;
+ $repository = $object->getRepository();
+
+ $params = array(
+ 'repository' => $repository->getPHID(),
+ 'commit' => $commit->getCommitIdentifier(),
+ );
+
+ $result = id(new ConduitCall('diffusion.tagsquery', $params))
+ ->setUser(PhabricatorUser::getOmnipotentUser())
+ ->execute();
+
+ $refs = DiffusionRepositoryRef::loadAllFromDictionaries($result);
+
+ return mpull($refs, 'getShortName');
+ }
+
+ protected function getHeraldFieldStandardType() {
+ return self::STANDARD_TEXT_LIST;
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 4:23 PM (18 h, 9 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6775287
Default Alt Text
D16101.diff (2 KB)

Event Timeline