Last week we went over the basics of SVN. This week we are going to talk about saving some time by automating your SVN processes.
To automate your SVN process you can either create scripts to launch your SVN client of choice or you can program your own SVN client.
If you are using TortoiseSVN there are command line parameters you can send to the client to automate many of the SVN processes. If you are using another SVN client you will need to check what command line parameters it supports.
Details on the TortoiseSVN Commands can be found at http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-automation.html
Making your Own SVN Client
Why would you want to spend time making an SVN client when there are so many out there?
Well for starters in order to automate the SVN processes using the Client Commands, that client needs to be installed on that computer. Do you want to be installing SVN clients everywhere?
Another draw back to the TortoiseSVN Commands is that it only opens the appropriate screen and does not complete the action for you. If you send the branch command it will open the branching window and populate all of the information you sent, but you still have to enter a comment and click the button on the screen. That’s usually not the level of automation I want.
Here is where the old saying “If you want something done right, you’ve got to do it yourself” comes into play.
You can create your own SVN Client using the SharpSVN API available through http://sharpsvn.open.collab.net/ .
Which to Use and When?
Both options have there benifits. While they might not be as powerfull as the API, it can be a lot quicker to create a batch script that launches your SVN client.
Personally, I have been using a mixture of the two. I automated processes for things like checking out, exporting and branching through the SharpSVN API, while the processes for committing changes I do through TortoiseSVN Commands. The process for commiting can get complicated and this is also the one area that I typically want the UI to come up, so I can see what files were changed.