When developing in a team environment, it’s essential to have some sort of source control in place to facilitate the process of multiple people working on the same set of files. At a very basic level, you need something to prevent developers over-writing each others edits. This occurs when two people are working independently on the same file – Developer A saves their edits, and the Developer B saves theirs, overwriting the work just done by A. Tools like Dreamweaver handle this situation by file locking. When someone checks a file out for edits, the original file is locked so that no one else can edit it.
File locking works fine for simple projects – such as flat web sites. As soon as you have any degree of reusable application logic involved the whole situation becomes a lot more complex. The scenario can occur whereby two developers make incompatible changes to different parts of the application – the result is that the whole app is blown out of the water and nothing functions at all. Without source control, the solution to this problem is either to restore from backup and lose the day’s work, or for the developers to get their heads together and pick through the code until they find the problem and engineer a solution – all the while the app is offline and other developers are left twiddling their thumbs. With proper source control that keeps track of versions, the incompatible edits can simply be rolled back to the working version (bringing the app back online in no time at all) and then the troublesome twosome can get their heads together and work out what went wrong in a far less expensive way.
So this is basic stuff, and most web developers will be familiar with source control systems like Microsoft SourceSafe, and the open source CVS. CVS is very widely used in the open source community as it’s very capable and works really well across the wire. It does have its limitations, however, and is also getting a little long in the tooth. Enter Subversion.
Subversion is designed to replace CVS by providing the same features as CVS and fixing a lot of its shortcomings at the same time. It utilizes WebDAV and Apache 2 (although you can run this concurrently with your production Apache 1.3 server, on a different port), and offers new features such as directory – not just file – versioning, and better handling of binary files, which is useful for web projects with lots of graphics.
I’ve already got CVS running here at work, but as I’m about to kick off a big new project and as Subversion hit the magic version 1.0.0 in February, I thought it might be worth a try. There seem to be a range of clients for Linux, Windows and Mac OS X, so that covers all my bases. Any one else using it yet, and with good or bad results?



Comments
The client on Mac OS X is commandline and compiles and builds quite nicely. TortoiseSVN on windows is the way to go.
Setting up the server is a little trickier with some things to watch out for.
Let me know if you want a repository to access and try out. I’ve been setting them up as part of a hosting service.
The other great thing is the possibility of using WebDAV clients instead of svn clients. I’ve tried out autoversioning with apache 2.1 and it works with MacOS X’s Finder webdav client and Adobe’s Workgroup functions. Just need mod_dav_lock to be backported to Apache 2.0 or have 2.1 go stable.
The biggest thing to look out for is having a repository accessible by more than one protocol, eg. HTTP and SVN over SSH. This can lead to problems with the repository database being owned by the incorrect user or group. It’s easily fixed, and easy to prevent as long as you are aware of the potential problem.
The best resource that I have found for Subversion is the online edition of O’Reilly’s Version Control With Subversion. It is a comprehensive guide to using Subversion, and contains almost everything that you would like to know about its use.
If you’re interested in a issue tracking system that integrates with Subversion, be sure to have a look at Trac. It’s easy to install, nice to use, and the price is right.
I’ve been waiting for an eclipse plugin and although there is one that has been written by the subversion developers, it hasn’t been updated for a while. tigris has more info. At least TortoiseSVN is a solid solution in the meantime.
I’ve tried using rapidsvn and it’s a little flaky, I was going to try gsvn but it’s been abandoned.
I then went back to tortoiseSVN, after having been a user of TortoiseCVS for years. TortoiseSVN is the bees knees, quickly setup to work over ssh (don’t forget to install and set up pageant for passwordless use) and it ‘just works’.
Rearranging folders is now easy with svn mv and svn cp (move and copy). Just a final addition, my main machine is debian and I use a vmware windows xp pro session for all the windows stuff that comes in handy occasionally.
As for IDE integration, it hasn’t really been an issue, if your ide uses windows explorer then you get the functionality on a right click. The only wierd thing is setting up ie4desktop stuff (read the manual on why you’re not getting icons). oops.. that was a long post :-) go for it!!