从网络位置查看存储库

从网络位置查看存储库

我已成功在我的计算机上安装了 VisualSVN 服务器,并在网络上设置了它的存储库根目录,以便将所有文件保存在另一台计算机上。我的存储库根目录是\\file-server\svn\
我可以通过内置 Web 浏览器访问我的所有存储库https://localhost/svn/,但我想安装 WebSVN。

当我的存储库位于本地驱动器上时,我可以使用 WebSVN 查看它们,毫无问题,但当我想要访问网络位置时却遇到了问题。

在 config.php 中我有这个配置:

 $config->parentPath('c:\\Repositories');
 //$config->parentPath('file:///\file-server\svn');

当我注释第一行并取消注释第二行时出现以下错误:

Error running this command: " "C:\Program Files\VisualSVN Server\bin\svn" --non-interactive --config-dir /tmp log --xml --quiet "file:///file:////file-server/svn/TestRepo/@"" --limit 1
svn: E180001: Unable to connect to a repository at URL 'file:///file:/file-server/svn/TestRepo'
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///file:/file-server/svn/TestRepo'

我尝试将我的网络位置映射为驱动器,但这没有帮助。

WebSVN 中是否有设置网络位置的选项?

答案1

这里,WebSVN 尝试连接file:///file:////file-server/svn/TestRepo/@无效位置。文件协议连接到本地文件系统。尝试

svn://file-server/svn/TestRepo

或者,

https://localhost/svn/TestRepo

答案2

我已设法创建临时解决方案:而是使用parentPath循环中添加存储库:

function getDirectoryList($d) {
    $r = array();
    $h = opendir($d);
    while ($f = readdir($h)) {
            if ($f != "." && $f != ".." && is_dir($d.'/'.$f)) {
                    $r[] = $f;
            }
    }
    closedir($h);
    return $r;
}


$files=getDirectoryList('file:////\file-server\svn');
foreach($files as $dir) {
    $config->addRepository($dir, 'file:////\file-server\\svn\\'.$dir);
}

这是内部执行的相同循环configclass.php,但我修复了从网络位置添加存储库时的错误。

如果有人知道如何使用parentPath此解决方案或如何调整configclass.php以正确添加存储库,请添加答案。

相关内容