2012-08-01 01:27:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DiffusionCommitBranchesController extends DiffusionController {
|
|
|
|
|
|
|
|
public function willProcessRequest(array $data) {
|
2013-05-15 00:32:19 +02:00
|
|
|
$data['user'] = $this->getRequest()->getUser();
|
2012-08-01 01:27:48 +02:00
|
|
|
$this->diffusionRequest = DiffusionRequest::newFromDictionary($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getDiffusionRequest();
|
|
|
|
|
2013-05-18 01:54:10 +02:00
|
|
|
$branches = $this->callConduitWithDiffusionRequest(
|
|
|
|
'diffusion.commitbranchesquery',
|
|
|
|
array('commit' => $request->getCommit()));
|
2012-08-01 01:27:48 +02:00
|
|
|
|
|
|
|
$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');
|
|
|
|
}
|
|
|
|
}
|