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

2

6

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.

Lemieux answered 23/6, 2010 at 18:1 Comment(0)
L
2

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

Lemieux answered 23/6, 2010 at 18:29 Comment(0)
D
2

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.

Danettedaney answered 23/6, 2010 at 23:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.