Question

So I know how to export files @ certain revisions to the filesystem (because all of the overloads for Export have paths in them) but I do not want to have to use the filesystem for ease of access purposes. Is there a way to redirect this to a string or something? Thanks.

Was it helpful?

Solution

I stand corrected, but cannot delete the post.

I took a look at the source code for SharpSVN, and it doesn't look promising. Instead of using .NET file streams for writing to the file system (which might have given us some insight how to use the .NET stream of our choice), the library does native interop when executing commands. The native methods return values indicating success or failure, but do not appear to provide handles to anything we can turn into a MemoryStream or some such in-memory structure.

I think a least-effort solution to the problem is to export revisions to temporary file storage, then read the file(s) into memory with the System.IO classes.

OTHER TIPS

You can use SvnClient.Write() to do this.

Example:

using(var stream = new MemoryStream())
{
    // export urlToFile, at revision 1234:
    client.Write(new SvnUriTarget(new Uri(urlToFile), 1234), stream);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top