Differential D11789 Diff 28422 src/applications/diffusion/controller/DiffusionCommitTagsController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionCommitTagsController.php
| <?php | <?php | ||||
| final class DiffusionCommitTagsController extends DiffusionController { | final class DiffusionCommitTagsController extends DiffusionController { | ||||
| public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| protected function processDiffusionRequest(AphrontRequest $request) { | protected function processDiffusionRequest(AphrontRequest $request) { | ||||
| $drequest = $this->getDiffusionRequest(); | $drequest = $this->getDiffusionRequest(); | ||||
| $tag_limit = 10; | $repository = $drequest->getRepository(); | ||||
| $tag_limit = 10; | |||||
| switch ($repository->getVersionControlSystem()) { | |||||
| case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: | |||||
| $tags = array(); | $tags = array(); | ||||
| try { | break; | ||||
| default: | |||||
| $tags = DiffusionRepositoryTag::newFromConduit( | $tags = DiffusionRepositoryTag::newFromConduit( | ||||
| $this->callConduitWithDiffusionRequest( | $this->callConduitWithDiffusionRequest( | ||||
| 'diffusion.tagsquery', | 'diffusion.tagsquery', | ||||
| array( | array( | ||||
| 'commit' => $drequest->getCommit(), | 'commit' => $drequest->getCommit(), | ||||
| 'limit' => $tag_limit + 1, | 'limit' => $tag_limit + 1, | ||||
| ))); | ))); | ||||
| } catch (ConduitException $ex) { | break; | ||||
| if ($ex->getMessage() != 'ERR-UNSUPPORTED-VCS') { | |||||
| throw $ex; | |||||
| } | } | ||||
| } | |||||
| $has_more_tags = (count($tags) > $tag_limit); | $has_more_tags = (count($tags) > $tag_limit); | ||||
| $tags = array_slice($tags, 0, $tag_limit); | $tags = array_slice($tags, 0, $tag_limit); | ||||
| $tag_links = array(); | $tag_links = array(); | ||||
| foreach ($tags as $tag) { | foreach ($tags as $tag) { | ||||
| $tag_links[] = phutil_tag( | $tag_links[] = phutil_tag( | ||||
| 'a', | 'a', | ||||
| array( | array( | ||||
| Show All 25 Lines | |||||