Checking if SVN was updated C#

168 Views Asked by At

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?

1

There are 1 best solutions below

1
On

Have you tried simply

        newProcess.StartInfo.Arguments = "st -u C:\\SVN | find \"*\"";