3 final class DiffusionCommitBranchesController
extends DiffusionController
{
5 public function shouldAllowPublic() {
9 public function handleRequest(AphrontRequest
$request) {
10 $response = $this->loadDiffusionContext();
15 $drequest = $this->getDiffusionRequest();
16 $repository = $drequest->getRepository();
19 $branches = DiffusionRepositoryRef
::loadAllFromDictionaries(
20 $this->callConduitWithDiffusionRequest(
21 'diffusion.branchquery',
23 'contains' => $drequest->getCommit(),
24 'limit' => $branch_limit +
1,
28 $has_more_branches = (count($branches) > $branch_limit);
29 $branches = array_slice($branches, 0, $branch_limit);
31 $branch_links = array();
32 foreach ($branches as $branch) {
33 $branch_links[] = phutil_tag(
36 'href' => $drequest->generateURI(
39 'branch' => $branch->getShortName(),
42 $branch->getShortName());
45 if ($has_more_branches) {
46 $branch_links[] = phutil_tag(
49 'href' => $drequest->generateURI(
51 'action' => 'branches',
54 pht("More Branches\xE2\x80\xA6"));
57 return id(new AphrontAjaxResponse())
58 ->setContent($branch_links ?
implode(', ', $branch_links) : pht('None'));