0

I'm trying to check if the svn was updated, and I don't wish to use SharpSVN. I'm trying to use the Process class.

In batch, this is what I would normally do: svn st -u <svn path> | find "*"

Here is my code:

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 + " ";
}

The problem is that the find "*" doesn't work - The newProcess.StartInfo.Arguments is set to "st -u C:\\SVN | find \"*\*"", and that, of course, doesn't work.

Any ideas?

Idanis
  • 1,918
  • 6
  • 38
  • 69
  • 1
    Why don't you want to use SharpSVN? because it looks like the best option http://stackoverflow.com/questions/2074891/how-to-access-file-information-in-a-pre-commit-hook-using-sharpsvn/2075198#2075198 other libraries: http://stackoverflow.com/questions/211765/svn-libraries-for-net – JP Hellemons Apr 23 '13 at 14:36

1 Answers1

0

Have you tried simply

        newProcess.StartInfo.Arguments = "st -u C:\\SVN | find \"*\"";
AJ Henderson
  • 1,120
  • 1
  • 12
  • 32
  • Yes, I have...Same thing...The variable `m_svnOutput` which should have the results is empty, that's why I know it doesn't work. As for `newProcess.StartInfo.Arguments` - I still get `"st -u C:\\SVN | find \"*\*""` there... – Idanis Apr 23 '13 at 14:40