How to get latest revision number using SharpSVN?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Ok, I figured it by myself:
This is a very old question, and it has been answered well in the top two answers. Still, in the hopes it might be of some help to someone I'm posting the following C# method to illustrate how to not only get the revision numbers from both the repository and the working copy, but also how to test for typical situations that might be considered as problems, for example in an automated build process.
(This code does include a couple of things specific for the program it was copied from, but that shouldn't make the SharpSvn parts difficult to understand.)
Well, a quick google search gave me that, and it works (just point at the /trunk/ URI):
http://sharpsvn.open.collab.net/ds/viewMessage.do?dsForumId=728&dsMessageId=89318
The least expensive way to retrieve the head revision from a repository is the Info command.
i googled also a lot but the only one thing which was working for me to get really the last revision was:
the other solutions are commented out. Try by yourself and see the difference . . .
I am checking the latest version of the working copy using SvnWorkingCopyClient:
The latest version of the local working repository is then available through
For a remote repository, use
instead.
This is similar to using the svnversion tool from the command line. Hope this helps.