Look mum revision control!

Published on August 29, 2010

Starting out

Fortunately there are some demanding people in my life who have instilled some organisational traits into me. Generally I do the filing and remain somewhat organised. Not so much with code. In a previous job I could always see the point of the proprietary revision control software used but never considered adapting it for use at home. Recently after exploring Django the size of my home projects began to increase in size to the point where a text file of notes listing my code changes by date didn't really cut the mustard. Besides it was becoming tedious to keep making copies of the code before making changes. Somewhat reluctantly I pulled on my best preppie sweater and sat down to Google "Subversion".

It didn't take long to find the Collabnet Subversion Community Install which seemed easy enough to get running:

A useful Subversion tutorial by Chris Lasher helped where starting out with Subversion but after reading how the main Django developer switched from Subversion to Mercurial, for me, considering the reason I started looking at revision control software in the first place was down to Django I figured what's good for him is good for me and installed Mercurial.

Likes

After browsing through the Mercurial online documentation making the switch from playing around with a single directory containing two test files to adding my project to a repository for real was a useful way of taking stock of how the my project is organised. Conceptually, explaining the difference between template code, media files, models and data is easy enough but actually nailing them down into a version control application helped cement the concepts. Ultimately I ended up making three separate repositories for the Django application I work since Media files are separate from Template files which is again separate from the data and models. Since each component should operate independently of each other this seemed appropriate. I've only created repositories for code that I work with rather than for the source files or addons files.

Lately after a slight struggle installing Grappelli, Mercurial has been extremely handy. I had to make changes in a number of files and Mercurial does a really nice job of immediately letting you know which files have changed without you having to remember everything:

Not to mention that it keeps track of the changes you make (hg status); enables you to revert to previous versions (hg revert); and displays the changes in the files (hg diff)... Luckily so far I've not had to revert to any particular version or repair anything just yet but I do feel a lot more confidant where using revision control software rather than taking a back up and keeping some notes in a txt file, especially where making larger changes to a project.

GUI

I've been running Mercurial on a Mac and I'm keeping a look out for a native version of TortoiseHG which is probably a good thing since it's forcing me to use to command line. On the flip side, after installing TortoiseHG at work on Windows and demonstrating Mercurial to some colleagues I can't wait until TortoiseHG is available on the Mac as it's so easy to use and adds a great visual element the the standard Windows Explorer directories where at a glance it's possible to see if files have been modified, especially where those files are shared and changed by more than one person.


0 comments


Additional comments have been disabled for this entry

An entry posted on August 29, 2010.

Categories: Blog , Open Source and OsX

Tags: mercurial , subversion and tortoisehg