|
@@ -32,9 +32,9 @@ class SvnDriver extends VcsDriver
|
|
|
protected $branches;
|
|
|
protected $infoCache = array();
|
|
|
|
|
|
- protected $trunkLocation = 'trunk';
|
|
|
- protected $branchesLocation = 'branches';
|
|
|
- protected $tagsLocation = 'tags';
|
|
|
+ protected $trunkPath = 'trunk';
|
|
|
+ protected $branchesPath = 'branches';
|
|
|
+ protected $tagsPath = 'tags';
|
|
|
|
|
|
/**
|
|
|
* @var \Composer\Util\Svn
|
|
@@ -47,18 +47,18 @@ class SvnDriver extends VcsDriver
|
|
|
public function initialize()
|
|
|
{
|
|
|
$this->url = $this->baseUrl = rtrim(self::normalizeUrl($this->url), '/');
|
|
|
-
|
|
|
- if ($this->config->has('trunkLocation')) {
|
|
|
- $this->trunkLocation = $this->config->get('trunkLocation');
|
|
|
+
|
|
|
+ if (isset($this->repoConfig['trunk-path'])) {
|
|
|
+ $this->trunkPath = $this->repoConfig['trunk-path'];
|
|
|
}
|
|
|
- if ($this->config->has('branchesLocation')) {
|
|
|
- $this->branchesLocation = $this->config->get('branchesLocation');
|
|
|
+ if (isset($this->repoConfig['branches-path'])) {
|
|
|
+ $this->branchesPath = $this->repoConfig['branches-path'];
|
|
|
}
|
|
|
- if ($this->config->has('tagsLocation')) {
|
|
|
- $this->tagsLocation = $this->config->get('tagsLocation');
|
|
|
+ if (isset($this->repoConfig['tags-path'])) {
|
|
|
+ $this->tagsPath = $this->repoConfig['tags-path'];
|
|
|
}
|
|
|
|
|
|
- if (false !== ($pos = strrpos($this->url, '/' . $this->trunkLocation))) {
|
|
|
+ if (false !== ($pos = strrpos($this->url, '/' . $this->trunkPath))) {
|
|
|
$this->baseUrl = substr($this->url, 0, $pos);
|
|
|
}
|
|
|
|
|
@@ -73,7 +73,7 @@ class SvnDriver extends VcsDriver
|
|
|
*/
|
|
|
public function getRootIdentifier()
|
|
|
{
|
|
|
- return $this->trunkLocation;
|
|
|
+ return $this->trunkPath;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -159,13 +159,13 @@ class SvnDriver extends VcsDriver
|
|
|
if (null === $this->tags) {
|
|
|
$this->tags = array();
|
|
|
|
|
|
- $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->tagsLocation);
|
|
|
+ $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->tagsPath);
|
|
|
if ($output) {
|
|
|
foreach ($this->process->splitLines($output) as $line) {
|
|
|
$line = trim($line);
|
|
|
if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) {
|
|
|
if (isset($match[1]) && isset($match[2]) && $match[2] !== './') {
|
|
|
- $this->tags[rtrim($match[2], '/')] = '/' . $this->tagsLocation .
|
|
|
+ $this->tags[rtrim($match[2], '/')] = '/' . $this->tagsPath .
|
|
|
'/' . $match[2] . '@' . $match[1];
|
|
|
}
|
|
|
}
|
|
@@ -189,8 +189,8 @@ class SvnDriver extends VcsDriver
|
|
|
foreach ($this->process->splitLines($output) as $line) {
|
|
|
$line = trim($line);
|
|
|
if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) {
|
|
|
- if (isset($match[1]) && isset($match[2]) && $match[2] === $this->trunkLocation . '/') {
|
|
|
- $this->branches[$this->trunkLocation] = '/' . $this->trunkLocation .
|
|
|
+ if (isset($match[1]) && isset($match[2]) && $match[2] === $this->trunkPath . '/') {
|
|
|
+ $this->branches[$this->trunkPath] = '/' . $this->trunkPath .
|
|
|
'/@'.$match[1];
|
|
|
break;
|
|
|
}
|
|
@@ -199,13 +199,13 @@ class SvnDriver extends VcsDriver
|
|
|
}
|
|
|
unset($output);
|
|
|
|
|
|
- $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->branchesLocation);
|
|
|
+ $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->branchesPath);
|
|
|
if ($output) {
|
|
|
foreach ($this->process->splitLines(trim($output)) as $line) {
|
|
|
$line = trim($line);
|
|
|
if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) {
|
|
|
if (isset($match[1]) && isset($match[2]) && $match[2] !== './') {
|
|
|
- $this->branches[rtrim($match[2], '/')] = '/' . $this->branchesLocation .
|
|
|
+ $this->branches[rtrim($match[2], '/')] = '/' . $this->branchesPath .
|
|
|
'/' . $match[2] . '@' . $match[1];
|
|
|
}
|
|
|
}
|