Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
Show First 20 Lines • Show All 1,404 Lines • ▼ Show 20 Lines | foreach ($clone_uris as $uri) { | ||||
if (!$write) { | if (!$write) { | ||||
if ($io_type == PhabricatorRepositoryURI::IO_READ) { | if ($io_type == PhabricatorRepositoryURI::IO_READ) { | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if ($write) { | |||||
if ($this->isReadOnly()) { | |||||
return false; | |||||
} | |||||
} | |||||
return false; | return false; | ||||
} | } | ||||
public function hasLocalWorkingCopy() { | public function hasLocalWorkingCopy() { | ||||
try { | try { | ||||
self::assertLocalExists(); | self::assertLocalExists(); | ||||
return true; | return true; | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
▲ Show 20 Lines • Show All 840 Lines • ▼ Show 20 Lines | public function getPassthroughEnvironmentalVariables() { | ||||
return $result; | return $result; | ||||
} | } | ||||
public function supportsBranchComparison() { | public function supportsBranchComparison() { | ||||
return $this->isGit(); | return $this->isGit(); | ||||
} | } | ||||
public function isReadOnly() { | |||||
return (bool)$this->getDetail('read-only'); | |||||
} | |||||
public function setReadOnly($read_only) { | |||||
return $this->setDetail('read-only', $read_only); | |||||
} | |||||
public function getReadOnlyMessage() { | |||||
return $this->getDetail('read-only-message'); | |||||
} | |||||
public function setReadOnlyMessage($message) { | |||||
return $this->setDetail('read-only-message', $message); | |||||
} | |||||
public function getReadOnlyMessageForDisplay() { | |||||
$parts = array(); | |||||
$parts[] = pht( | |||||
'This repository is currently in read-only maintenance mode.'); | |||||
$message = $this->getReadOnlyMessage(); | |||||
if ($message !== null) { | |||||
$parts[] = $message; | |||||
} | |||||
return implode("\n\n", $parts); | |||||
} | |||||
/* -( Repository URIs )---------------------------------------------------- */ | /* -( Repository URIs )---------------------------------------------------- */ | ||||
public function attachURIs(array $uris) { | public function attachURIs(array $uris) { | ||||
$custom_map = array(); | $custom_map = array(); | ||||
foreach ($uris as $key => $uri) { | foreach ($uris as $key => $uri) { | ||||
$builtin_key = $uri->getRepositoryURIBuiltinKey(); | $builtin_key = $uri->getRepositoryURIBuiltinKey(); | ||||
if ($builtin_key !== null) { | if ($builtin_key !== null) { | ||||
▲ Show 20 Lines • Show All 488 Lines • Show Last 20 Lines |