|
@@ -32,6 +32,10 @@ class SvnDriver extends VcsDriver
|
|
|
protected $branches;
|
|
|
protected $infoCache = array();
|
|
|
|
|
|
+ protected $trunkPath = 'trunk';
|
|
|
+ protected $branchesPath = 'branches';
|
|
|
+ protected $tagsPath = 'tags';
|
|
|
+
|
|
|
/**
|
|
|
* @var \Composer\Util\Svn
|
|
|
*/
|
|
@@ -44,7 +48,17 @@ class SvnDriver extends VcsDriver
|
|
|
{
|
|
|
$this->url = $this->baseUrl = rtrim(self::normalizeUrl($this->url), '/');
|
|
|
|
|
|
- if (false !== ($pos = strrpos($this->url, '/trunk'))) {
|
|
|
+ if (isset($this->repoConfig['trunk-path'])) {
|
|
|
+ $this->trunkPath = $this->repoConfig['trunk-path'];
|
|
|
+ }
|
|
|
+ if (isset($this->repoConfig['branches-path'])) {
|
|
|
+ $this->branchesPath = $this->repoConfig['branches-path'];
|
|
|
+ }
|
|
|
+ if (isset($this->repoConfig['tags-path'])) {
|
|
|
+ $this->tagsPath = $this->repoConfig['tags-path'];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (false !== ($pos = strrpos($this->url, '/' . $this->trunkPath))) {
|
|
|
$this->baseUrl = substr($this->url, 0, $pos);
|
|
|
}
|
|
|
|
|
@@ -59,7 +73,7 @@ class SvnDriver extends VcsDriver
|
|
|
*/
|
|
|
public function getRootIdentifier()
|
|
|
{
|
|
|
- return 'trunk';
|
|
|
+ return $this->trunkPath;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -145,13 +159,14 @@ class SvnDriver extends VcsDriver
|
|
|
if (null === $this->tags) {
|
|
|
$this->tags = array();
|
|
|
|
|
|
- $output = $this->execute('svn ls --verbose', $this->baseUrl . '/tags');
|
|
|
+ $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], '/')] = '/tags/'.$match[2].'@'.$match[1];
|
|
|
+ $this->tags[rtrim($match[2], '/')] = '/' . $this->tagsPath .
|
|
|
+ '/' . $match[2] . '@' . $match[1];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -174,8 +189,9 @@ 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] === 'trunk/') {
|
|
|
- $this->branches['trunk'] = '/trunk/@'.$match[1];
|
|
|
+ if (isset($match[1]) && isset($match[2]) && $match[2] === $this->trunkPath . '/') {
|
|
|
+ $this->branches[$this->trunkPath] = '/' . $this->trunkPath .
|
|
|
+ '/@'.$match[1];
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -183,13 +199,14 @@ class SvnDriver extends VcsDriver
|
|
|
}
|
|
|
unset($output);
|
|
|
|
|
|
- $output = $this->execute('svn ls --verbose', $this->baseUrl . '/branches');
|
|
|
+ $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], '/')] = '/branches/'.$match[2].'@'.$match[1];
|
|
|
+ $this->branches[rtrim($match[2], '/')] = '/' . $this->branchesPath .
|
|
|
+ '/' . $match[2] . '@' . $match[1];
|
|
|
}
|
|
|
}
|
|
|
}
|