SVN Command Line
First I’ll start off with some background information on the reason for my diving into SVN Command Line. On a project I am involved with, we currently submit database scripts to a centralized location within our project repository. Being that we are fairly early in development, and the fact that we actually use a largely database driven layout, there are a LOT of scripts being commit. When it comes time to release, someone is presented with the task of taking the SQL files from a range of revisions, reviewing, and building one compilation script for the release. Nobody likes to be this person
I decided to build a tool to allow someone to enter a repository path and a range of revisions and have it output a compiled database script to their browser to allow them to review, edit if need be, and database it so it is available for future deployments or simply for reference. I won’t get into the views so much, but I will fill you in on some gotcha’s that I encountered as well as provide a couple of ColdFusion functions that might prove helpful.
First thing’s first, here is the documentation for all things SVN Command Line. Here are some pointers that may prove helpful for someone on a similar venture:
I wanted to be able to run the command line from the application without having to install the client on the server, so I just packaged the actual executable and corresponding DLL’s in my project and all my functions run against the executable directly. Here is the package of files I included to do this.
I put together a couple of functions that leverage SVN Command Line to get log information as well as the contents of a file at a given revision. Here is the code if you want to check it out. The reason for the formatPath functions is to account for spaces in file names or directories. I figured there is a strong possibility I could find other formatting concerns as this is used more, so I might as just wrap a function around it so if I do find another it’s an easy update. Also, something that hung me up for a while is that the paths used in your command line are case sensitive so just be aware of this. It is not really an issue when you are getting the paths directly from Subversion and outputting them in your command line since they come out with the correct case, but still something to keep in the back of your mind.
At this point we have clearly only scratched the surface of simplifying our release process using SVN Command Line. I will post more information as we expand on this project.