Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | public function attachProjectPHIDs(array $project_phids) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getProjectPHIDs() { | public function getProjectPHIDs() { | ||||
return $this->assertAttached($this->projectPHIDs); | return $this->assertAttached($this->projectPHIDs); | ||||
} | } | ||||
/** | |||||
* Get the name of the directory this repository should clone or checkout | |||||
* into. For example, if the repository name is "Example Repository", a | |||||
* reasonable name might be "example-repository". This is used to help users | |||||
* get reasonable results when cloning repositories, since they generally do | |||||
* not want to clone into directories called "X/" or "Example Repository/". | |||||
* | |||||
* @return string | |||||
*/ | |||||
public function getCloneName() { | |||||
$name = $this->getDetail('clone-name'); | |||||
// Make some reasonable effort to produce reasonable default directory | |||||
// names from repository names. | |||||
if (!strlen($name)) { | |||||
$name = $this->getName(); | |||||
$name = phutil_utf8_strtolower($name); | |||||
$name = preg_replace('@[/ -:]+@', '-', $name); | |||||
$name = trim($name, '-'); | |||||
if (!strlen($name)) { | |||||
$name = $this->getCallsign(); | |||||
} | |||||
} | |||||
return $name; | |||||
} | |||||
/* -( Remote Command Execution )------------------------------------------- */ | /* -( Remote Command Execution )------------------------------------------- */ | ||||
public function execRemoteCommand($pattern /* , $arg, ... */) { | public function execRemoteCommand($pattern /* , $arg, ... */) { | ||||
$args = func_get_args(); | $args = func_get_args(); | ||||
return $this->newRemoteCommandFuture($args)->resolve(); | return $this->newRemoteCommandFuture($args)->resolve(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,033 Lines • Show Last 20 Lines |