Show first 10 branches, then "More Branches" for commits on huge numbers of branches
Summary: Fixes T9562. We already do this for tags, but didn't have similar logic for branches. Implement that logic. Test Plan: - Set limit to 1, saw "More branches", clicked it, got the correct results. - Verified that branch table with no specified commit still works properly. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9562 Differential Revision: https://secure.phabricator.com/D15284
This commit is contained in:
@@ -19,13 +19,19 @@ final class DiffusionBranchTableController extends DiffusionController {
|
||||
$pager = id(new PHUIPagerView())
|
||||
->readFromRequest($request);
|
||||
|
||||
// TODO: Add support for branches that contain commit
|
||||
$params = array(
|
||||
'offset' => $pager->getOffset(),
|
||||
'limit' => $pager->getPageSize() + 1,
|
||||
);
|
||||
|
||||
$contains = $drequest->getSymbolicCommit();
|
||||
if (strlen($contains)) {
|
||||
$params['contains'] = $contains;
|
||||
}
|
||||
|
||||
$branches = $this->callConduitWithDiffusionRequest(
|
||||
'diffusion.branchquery',
|
||||
array(
|
||||
'offset' => $pager->getOffset(),
|
||||
'limit' => $pager->getPageSize() + 1,
|
||||
));
|
||||
$params);
|
||||
$branches = $pager->sliceResults($branches);
|
||||
|
||||
$branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches);
|
||||
|
||||
Reference in New Issue
Block a user