views:

317

answers:

6

I'm designing a document library, and I'd like to use Subversion as the version control system. How can I automate tasks like check-in, check-out and diff from C#? Does Tortoise perhaps offer some help with this?

TIA.

A: 

Can't you just use the commandline from your app?

See http://svnbook.red-bean.com/en/1.4/svn.ref.svn.html

Matt Lacey
+4  A: 

How about sharpsvn

Jason Punyon
Booyah! Thanks.
Chris B. Behrens
No problem..........
Jason Punyon
+1  A: 

Subversion is completely command line driven. TortoiseSVN masks this for us windows users. Simply call the command line commands from within your C# program.

Loki Stormbringer
Noteworthy: by using the --xml parameter you get the output as XML which is definitely easier to parse than plain console output. I was using this in a C#-based server hook that was sending commit messages to our bug tracker...
Marc Wittke
+1  A: 

You can write server-side or client-side hooks with C#. on the server side you just need to write an app that takes the connect number of parameters give it the name of the hook and put it in the hooks folder. On the client side you will do the same but you need to hell Tortoise were to find the app.

(this is assuming you want to get information from SNV in to the content management. You might want to look at the command line tools or SharpSVN to go the other way around)

Matthew Whited
+2  A: 

Give a look to this question:

CMS
A: 

Try this blog post about Creating your own custom Subversion management layer. In short, SharpSVN is your best bet but you'll still have some work to do.

Troy Hunt