How do I get a list of revisions from sharpsvn
Guessing at what your question really is about the answer is most likely SvnClient.Log(), to get you a list of changes of a path.
Another anwer would be:
for (int i = 1; i < 101; i++)
yield return i;
to get you the first 100 revisisions of a repository ;-)
See http://stackoverflow.com/questions/989034/using-sharpsvn-to-retrieve-log-entries-within-a-date-range for some examples on how to use SvnClient.Log()
Hello Chris,
If you look at the metadata for SvnLogEventArgs
(which is returned as a collection from GetLog
) it derives from SvnLoggingEventArgs
, which has properties of Author, Revision, Time and LogMessage (amongst others)
Each SvnLogEventArgs
item has a collection of ChangedPaths
, which have properties for SvnChangeAction, and Path.
You can get a list of all the log info by this method:
var client = new SvnClient();
System.Collections.ObjectModel.Collection<SvnLogEventArgs> logEventArgs;
client.GetLog("targetPath", out logEventArgs);
Iterating through all the logEventArgs will give you some useful information - LogMessage, Author, etc.
I don't know what you're doing, but I am checking the latest version of the working copy using SvnWorkingCopyClient:
var workingCopyClient = new SvnWorkingCopyClient();
SvnWorkingCopyVersion version;
workingCopyClient.GetVersion(workingFolder, out version);
The latest version of the local working repository is then available through
long localRev = version.End;
For a remote repository, use
var client = new SvnClient();
SvnInfoEventArgs info;
client.GetInfo(targetUri, out info);
long remoteRev = info.Revision;
instead.
This is similar to using the svnversion
tool from the command line. Hope this helps.