views:

17

answers:

2

I am using the Export() member function to obtain files at specific revisions which is working but for some reason in other cases it is not. For all the modified paths it seems to be working however with the deleted and sometimes added files in that revision I get the exception stating that there is no file at the url used. When I use the TurtoiseSVNs "Copy Revision to..." on these paths it works fine and I'm just wondering if I am missing something with SharpSVN, I would like the full versions at the revision of all the modified files. Heres the general idea of my code:

if (logentry.ChangedPaths != null)
{
     foreach (SvnChangeItem svnChangeItem in logentry.ChangedPaths)
     {
         SvnExportArgs ex = new SvnExportArgs();
         ex.Revision = revisionNum;
         client.Export(SvnTarget.FromUri(new Uri(pathInsideRepo)), exportFile, ex);
     }
}

Any help or suggestions would be appreciated, thanks.

A: 

I found that using a SvnUriTarget instead of just the uri with the SvnExportArgs allowed me to obtain the correct information. Not too sure on why they are different but it works.

so instead of the Export above I used:

client.Export(new SvnUriTarget(new Uri(pathInsideRepo), revisionNumber), exportFile, ex);

The answer I found was at link text

Sam F
+1  A: 

The command line client has the same behavior. What's going on is that the URLs pointing to a file can come and go. This means that the url pointing to a file that is now deleted is invalid, unless you specify you want to use an older url. This is called a peg revision.

Read up on peg revisions in the svnbook.

Sander Rijken