Search code examples
c#exportsharpsvn

Why is SharpSVN SvnClient.Export(...) not always finding files that should be there?


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.


Solution

  • 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