1

I'm trying to check if a certain svn subdirectory was updated, and if so, update my entire working directory.

Here is what I do:

SvnClient svnClient = new SvnClient();
SvnWorkingCopyClient workingCopyClient = new SvnWorkingCopyClient();

SvnInfoEventArgs svnInfo;
SvnWorkingCopyVersion workingCopyVersion;

Uri svnRepository = new Uri(m_svnAddress + /local/trunk/somefolder");

svnClient.GetInfo(svnRepository, out svnInfo);
workingCopyClient.GetVersion("C:\\Workspace\\somefolder", out workingCopyVersion);


int recentSvnRevision = unchecked((int)svnInfo.Revision);
int currentVersion = unchecked((int)workingCopyVersion.End);

if (recentSvnRevision != currentVersion)
   // Do stuff

The problem is that recentSvnRevision is set to the latest revision number of the entire directory on the svn, and not the revision of the /local/trunk/somefolder directory.

Any ideas?

Idanis
  • 1,918
  • 6
  • 38
  • 69
  • 1
    What do you want to find out? The latest revision on the server, or the latest revision of the working copy? Is there a reason you can't just update, instead of checking if something changed, and then update? – Sander Rijken May 14 '13 at 18:16

1 Answers1

1

You can use this to get the latest revision number for a specific directory:

SvnInfoEventArgs info;
client.GetInfo(RemotePath, out info);
return info.LastChangeRevision;

where RemotePath is the directory of the folder you want to check (ex. https://svn.exmaple.com/local.../somefolder), as opposed to the path of the repository.