How Mercurial brought me out of the Dark Ages

October 16, 2010 No Comments »
How Mercurial brought me out of the Dark Ages

“If you are using Subversion, stop it. Just stop. Subversion = Leeches. Mercurial and Git = Antibiotics. We have better technology now.” — Joel Spolsky

I have often admitted I am behind the times with technology. Until recently I was also actively involved as a Microsoft Ranger working with Team Foundation Server and really enjoy working with it. However even with the new ability to install TFS on Windows 7, the need for continues integration locally is sometimes overkill. TFS still suffers from issues with regard to branching, and more importantly, it’s a massive installation requiring SQL Server. I used Subversion and Cruise Control as a solution for a while, however when I cancelled my hosted servers I needed to find a way to replace my online Subversion repositories.

FogBugz

A while back I heard of the Student and Starter Edition of FogBugz and signed up right away. FogBugz is a very functional and useful bug tracking system, and I have been using it extensively to manage some private projects. Recently a new product named Kiln was introduced. Based on Mercurial it provides distributed source control integrated into the FogBugz bug tracking solution. I have never used Mercurial but knew from the various questions on Stack Overflow it is a powerful source control system and it even the Stack Overflow team moved across to the using Mercurial. Considering that it has such a strong following I decided to investigate further and was surprised to find how simple and easy using DVCS really is using Mercurial. First I spent some time reading Joel Spolsky’s Mercurial tutorial. It is a well written introduction and tutorial, but I decided I needed a more hands-on approach.

The Mercurial website provides a very simple tutorial on how to create and use the system on its home page, and I put together a very basic test. To get started I downloaded the software from the website, and created two folders on my machine. Following the simple tutorial on the site, I was able to understand how to create, clone, commit, branch and synchronise a repository in less then an hour. I was hooked. I then spent some time finding my way around Kiln, and after installing the extensions provided by Fog Creek, was up and running with all my software converted to Mercurial and Kiln 2 hours later. Even more surprisingly it turns out that CodePlex also supports Mercurial, and a quick email to CodePlex support had the repository for my Media Mogul project also converted.

There are a lot of advantages too using Mercurial for source control. Firstly a repository can exists in multiple locations at one time. A repository is simply a folder containing a collection of files. The files are added to the repository, and can be edited as normal. On each commit of the files, a change set is generated containing all the changes since the last commit. The files however are kept locally on your machine. When cloning an existing repository, a synchronisation point to the original folder is immediately created, and therefore a new branch has been created. Changes can be made to the cloned copy and once complete the change sets can be merged back into the original folder. At the same time changes can still be made to the original repository. The possibilities this offers over Subversion and TFS is extremely powerful, and the ability to synchronise to a central repository for backup purposes and still maintaining the complete change history across all the versions, makes using DVCS an easy choice.

I have been using Mercurial for the last month, and I am extremely happy with the results. Since Mercurial is cross platform, I am able to keep my code on both my MacBook, Windows virtual machine and Kiln offsite server without having to wonder when I last committed or synchronised, since all the changes are perfectly replicated across when doing a push or pull to or from the various repositories. I have been able to implement major new features on existing projects, without having to jump through hoops to merge back bug fixes done on the original code while developing the new feature. There are also some very nice GUI tools available for Mercurial, including TortoiseHG and Murky, both providing visual and simple integration into Mercurial. Lastly, did I mention it also integrates with Visual Studio 2010?

Related Posts

Leave A Response