What does Build: xx means at urevs.com?

As it is still in development, I’ve decided to show progress I’m making during the development.

Build [number] is simply revision control system commit number.

I use Mercurial control system. I do it for few simple reasons:

  • it is intuitive and very simple to use
  • it is distributed revision control system
  • Mercurial respects repository nesting
  • nice integration with Nautilus as TortoiseHG (my howto in Polish)
  • it is written in Python. Yay! :)

What number is it?

nme@charr urevs $ hg log -l 1
changeset:   46:07595fb8f9b9
tag:         tip
user:        Marcin Woloszyn <mw@nme.pl>
date:        Mon Jul 19 20:32:45 2010 +0200
summary:     switched to english, included google analytics code, turned robots.txt on

Naturally, I do not retype it manually everytime it changes.

It is an automated task – Makefile checks if revision has changed, and if it did – new version.py is generated by tools/hg_version helper script:

#!/bin/bash
rm version.py >/dev/null 2>&1 || true
cat >version.py <<EOF
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT.

VERSION="`hg log -l 1 | head -n 1 | awk '{print substr($2,0,index($2,":"))}'`"
EOF

Works like a charm :)

Leave a Reply