Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15407924
D15284.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D15284.diff
View Options
diff --git a/src/applications/diffusion/controller/DiffusionBranchTableController.php b/src/applications/diffusion/controller/DiffusionBranchTableController.php
--- a/src/applications/diffusion/controller/DiffusionBranchTableController.php
+++ b/src/applications/diffusion/controller/DiffusionBranchTableController.php
@@ -19,13 +19,19 @@
$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);
diff --git a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
--- a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
@@ -15,20 +15,18 @@
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
- switch ($repository->getVersionControlSystem()) {
- case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
- $branches = array();
- break;
- default:
- $branches = $this->callConduitWithDiffusionRequest(
- 'diffusion.branchquery',
- array(
- 'contains' => $drequest->getCommit(),
- ));
- break;
- }
+ $branch_limit = 10;
+ $branches = DiffusionRepositoryRef::loadAllFromDictionaries(
+ $this->callConduitWithDiffusionRequest(
+ 'diffusion.branchquery',
+ array(
+ 'contains' => $drequest->getCommit(),
+ 'limit' => $branch_limit + 1,
+ )));
+
+ $has_more_branches = (count($branches) > $branch_limit);
+ $branches = array_slice($branches, 0, $branch_limit);
- $branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches);
$branch_links = array();
foreach ($branches as $branch) {
$branch_links[] = phutil_tag(
@@ -43,6 +41,18 @@
$branch->getShortName());
}
+ if ($has_more_branches) {
+ $branch_links[] = phutil_tag(
+ 'a',
+ array(
+ 'href' => $drequest->generateURI(
+ array(
+ 'action' => 'branches',
+ )),
+ ),
+ pht("More Branches\xE2\x80\xA6"));
+ }
+
return id(new AphrontAjaxResponse())
->setContent($branch_links ? implode(', ', $branch_links) : pht('None'));
}
diff --git a/src/applications/diffusion/controller/DiffusionCommitTagsController.php b/src/applications/diffusion/controller/DiffusionCommitTagsController.php
--- a/src/applications/diffusion/controller/DiffusionCommitTagsController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitTagsController.php
@@ -16,20 +16,14 @@
$repository = $drequest->getRepository();
$tag_limit = 10;
- switch ($repository->getVersionControlSystem()) {
- case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
- $tags = array();
- break;
- default:
- $tags = DiffusionRepositoryTag::newFromConduit(
- $this->callConduitWithDiffusionRequest(
- 'diffusion.tagsquery',
- array(
- 'commit' => $drequest->getCommit(),
- 'limit' => $tag_limit + 1,
- )));
- break;
- }
+ $tags = DiffusionRepositoryTag::newFromConduit(
+ $this->callConduitWithDiffusionRequest(
+ 'diffusion.tagsquery',
+ array(
+ 'commit' => $drequest->getCommit(),
+ 'limit' => $tag_limit + 1,
+ )));
+
$has_more_tags = (count($tags) > $tag_limit);
$tags = array_slice($tags, 0, $tag_limit);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 8:15 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707869
Default Alt Text
D15284.diff (4 KB)
Attached To
Mode
D15284: Show first 10 branches, then "More Branches" for commits on huge numbers of branches
Attached
Detach File
Event Timeline
Log In to Comment