我試圖檢查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