Skip to content

Commit bf2fffe

Browse files
author
epriestley
committed
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
1 parent 05884e5 commit bf2fffe

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/applications/diffusion/controller/DiffusionBranchTableController.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function shouldAllowPublic() {
99
public function processRequest() {
1010
$drequest = $this->getDiffusionRequest();
1111
$request = $this->getRequest();
12-
$user = $request->getUser();
12+
$viewer = $request->getUser();
1313

1414
$repository = $drequest->getRepository();
1515

@@ -29,21 +29,19 @@ public function processRequest() {
2929

3030
$content = null;
3131
if (!$branches) {
32-
$content = new AphrontErrorView();
33-
$content->setTitle(pht('No Branches'));
34-
$content->appendChild(pht('This repository has no branches.'));
35-
$content->setSeverity(AphrontErrorView::SEVERITY_NODATA);
32+
$content = $this->renderStatusMessage(
33+
pht('No Branches'),
34+
pht('This repository has no branches.'));
3635
} else {
37-
$commits = id(new PhabricatorAuditCommitQuery())
38-
->withIdentifiers(
39-
$drequest->getRepository()->getID(),
40-
mpull($branches, 'getHeadCommitIdentifier'))
41-
->needCommitData(true)
36+
$commits = id(new DiffusionCommitQuery())
37+
->setViewer($viewer)
38+
->withIdentifiers(mpull($branches, 'getHeadCommitIdentifier'))
39+
->withRepositoryIDs(array($repository->getID()))
4240
->execute();
4341

4442
$view = id(new DiffusionBranchTableView())
43+
->setUser($viewer)
4544
->setBranches($branches)
46-
->setUser($user)
4745
->setCommits($commits)
4846
->setDiffusionRequest($drequest);
4947

@@ -67,8 +65,8 @@ public function processRequest() {
6765
),
6866
array(
6967
'title' => array(
70-
'Branches',
71-
$repository->getCallsign().' Repository',
68+
pht('Branches'),
69+
'r'.$repository->getCallsign(),
7270
),
7371
));
7472
}

0 commit comments

Comments
 (0)