Using the SVNClient.Diff Diff Method (SvnTarget Target, SvnRevisionRange Range, Stream Results)

Given two different revisions, I need to get the differences between them, I intend to use the duvuelve diff method, but I have something as a result, can it be? Thank you My code is as follows

using (SvnClient client = new SvnClient())
using (MemoryStream result = new MemoryStream())
{
    client.Authentication.DefaultCredentials = new NetworkCredential("asdf", "asdf/*");
    try
    {
        //SvnUriTarget is a wrapper class for SVN repository URIs
        SvnUriTarget target = new SvnUriTarget(textBox1.Text);
        if (client.Diff(target, rango, result))
            MessageBox.Show("Successfully para" + rango.ToString() + ".");


        StreamReader strReader = new StreamReader(result);

        string str = strReader.ReadToEnd();
    }
}
+3
source share
1 answer

The stream returned by the Diff () function is located at the end of the stream, so before creating your stream reader, you need to move it at the beginning of the stream:

result.Position = 0;
StreamReader strReader = new StreamReader(result);
+5
source

Source: https://habr.com/ru/post/1785119/


All Articles