2012-08-01 01:27:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DiffusionCommitBranchesController extends DiffusionController {
|
|
|
|
|
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
$this->diffusionRequest = DiffusionRequest::newFromDictionary($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getDiffusionRequest();
|
|
|
|
|
|
|
|
$branch_query = DiffusionContainsQuery::newFromDiffusionRequest($request);
|
|
|
|
$branches = $branch_query->loadContainingBranches();
|
|
|
|
|
|
|
|
$branch_links = array();
|
|
|
|
foreach ($branches as $branch => $commit) {
|
2013-01-18 03:43:35 +01:00
|
|
|
$branch_links[] = phutil_tag(
|
2012-08-01 01:27:48 +02:00
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => $request->generateURI(
|
|
|
|
array(
|
|
|
|
'action' => 'browse',
|
|
|
|
'branch' => $branch,
|
|
|
|
)),
|
|
|
|
),
|
2013-01-18 03:43:35 +01:00
|
|
|
$branch);
|
2012-08-01 01:27:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return id(new AphrontAjaxResponse())
|
|
|
|
->setContent($branch_links ? implode(', ', $branch_links) : 'None');
|
|
|
|
}
|
|
|
|
}
|