Subversion to Mercurial

Posted by: on Aug 17, 2011 in Blog | No Comments

Source control is an important tool of the modern software development process. Developers use it to manage source code. When two or more developers are working on same project then these tools help in identifying the modifications made by team members and merge them properly. It keeps track of all prior versions of project files, allowing developers to move backward or forward in their code to determine when and where bugs were introduced.

Initially, we were using Subversion with Tortoise SVN client for source control. Subversion works by maintaining a central repository, hosted on a server, which contains project files. The team members make local copies of that repository on their personal computers in a process called Checkout. Each person has full control over their local copy and makes changes and copy back to repository in a process called Commit. Other people can then see these changes when they update their local copy. But there were some complications while using Subversion. The merging and branching of code is painful. Sometime back we came to know about a source control tool called Mercurial and we decided to give it a try. And mercurial proved to be much better than our earlier source control.

In Mercurial, every developer has his own repository on his own computer. Thus, he can commit code on his private repository whenever he wants. When the developer feels the code is ready, he can push (save) it to the central repository (server). The other project team members can then pull (retrieve) the code from the repository.

Subversion and Mercurial work differently. Mercurial is distributed whereas Subversion is centralized source control. Distributed source control helps to make branching easy. Thus, in Mercurial merging and branching the code is comparatively efficient. In terms of speed and repository size Mercurial is considered to be the best. It is fast with both additions and modifications, and keeps repository growth under control at the same time.

We came across a great and very interesting tutorial of Mercurial at – hginit.com, its first chapter is targeted for existing Subversion users. There are many great hosting options available for Mercurial. Kiln is one such great service, Bitbucket is another great service, specially helpful if you have a small team or working on an open-source project as you can use their services for free in both the cases.

Looking at the advantages we opted for Mercurial. Thus switching from our Subversion to Mercurial was tedious job. But when we realized the importance of Mercurial, we read the tutorial of it and made ourselves familiar with it. Our difficulties were resolved and we are now satisfied with our new source control Mercurial.

I would like to know which Source-Control tool you use and why? Please leave your answers in comments.