Thursday, June 27, 2013

Version Control

I'm a developer of yea old ways and old days. Most of my work is in embedded systems that involve no OS at all, or contain  nothing more than a framework to start work from. To make things a bit more chaotic, a lot of my work also involves designing hardware as well as writing appropriate firmware for the hardware that has been designed.
My firmware workflow is more or less set, if the firmware is being written from scratch. It basically involves writing hardware test modules, then laying down the final applications's foundation and then to integrate low level code in the foundation.
Once the low level code starts living together, it boils down to writing higher up interfaces to correctly implement the required functionality. Now, when I am writing so much of code (smallest project being a few hundred lines of assembly code, largest one being few thousand lines of C code) there was always a need of keeping a track of what I have done and when code broke, be able to revert back to the older working version.
In my initiate days (like 15 years ago), I had set up a simple system for backing up my code and maintaining a proper track of changes made etc. Since I was a lone developer on every one of my project modules, this way worked very well, and I never felt real need to start learning any of the fancier VCS implementations like SVN or CVS etc.
However, for the last few years or so, my projects are becoming bigger and there is now need to follow/track/revert/etc. changes made to my hardware designs as well as to my firmware. And to top it off, I have learnt to program in Python and WxPython and now some of my works also involve GUI/Non-GUI applications written in Python. And of course my simple system started showing cracks. Some of these cracks were simply my laziness (:P) and some of them were simply because I am not a thinker with lot of foresight (Hmmmm, maybe I shouldn't admit this in writing!)

So I finally put up SVN (TortoiseSVN, on Windows, because most of my other, software was on Windows). Unfortunately, probably because of my lack of clarity of concepts, I failed to make SVN fit to my workflow! That is when I came across an article by Joel Spolsky (
introducing Mercurial.
And in two days time, I was able to wrap almost all (95%) of my workflow in Mercurial. And on top of that I found out that I was able to wrap the remaining workflow (5%) around Mercurial. Today I am a happy user of the excellent tool. I use TortoiseHg ( on Windows 7, and am able to track/revert/follow everything that I do. Including my hardware designs, todos and code!
This is not going to be a Hg tutorial, because there are more than few resources that teach Hg to even a log! The resources that were useful to me were:

1 comment:

  1. I have a question even though I haven't used this tool! Is this tool providing the reusability of code while compiling and working on some other project? So I can keep my base layer common and go on adding different applications?
    Sorry if it is a really absurd question!