Commits

Lars Yencken  committed b81f542

Adds mercurial short version number to package version information.

  • Participants
  • Parent commits cf48ce5

Comments (0)

Files changed (1)

 """
 
 from distutils.core import setup
+import os
 from os import path
 
+def get_mercurial_id():
+    revision = None
+    # Is mercurial installed?
+    if os.system('which hg >/dev/null 2>&1') == 0:
+        revision = os.popen('hg id -n 2>/dev/null').read().strip()
+
+    return revision or 'unknown'
+
 setup(
         name='checksum',
-        version='0.1a',
+        version='0.1.%s' % get_mercurial_id(),
         description='Django checksum app',
         author='Lars Yencken',
         author_email='lljy@csse.unimelb.edu.au',