1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 01:10:58 +01:00

Clean up dedicated branch table view

Summary: Swap to DiffusionCommitQuery, other minor cleanup.

Test Plan: Viewed page, forced error view and looked at it.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7454
This commit is contained in:
epriestley 2013-10-30 13:14:56 -07:00
parent 05884e5042
commit bf2fffe264

View file

@ -9,7 +9,7 @@ final class DiffusionBranchTableController extends DiffusionController {
public function processRequest() { public function processRequest() {
$drequest = $this->getDiffusionRequest(); $drequest = $this->getDiffusionRequest();
$request = $this->getRequest(); $request = $this->getRequest();
$user = $request->getUser(); $viewer = $request->getUser();
$repository = $drequest->getRepository(); $repository = $drequest->getRepository();
@ -29,21 +29,19 @@ final class DiffusionBranchTableController extends DiffusionController {
$content = null; $content = null;
if (!$branches) { if (!$branches) {
$content = new AphrontErrorView(); $content = $this->renderStatusMessage(
$content->setTitle(pht('No Branches')); pht('No Branches'),
$content->appendChild(pht('This repository has no branches.')); pht('This repository has no branches.'));
$content->setSeverity(AphrontErrorView::SEVERITY_NODATA);
} else { } else {
$commits = id(new PhabricatorAuditCommitQuery()) $commits = id(new DiffusionCommitQuery())
->withIdentifiers( ->setViewer($viewer)
$drequest->getRepository()->getID(), ->withIdentifiers(mpull($branches, 'getHeadCommitIdentifier'))
mpull($branches, 'getHeadCommitIdentifier')) ->withRepositoryIDs(array($repository->getID()))
->needCommitData(true)
->execute(); ->execute();
$view = id(new DiffusionBranchTableView()) $view = id(new DiffusionBranchTableView())
->setUser($viewer)
->setBranches($branches) ->setBranches($branches)
->setUser($user)
->setCommits($commits) ->setCommits($commits)
->setDiffusionRequest($drequest); ->setDiffusionRequest($drequest);
@ -67,8 +65,8 @@ final class DiffusionBranchTableController extends DiffusionController {
), ),
array( array(
'title' => array( 'title' => array(
'Branches', pht('Branches'),
$repository->getCallsign().' Repository', 'r'.$repository->getCallsign(),
), ),
)); ));
} }