« Code must be commented | Main | IDEA: space invaders »

Migrating to Subversion II

A few months back I mentioned I was migrating some projects to Subversion. I've been using it regularly, if not day in day out. I'm of the mind that Subversion is light years ahead of either VSS or CVS, the two tools it will inevitably be compared with. There's no doubt - transitioning fully to Subversion is the way to go.

I'll be blogging more about Subversion, for now I want to mention some of the upfront differences between it and CVS/VSS.

There are some 'conceptual' hurdles anyone moving from CVS (or VSS) might have to overcome:

  • tagging/labelling is very different now
  • the entire repository is versioned on checkin
  • you can move files safely and easily

The way Subversion works with tags and branches is simpler than either VSS and CVS, but different enough to be confusing. To tag something in Subversion you perform a copy command, ie you physically copy it - a tag is not a marker on some conceptual timeline that the VCS will recompute for you, it's a named physical snapshot. To turn a tag into a branch you commit to the tag - now you're managing two codebases. To remove a tag or a branch you delete it. One advantage of this is that you can examine the labelled history of repository with a web browser instead of visually examining the output of a status or history command - this is since Subversion can make all files visible via a web server. Another is explicitness - it's obvious what's going on in the repository especially if the repository is degrading into a branch-fest - something that can happen without anyone really noticing in CVS or VSS, until the day comes to merge everything together. The notion of branching off branches, something that in reality is almost always a bad idea, but very common in less well organized code-bases, feels in Subversion well... dead wrong, as opposed to being intellectually improper - I take this as a very good sign.

When you commit some files in CVS you commit each file separately not as a transactional unit; modelling a commit as a unit of work is something you have to manage manually. The overhead of doing this in CVS is high enough that I'd never bother and I don't know anyone who does. Subversion is utterly different - the entire repository gets reversioned using a simple incrementing number. What's unsual about this is that most people use a single CVS repository to host multiple projects, often architecturally and conceptually unrelated. If you did this in Subversion you'd find your Java testing framework being versioned along with your ASP.NET wiki, which will seem odd. There isn't a simple way around this; again Subversion is being explicit about code management. You will have to think about how your code bases are conceptually and physically intertwined along with embarking on setting up repositories - but you're doing that already, right? [Antipattern hint; CVSROOT/modules is filled with filters and cross module joins]

Perhaps the most appealing thing about having atomic commits and global versioning is that it makes moving files around trivial. All history is kept. Not being able to move files around is something most Java programmers and ex-VSS weenies justifiably dislike about CVS. Best of all is that Subversion won't silently remove files from an old version (remember tags and branches are copies, not computations). Anyone who's ever been unable to reconsitute a historical version from VSS because it silently destroyed the version will appreciate this. The more subtle point is that it we aren't forced to agonize about getting the repository structure right first time; we can always change it later. Personally I've caught myself in the past putting off reorganizing a Java package structure or a heavy refactoring because I knew it involved fooling around with the CVS repository or that it might possibly destroy an old version in VSS. Any agile team using VSS or CVS which feels the repository is getting in the way should look to get onto Subversion.

[system of a down: prison song]

September 26, 2003 08:53 PM


Trackback Pings

TrackBack URL for this entry:

Listed below are links to weblogs that reference Migrating to Subversion II:

» Migrating to Subversion from Josh's Hacking Log
Bill gives an inside account of moving some projects from using CVS to using Subversion. This is great! Lots of... [Read More]

Tracked on September 27, 2003 08:04 AM

» Bill de hra on Subversion from Blue Sky On Mars
Bill de hra wrote about his experiences moving to Subversion. I've been following Subversion for a while, but haven't made the switch from CVS. It's interesting to read about some of the differences in style of use.... [Read More]

Tracked on September 29, 2003 01:36 PM