I am trying to find an efficient way to get the previous revision of a file to do a text comparison using SharpSVN.
using (SvnClient c = new SvnClient())
{
c.Authentication.DefaultCredentials = new NetworkCredential(
ConfigurationManager.AppSettings.Get("SvnServiceUserName")
, ConfigurationManager.AppSettings.Get("SvnServicePassword")
, ConfigurationManager.AppSettings.Get("SvnServiceDomain")
);
c.Authentication.SslServerTrustHandlers += new EventHandler<SvnSslServerTrustEventArgs>(Authentication_SslServerTrustHandlers);
Collection<SvnFileVersionEventArgs> fileVersionCollection = new Collection<SvnFileVersionEventArgs>();
SvnRevisionRange range = new SvnRevisionRange(0, this.hooks.Revision);
SvnFileVersionsArgs args = new SvnFileVersionsArgs();
args.RetrieveProperties = true;
args.Range = range;
foreach (SvnChangeItem item in log.ChangedPaths)
{
string path = this.repositoryPath + item.Path;
bool gotFileVersions = false;
try
{
if (item.NodeKind == SvnNodeKind.File)
gotFileVersions = c.GetFileVersions(SvnTarget.FromString(path), args, out fileVersionCollection);
The code above is an example of performing my request, however it is extremely inefficient. My goal is to be able to select a revision, and also the previous revision. For example, if my repository is at r185, but I want to view the file at revision 100, and also view the same file's previous revision (which I wouldn't know what is), how can this be done?
I've looked at c.GetInfo() but this seems to only get the previous revision to the most current commit.
Thanks!