From 2b065030273bb116849a6785cdabaec8c889b24d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 26 Oct 2012 01:53:34 +0200 Subject: [PATCH] SvnDriver fixes --- src/Composer/Repository/Vcs/SvnDriver.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index e4db92bf6..7477d6fdf 100755 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/src/Composer/Repository/Vcs/SvnDriver.php @@ -30,6 +30,7 @@ class SvnDriver extends VcsDriver protected $baseUrl; protected $tags; protected $branches; + protected $rootIdentifier; protected $infoCache = array(); protected $trunkPath = 'trunk'; @@ -73,7 +74,7 @@ class SvnDriver extends VcsDriver */ public function getRootIdentifier() { - return $this->trunkPath; + return $this->rootIdentifier ?: $this->trunkPath; } /** @@ -117,7 +118,7 @@ class SvnDriver extends VcsDriver $path = $match[1]; $rev = $match[2]; } else { - $path = ''; + $path = $identifier; $rev = ''; } @@ -190,8 +191,8 @@ class SvnDriver extends VcsDriver $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->trunkPath . - '/@'.$match[1]; + $this->branches[$this->trunkPath] = '/' . $this->trunkPath . '/@'.$match[1]; + $this->rootIdentifier = $this->branches[$this->trunkPath]; break; } }