Posts Tagged Mercurial
One of the challenges that programmers face when making changes to their codebase is not breaking the existing code. Many programmers will use an incremental test process where changes are made in small steps and tested at each change to make sure that the program still works as expected.
As programs grow larger and more complex it becomes more and more likely that changes made now may have a negative impact on other areas that are not immediately apparent, or that you may miss including a new test case into your testing process, allowing the impact to go undiscovered until a later date.
At other times you may be exploring a new approach and realise that it is not going to achieve what you wanted therefore you need to go back to an earlier version and pursue a different approach.
This becomes even more complex when more than one programmer is working on a project. How do you make sure that if each person is working on a different, or even the same, area of the program that all the changes get made, that they do not conflict with each other, and that everyone has the current working code to work with?
This is where revision control comes in.
The basic idea is to have a system that tracks changes to the project code, and sometimes other files, so that you can efficiently monitor the codebase, as well as share and integrate code from all of the programmers working on the project. Most work via a central code repository that you ‘check’ code in and out of, and the repository manages different branches of code so that changes can be undone, merged, revised, ‘forked’ (creating a new branch seperate from other code), etc. For most of the currently available systems the repository is stored on a web server (can be local, intranet or internet) for easy sharing and administration.
In the past I’ve used Microsoft’s Visual SourceSafe (which used to be integrated with Visual Studio 6), and dabbled with Subversion (SVN) when playing with other people’s code, but as I am a lone programmer I thought that SVN might be a bit over-the-top for my needs, so I had a look around for a lightweight local repository solution.
I came across Mercurial, a free distributed source control management tool, and went looking for a Windows shell, which lead me to TortoiseHg, which provides an all-in-one solution of a shell and toolbox for Mercurial.
Installation and set up are quick and easy, it provides all of the functionality that you’d expect from a revision system, and it is amazingly easy to use. It can be used by one or many programmers, and with a local or remote repository stored as a folder or on a web server. Branching and merging are simple to do, and the documentation for both TortoiseHg and Mercurial present basic tutorials to in-depth descriptions of the software.
If you’re embarking on any large coding projects I’d recommend giving TortoiseHg a look.