Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13995637
D7458.id16811.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D7458.id16811.diff
View Options
Index: src/applications/diffusion/controller/DiffusionController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionController.php
+++ src/applications/diffusion/controller/DiffusionController.php
@@ -96,6 +96,12 @@
}
}
+ if (!$repository->isTracked()) {
+ return new PhabricatorVCSResponse(
+ 403,
+ pht('This repository is inactive.'));
+ }
+
$is_push = !$this->isReadOnlyRequest($repository);
switch ($repository->getServeOverHTTP()) {
Index: src/applications/diffusion/controller/DiffusionRepositoryEditController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionRepositoryEditController.php
+++ src/applications/diffusion/controller/DiffusionRepositoryEditController.php
@@ -3,7 +3,7 @@
abstract class DiffusionRepositoryEditController
extends DiffusionController {
- public function buildApplicationCrumbs() {
+ public function buildApplicationCrumbs($is_main = false) {
$crumbs = parent::buildApplicationCrumbs();
if ($this->diffusionRequest) {
@@ -16,10 +16,16 @@
->setName('r'.$repository->getCallsign())
->setHref($repo_uri));
- $crumbs->addCrumb(
- id(new PhabricatorCrumbView())
- ->setName(pht('Edit'))
- ->setHref($edit_uri));
+ if ($is_main) {
+ $crumbs->addCrumb(
+ id(new PhabricatorCrumbView())
+ ->setName(pht('Edit Repository')));
+ } else {
+ $crumbs->addCrumb(
+ id(new PhabricatorCrumbView())
+ ->setName(pht('Edit'))
+ ->setHref($edit_uri));
+ }
}
return $crumbs;
Index: src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
+++ src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
@@ -19,22 +19,20 @@
$is_hg = false;
switch ($repository->getVersionControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
- $has_local = true;
$is_git = true;
break;
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
- $has_local = $repository->isHosted();
$is_svn = true;
break;
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
- $has_local = true;
$is_hg = true;
break;
}
$has_branches = ($is_git || $is_hg);
+ $has_local = $repository->usesLocalWorkingCopy();
- $crumbs = $this->buildApplicationCrumbs();
+ $crumbs = $this->buildApplicationCrumbs($is_main = true);
$title = pht('Edit %s', $repository->getName());
@@ -199,16 +197,16 @@
->setUser($viewer)
->setActionList($actions);
- $view->addProperty(pht('Name'), $repository->getName());
- $view->addProperty(pht('ID'), $repository->getID());
- $view->addProperty(pht('PHID'), $repository->getPHID());
-
$type = PhabricatorRepositoryType::getNameForRepositoryType(
$repository->getVersionControlSystem());
$view->addProperty(pht('Type'), $type);
$view->addProperty(pht('Callsign'), $repository->getCallsign());
+ $view->addProperty(
+ pht('Status'),
+ $this->buildRepositoryStatus($repository));
+
$description = $repository->getDetail('description');
$view->addSectionHeader(pht('Description'));
if (!strlen($description)) {
@@ -562,4 +560,119 @@
return $view;
}
+ private function buildRepositoryStatus(
+ PhabricatorRepository $repository) {
+
+ $view = new PHUIStatusListView();
+
+ if ($repository->isTracked()) {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('accept-green')
+ ->setTarget(pht('Repository Active')));
+ } else {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('warning')
+ ->setTarget(pht('Repository Inactive'))
+ ->setNote(
+ pht('Activate this repository to begin or resume import.')));
+ return $view;
+ }
+
+ $doc_href = PhabricatorEnv::getDocLink(
+ 'article/Managing_Daemons_with_phd.html');
+ $daemon_instructions = pht(
+ 'Use %s to start daemons. See %s.',
+ phutil_tag('tt', array(), 'bin/phd start'),
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => $doc_href,
+ ),
+ pht('Managing Daemons with phd')));
+
+
+ $pull_daemon = id(new PhabricatorDaemonLogQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE)
+ ->withDaemonClasses(array('PhabricatorRepositoryPullLocalDaemon'))
+ ->setLimit(1)
+ ->execute();
+
+ if ($pull_daemon) {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('accept-green')
+ ->setTarget(pht('Pull Daemon Running')));
+ } else {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('warning-red')
+ ->setTarget(pht('Pull Daemon Not Running'))
+ ->setNote($daemon_instructions));
+ }
+
+
+ $task_daemon = id(new PhabricatorDaemonLogQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE)
+ ->withDaemonClasses(array('PhabricatorTaskmasterDaemon'))
+ ->setLimit(1)
+ ->execute();
+ if ($task_daemon) {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('accept-green')
+ ->setTarget(pht('Task Daemon Running')));
+ } else {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('warning-red')
+ ->setTarget(pht('Task Daemon Not Running'))
+ ->setNote($daemon_instructions));
+ }
+
+ $local_parent = dirname($repository->getLocalPath());
+ if (Filesystem::pathExists($local_parent)) {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('accept-green')
+ ->setTarget(pht('Storage Directory OK'))
+ ->setNote(phutil_tag('tt', array(), $local_parent)));
+ } else {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('warning-red')
+ ->setTarget(pht('No Storage Directory'))
+ ->setNote(
+ pht(
+ 'Storage directory %s does not exist, or is not readable by '.
+ 'the webserver. Create this directory or make it readable.',
+ phutil_tag('tt', array(), $local_parent))));
+ return $view;
+ }
+
+ if ($repository->usesLocalWorkingCopy()) {
+ $local_path = $repository->getLocalPath();
+ if (Filesystem::pathExists($local_path)) {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('accept-green')
+ ->setTarget(pht('Working Copy OK'))
+ ->setNote(phutil_tag('tt', array(), $local_path)));
+ } else {
+ $view->addItem(
+ id(new PHUIStatusItemView())
+ ->setIcon('time-orange')
+ ->setTarget(pht('No Working Copy Yet'))
+ ->setNote(
+ pht('Waiting for daemons to build a working copy.')));
+ return $view;
+ }
+ }
+
+ return $view;
+ }
+
}
Index: src/applications/repository/storage/PhabricatorRepository.php
===================================================================
--- src/applications/repository/storage/PhabricatorRepository.php
+++ src/applications/repository/storage/PhabricatorRepository.php
@@ -805,6 +805,16 @@
}
}
+ public function usesLocalWorkingCopy() {
+ switch ($this->getVersionControlSystem()) {
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
+ return $this->isHosted();
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
+ case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
+ return true;
+ }
+ }
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 24, 2:25 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6726365
Default Alt Text
D7458.id16811.diff (7 KB)
Attached To
Mode
D7458: Provide detailed status information about repository state/progress
Attached
Detach File
Event Timeline
Log In to Comment