views:

41

answers:

1

Hello, I was looking for something in SharpSVN that will do the equivalent of "Save revision to..." in the TurtoiseSVN GUI. I have been trying to find out how to do this with no luck. Currently I am looking at: Note: logentry is a SvnLogEventArgs after I called client.GetLog(uri, arguments, out logitems);

foreach (SvnChangeItem svnChangeItem in logentry.ChangedPaths)
{
     // I would think I could do something like svnChangeItem.SaveRevsionTo()
}

The SvnChangeItems store basically the exact information that is shown in TurtoiseSVN. When you right-click there it allows you to save the selected revsision file which is what I am hoping to do with SharpSVN (I do not want to actually check out the file, just get a copy of the file at that revision). Thanks.

+3  A: 

Use SvnClient.Export, passing in a SvnUriTarget constructed with the repository url and desired revision number.

Pete Kirkham
Will do, thanks!
Sam F
@Pete Kirkham: I'm not sure I quite understand the format of this call. Would you mind giving an example of say the call to get the file example.txt from 'trunk/' in the repository at revision 11 to 'C:\'?
Sam F
Aha, okay. I worked through one of the overloaded versions and found the one that I needed and it works. Thanks again for the info.
Sam F
You probably meant `SvnUriTarget` instead of `SvnTargetUri`? SharpSvn has 2 types of `SvnTarget`: `SvnPathTarget` and `SvnUriTarget`. The former is for working copy paths, whereas the latter can be used for repository urls (at specific versions)
Sander Rijken
@Sander yes I did
Pete Kirkham