How to programmatically get SVN revision description and author in c#?

前端 未结 3 647
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 00:42

How do I programmatically get the revision description and author from the SVN server in c#?

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 01:29

    Using SharpSvn:

    using(SvnClient client = new SvnClient())
    {
        Collection list;
    
        // 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);
        }
    }
    

提交回复
热议问题