public function getSvnUrl($path)
    {
        $head = $this->head;

        if ($path instanceof Reference) {
            $head = $path;
            $path = '/';
        }

        if (null === $path) {
            $path = '/';
        }

        if (is_string($path)) {
            $path = new VcsFileInfo($path, array($head->getName(), $head->getType()));
        }

        if ($path->inBranch()) {
            $branchName = $path->getReferenceName();

            if ('trunk' === $branchName) {
                $basePath = $this->basePaths['trunk'];
            } else {
                $basePath = $this->basePaths['branches'] . '/' . $branchName;
            }
        } elseif ($path->inTag()) {
            $tagName = $path->getReferenceName();

            $basePath = $this->basePaths['tags'] . '/' . $tagName;
        }

        $retval = $this->url;
        if (isset($basePath)) {
            $retval.= '/' . $basePath;
        }

        $retval.= '/' . ltrim($path->getPathname(), '/');
        $retval = rtrim($retval, '/');

        return $retval;
    }