From bf2fffe26478e2449f6ce8f36f7196853fc4db7d Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 30 Oct 2013 13:14:56 -0700 Subject: [PATCH] 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 --- .../DiffusionBranchTableController.php | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionBranchTableController.php b/src/applications/diffusion/controller/DiffusionBranchTableController.php index 5211b3ad75..049be12b88 100644 --- a/src/applications/diffusion/controller/DiffusionBranchTableController.php +++ b/src/applications/diffusion/controller/DiffusionBranchTableController.php @@ -9,7 +9,7 @@ final class DiffusionBranchTableController extends DiffusionController { public function processRequest() { $drequest = $this->getDiffusionRequest(); $request = $this->getRequest(); - $user = $request->getUser(); + $viewer = $request->getUser(); $repository = $drequest->getRepository(); @@ -29,21 +29,19 @@ final class DiffusionBranchTableController extends DiffusionController { $content = null; if (!$branches) { - $content = new AphrontErrorView(); - $content->setTitle(pht('No Branches')); - $content->appendChild(pht('This repository has no branches.')); - $content->setSeverity(AphrontErrorView::SEVERITY_NODATA); + $content = $this->renderStatusMessage( + pht('No Branches'), + pht('This repository has no branches.')); } else { - $commits = id(new PhabricatorAuditCommitQuery()) - ->withIdentifiers( - $drequest->getRepository()->getID(), - mpull($branches, 'getHeadCommitIdentifier')) - ->needCommitData(true) + $commits = id(new DiffusionCommitQuery()) + ->setViewer($viewer) + ->withIdentifiers(mpull($branches, 'getHeadCommitIdentifier')) + ->withRepositoryIDs(array($repository->getID())) ->execute(); $view = id(new DiffusionBranchTableView()) + ->setUser($viewer) ->setBranches($branches) - ->setUser($user) ->setCommits($commits) ->setDiffusionRequest($drequest); @@ -67,8 +65,8 @@ final class DiffusionBranchTableController extends DiffusionController { ), array( 'title' => array( - 'Branches', - $repository->getCallsign().' Repository', + pht('Branches'), + 'r'.$repository->getCallsign(), ), )); }