如何以编程方式从c#中的SVN服务器获取修订描述和作者?
使用SharpSvn:
using(SvnClient client = new SvnClient()) { Collectionlist; // When not using cached credentials // c.Authentication.DefaultCredentials = new NetworkCredential("user", "pass")l SvnLogArgs la = new SvnLogArgs { Start = 128, End = 132 }; client.GetLog(new Uri("http://my/repository"), la, out list); foreach(SvnLogEventArgs a in list) { Console.WriteLine("=== r{0} : {1} ====", a.Revision, a.Author); Console.WriteLine(a.LogMessage); } }
您需要找到要使用的C#SVN API.谷歌快速搜索发现了SharpSVN.
获取特定修订的消息和作者
SvnClient client = new SvnClient(); SvnUriTarget uri = new SvnUriTarget("url", REV_NUM); string message, author; client.GetRevisionProperty(uri, "svn:log", out message); client.GetRevisionProperty(uri, "svn:author", out author);