【发布时间】:2020-07-19 23:23:34
【问题描述】:
当有人提交时,我需要确定将其添加到我们内部版本控制器中的哪个项目。其中一个因素是是否创建了某个分支。
我有这个功能:
私有静态字符串SVN(字符串命令) { StringBuilder 输出 = new StringBuilder(); 进程 procMessage = new Process();
//Start svnlook.exe in a process and pass it the required command-line args.
procMessage.StartInfo = new ProcessStartInfo(
@"C:\Program Files\VisualSVN Server\bin\svn.exe",
command
);
procMessage.StartInfo.RedirectStandardOutput = true;
procMessage.StartInfo.UseShellExecute = false;
procMessage.Start();
//While reading the output of svn, append it to the stringbuilder then
//return the output.
while (!procMessage.HasExited)
{
output.Append(procMessage.StandardOutput.ReadToEnd());
}
return output.ToString();
}
被调用的是:
string nextRelease = SVN("ls https://server:port/svn/repo/branches/branchname");
然后检查 nextRelease 是否为空。 这适用于我本地 repo 上的本地 PC,但是当我在服务器上安装提交挂钩时,我收到如下错误:
Error: svn: E170013: Unable to connect to a repository at URL 'https://server:port/svn/repo/branches/branchname'
Error: svn: E175013: Access to '/svn/repo/branches/branchname' forbidden
SVNLook 不提供我能找到的这些信息,并且用户可能是 SVN 用户,因此它可以访问 SVN。
我错过了什么?
【问题讨论】:
标签: svn post-commit-hook