@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+11 -13
+11 -13
src/applications/diffusion/controller/DiffusionBranchTableController.php
··· 9 9 public function processRequest() { 10 10 $drequest = $this->getDiffusionRequest(); 11 11 $request = $this->getRequest(); 12 - $user = $request->getUser(); 12 + $viewer = $request->getUser(); 13 13 14 14 $repository = $drequest->getRepository(); 15 15 ··· 29 29 30 30 $content = null; 31 31 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.')); 36 35 } 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())) 42 40 ->execute(); 43 41 44 42 $view = id(new DiffusionBranchTableView()) 43 + ->setUser($viewer) 45 44 ->setBranches($branches) 46 - ->setUser($user) 47 45 ->setCommits($commits) 48 46 ->setDiffusionRequest($drequest); 49 47 ··· 67 65 ), 68 66 array( 69 67 'title' => array( 70 - 'Branches', 71 - $repository->getCallsign().' Repository', 68 + pht('Branches'), 69 + 'r'.$repository->getCallsign(), 72 70 ), 73 71 )); 74 72 }