How to get latest revision number from SharpSVN?

前端 未结 6 956
故里飘歌
故里飘歌 2020-12-09 14:57

How to get latest revision number using SharpSVN?

6条回答
  •  一向
    一向 (楼主)
    2020-12-09 15:48

    i googled also a lot but the only one thing which was working for me to get really the last revision was:

    public static long GetRevision(String target)
        {
            SvnClient client = new SvnClient();
    
            //SvnInfoEventArgs info;
            //client.GetInfo(SvnTarget.FromString(target), out info); //Specify the repository root as Uri
            //return info.Revision
            //return info.LastChangeRevision
    
            Collection info = new Collection();
            client.GetLog(target, out info);
            return info[0].Revision;
        }
    

    the other solutions are commented out. Try by yourself and see the difference . . .

提交回复
热议问题