我试图检查svn是否已更新,并且我不希望使用SharpSVN。 我正在尝试使用Process
类。检查SVN是否已更新C#
在批处理,这就是我通常会做:svn st -u <svn path> | find "*"
这里是我的代码:
private void checkSVN()
{
Process newProcess= new Process();
newProcess.StartInfo.FileName = "svn";
newProcess.StartInfo.WorkingDirectory = "";
newProcess.StartInfo.Arguments = "st -u C:\\SVN | find " + @"""*""";
newProcess.StartInfo.UseShellExecute = false;
newProcess.StartInfo.RedirectStandardOutput = true;
newProcess.OutputDataReceived += new DataReceivedEventHandler(parseStandartOutput);
newProcess.Start();
newProcess.BeginOutputReadLine();
}
private static void parseStandartOutput(object sendingProcess, DataReceivedEventArgs outLine)
{
if (!String.IsNullOrEmpty(outLine.Data))
m_svnOutput += outLine.Data + " ";
}
的问题是,find "*"
不工作 - newProcess.StartInfo.Arguments
设置为"st -u C:\\SVN | find \"*\*""
,当然,这是行不通的。
任何想法?
为什么你不希望使用SharpSVN?因为它看起来像最好的选择http://stackoverflow.com/questions/2074891/how-to-access-file-information-in-a-pre-commit-hook-using-sharpsvn/2075198#2075198其他库:http ://stackoverflow.com/questions/211765/svn-libraries-for-net – 2013-04-23 14:36:27