Page MenuHomePhabricator

D18439.id44303.diff
No OneTemporary

D18439.id44303.diff

diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php
@@ -52,14 +52,15 @@
$page_has_content = true;
} else {
$default = $repository->getDefaultBranch();
+ $branch = $drequest->getBranch();
+ $tracking = $repository->shouldTrackBranch($branch);
+ var_dump($tracking);
if ($default != $drequest->getBranch()) {
- $empty_title = pht('No Such Branch');
- $empty_message = pht(
+ $empty_message[] = pht(
'There is no branch named "%s" in this repository.',
$drequest->getBranch());
} else {
- $empty_title = pht('No Default Branch');
- $empty_message = pht(
+ $empty_message[] = pht(
'This repository is configured with default branch "%s" but '.
'there is no branch with that name in this repository.',
$default);
@@ -67,6 +68,18 @@
}
}
+ if ($drequest->supportsBranches()) {
+ $branch = $drequest->getBranch();
+ $tracking = $repository->shouldTrackBranch($branch);
+ if (!$tracking) {
+ $empty_message[] = pht('This branch is not being tracked.');
+ }
+ }
+
+ if (!$repository->isTracked()) {
+ $empty_message[] = pht('This repository is not being tracked.');
+ }
+
// If we didn't find any branches, check if there are any commits at all.
// This can tailor the message for empty repositories.
$any_commit = null;
@@ -81,8 +94,8 @@
$page_has_content = true;
}
} else {
- $empty_title = pht('Empty Repository');
- $empty_message = pht('This repository does not have any commits yet.');
+ $empty_message[] =
+ pht('This repository does not have any commits yet.');
}
}
@@ -93,9 +106,8 @@
// TODO: Evan will replace
// $this->buildNormalContent($drequest);
$content = id(new PHUIInfoView())
- ->setTitle($empty_title)
- ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
- ->setErrors(array($empty_message));
+ ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
+ ->setErrors($empty_message);
}
$tabs = $this->buildTabsView('code');

File Metadata

Mime Type
text/plain
Expires
Sep 30 2025, 12:56 PM (8 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8785125
Default Alt Text
D18439.id44303.diff (2 KB)

Event Timeline