My life was saved yesterday.
Less dramatically, a piece of software made my life better whereas, without it, life would have been worse.
Let’s give a bit of context first though: I’ve a very basic form of regression testing for Firtree (reflecting its somewhat volatile nature) which consists of a number of ‘example’ python scripts which exercise Firtree’s features. Each script also prints out the allocated object count at program exit which, if non-zero, indicates something has fecked up in my reference counting, either inside Firtree itself or in the Python bindings.
Usually, being a good little software engineer, after writing a feature, but before committing, I run these scripts confirming they still look right and this reference count is zero. Yesterday I went a bit mad and added a ton of features and an associated ton of commits. As is virtually guaranteed when you behave so recklessly, when I did run the scripts everything looked screwed up and memory leaked like a sieve. This prompted one of the worst things you could hear when, for example, you are sitting in the passenger seat of a moving car: a single, sharp, under the breath uttering of the word ’sh*t’.
Fortunately I had used Firtree as a test-bed for developing with Bazaar, a decision I am now very glad of. Suddenly I had the coding equivalent of a TARDIS and an infinite number of universes to play with. I branched off from the last ‘good’ version of Firtree and gently rolled forward in time until the naughty patch was revealed. Then, in true time-traveller style, I made a change in the past but then let the future merge in. Painless in the extreme with bazaar. Finally we reached the ‘alternate 1985′ where, far from being the apocalyptic vision I had created, all was well and no memory leaked (that I could detect).
I am far from groking Bazaar in any meaningful way (as anyone who cares to notice the fsck-ups in the Firtree tree will attest) but already I have experienced a complex branch and step-by-step merge which would have been incredibly painful with other tools.
Oh, by the way, feel free to s/Bazaar/$MY_VCS/. This is more a post of how rocking modern VCSs are, not how Bazaar is necessarily the best.
Update: An example of the process is available on my website. I’m not recommending this as the ‘Right Way’ but it worked for me.