0

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.

Sam F
  • 621
  • 1
  • 8
  • 16

1 Answers1

3

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

Pete Kirkham
  • 48,893
  • 5
  • 92
  • 171
  • 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 Jun 23 '10 at 15:49
  • 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 Jun 23 '10 at 16:02
  • 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 Jun 23 '10 at 23:00