Differential D13350 Diff 33018 src/applications/diffusion/controller/DiffusionRepositoryController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryController.php
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | private function buildPropertiesTable(PhabricatorRepository $repository) { | ||||
$actions = $this->buildActionList($repository); | $actions = $this->buildActionList($repository); | ||||
$view = id(new PHUIPropertyListView()) | $view = id(new PHUIPropertyListView()) | ||||
->setObject($repository) | ->setObject($repository) | ||||
->setUser($user); | ->setUser($user); | ||||
if ($repository->isHosted()) { | $project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | ||||
$ssh_uri = $repository->getSSHCloneURIObject(); | $repository->getPHID(), | ||||
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST); | |||||
if ($project_phids) { | |||||
$view->addProperty( | |||||
pht('Projects'), | |||||
$user->renderHandleList($project_phids)); | |||||
} | |||||
if (!$repository->isHosted()) { | |||||
switch ($repository->getVersionControlSystem()) { | |||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: | |||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: | |||||
$view->addProperty( | |||||
pht('Clone (Remote)'), | |||||
$this->renderCloneCommand( | |||||
$repository, | |||||
$repository->getPublicCloneURI())); | |||||
break; | |||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: | |||||
$view->addProperty( | |||||
pht('Checkout (Remote)'), | |||||
$this->renderCloneCommand( | |||||
$repository, | |||||
$repository->getPublicCloneURI())); | |||||
break; | |||||
} | |||||
} | |||||
$ssh_uri = $repository->getInternalSSHCloneURIObject(); | |||||
if ($ssh_uri) { | if ($ssh_uri) { | ||||
$clone_uri = $this->renderCloneCommand( | $clone_uri = $this->renderCloneCommand( | ||||
$repository, | $repository, | ||||
$ssh_uri, | $ssh_uri, | ||||
$repository->getServeOverSSH(), | $repository->getServeOverSSH(), | ||||
'/settings/panel/ssh/'); | '/settings/panel/ssh/'); | ||||
$view->addProperty( | $view->addProperty( | ||||
$repository->isSVN() | $repository->isSVN() | ||||
? pht('Checkout (SSH)') | ? pht('Checkout (SSH)') | ||||
: pht('Clone (SSH)'), | : pht('Clone (SSH)'), | ||||
$clone_uri); | $clone_uri); | ||||
} | } | ||||
$http_uri = $repository->getHTTPCloneURIObject(); | $http_uri = $repository->getInternalHTTPCloneURIObject(); | ||||
if ($http_uri) { | if ($http_uri) { | ||||
$clone_uri = $this->renderCloneCommand( | $clone_uri = $this->renderCloneCommand( | ||||
$repository, | $repository, | ||||
$http_uri, | $http_uri, | ||||
$repository->getServeOverHTTP(), | $repository->getServeOverHTTP(), | ||||
PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth') | PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth') | ||||
? '/settings/panel/vcspassword/' | ? '/settings/panel/vcspassword/' | ||||
: null); | : null); | ||||
$view->addProperty( | $view->addProperty( | ||||
$repository->isSVN() | $repository->isSVN() | ||||
? pht('Checkout (HTTP)') | ? pht('Checkout (HTTP)') | ||||
: pht('Clone (HTTP)'), | : pht('Clone (HTTP)'), | ||||
$clone_uri); | $clone_uri); | ||||
} | } | ||||
} else { | |||||
switch ($repository->getVersionControlSystem()) { | |||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: | |||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: | |||||
$view->addProperty( | |||||
pht('Clone'), | |||||
$this->renderCloneCommand( | |||||
$repository, | |||||
$repository->getPublicCloneURI())); | |||||
break; | |||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: | |||||
$view->addProperty( | |||||
pht('Checkout'), | |||||
$this->renderCloneCommand( | |||||
$repository, | |||||
$repository->getPublicCloneURI())); | |||||
break; | |||||
} | |||||
} | |||||
$view->invokeWillRenderEvent(); | $view->invokeWillRenderEvent(); | ||||
$description = $repository->getDetail('description'); | $description = $repository->getDetail('description'); | ||||
if (strlen($description)) { | if (strlen($description)) { | ||||
$description = PhabricatorMarkupEngine::renderOneObject( | $description = PhabricatorMarkupEngine::renderOneObject( | ||||
$repository, | $repository, | ||||
'description', | 'description', | ||||
▲ Show 20 Lines • Show All 446 Lines • Show Last 20 Lines |