From 652715f4c2f066f2d68aeaabea707ec3cc42574f Mon Sep 17 00:00:00 2001 From: schmkr Date: Mon, 16 Sep 2013 18:10:24 +0200 Subject: [PATCH] Improved the handling of trunkPath - $this->baseUrl is only used if $this->trunkPath === false, otherwise we will use $this->baseUrl with $this->trunkPath. - scanning through trunkPath will now look for composer.json file instead of a path that matches $this->trunkPath, beacuse checking against the latter failed with deeper trunkPaths - $this->rootIdentifier is now 'trunk' no matter how deep $this->trunkPath is (with deeper trunkPaths, the name became something like "dev-trunk-devel-team-packages-package" --- src/Composer/Repository/Vcs/SvnDriver.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index c5a67b455..2ac05e712 100644 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/src/Composer/Repository/Vcs/SvnDriver.php @@ -193,10 +193,10 @@ class SvnDriver extends VcsDriver if (null === $this->branches) { $this->branches = array(); - if (false === strpos($this->trunkPath, '/')) { + if(false === $this->trunkPath) { $trunkParent = $this->baseUrl . '/'; } else { - $trunkParent = $this->baseUrl . '/' . dirname($this->trunkPath) . '/'; + $trunkParent = $this->baseUrl . '/' . $this->trunkPath; } $output = $this->execute('svn ls --verbose', $trunkParent); @@ -204,12 +204,12 @@ 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->trunkPath . '/') { - $this->branches[$this->trunkPath] = $this->buildIdentifier( + if (isset($match[1]) && isset($match[2]) && $match[2] === 'composer.json') { + $this->branches['trunk'] = $this->buildIdentifier( '/' . $this->trunkPath, $match[1] ); - $this->rootIdentifier = $this->branches[$this->trunkPath]; + $this->rootIdentifier = $this->branches['trunk']; break; } }