Oct 14, 2011

SVN: How to get SVN log with C#

using (SvnClient client = new SvnClient())
{
Collection<SvnLogEventArgs> logItems;

client.GetLog(new Uri("svn://svnserver/mainproject/trunk"), out logItems);
StringBuilder builder = new StringBuilder();
foreach (var item in logItems)
{
builder.AppendFormat("{0}\t{1}\t{2}\t{3}\n",
item.Revision, item.Time, item.Author, item.LogMessage.Replace('\r', ' ').Replace('\n', ' '));
}
File.WriteAllText("log.txt", builder.ToString(),Encoding.UTF8);
}
SharpSVN Project: http://sharpsvn.open.collab.net/

No comments:

Post a Comment