Wednesday, November 17, 2010

Introduction to Mercurial

Hands up if you've been happily using Subversion for many years when some crazy dude comes in and makes you use Mercurial. Anyone? I'm sure it can't just be me.

Anyway, Mercurial is very different to Subversion. I recently found out that Subversion causes brain damage in developers which makes it very difficult to understand how Mercurial works: you try to do things in Mercurial the way you do in Subversion, it doesn't work and you go "ARGH" and rm -rf your repository and start again (being more careful this time).

Well, rm -rf no longer my friends. Joel Spolsky has written a rather excellent introduction to Mercurial which I would recommend you all read if you need to use Mercurial or you're sick of merging in Subversion. I especially appreciated the first page -- Mercurial for Subversion users -- basically a pep talk telling you not to give up on Mercurial just because it's not Subversion.

My take on Mercurial? As far as I can tell, its view of the world is identical to the one I end up drawing when I try to map out how I think Subversion should be working. Instead of representing your codebase as a series of snapshots in time, it represents the changes you make to it. This makes it very easy to merge different branches together, which is pretty much the most painful thing you have to do in Subversion.

Joel explains it very well. Please go and read his tutorial now, if only so you're not surprised when some crazy guy makes you use it.

2 comments:

Matt the Big said...

That was highly informative.

Jason said...
This comment has been removed by a blog administrator.