SVN에서 패치 파일을 만들려면 버전간에 "통합 된 Diff"파일을 만들 수도 있습니다. 다음 코드는 동일한 코드를 기반으로합니다. 지정된 개정판에서 수행 된 변경 사항에 대한 통합 Diff 파일을 작성합니다.
System.Uri uri = new System.Uri("your url path");
using (SvnClient client = new SvnClient())
{
SvnUriTarget from = new SvnUriTarget(uri);
// To Get the Latest Revision on the Required SVN Folder
SvnInfoEventArgs info;
client.GetInfo(uri, out info);
SvnRevisionRange range = new SvnRevisionRange(info.Revision - 10, info.Revision); // The given input revisions should be valid revisions on the selected Repo path
System.IO.MemoryStream stream = new System.IO.MemoryStream();
if (client.Diff(from, range, stream))
{
stream.Position = 0; //reset the stream position to zero, as the stream position returned from Diff method is at the end.
System.IO.File.AppendAllText(@"C:\diffFile.patch", new System.IO.StreamReader(stream).ReadToEnd());
}
stream.Close();
}