# HG changeset patch # User Daniele Nicolodi # Date 1322642489 -3600 # Node ID 5c5f6d93d9d44d9f14a2af0b9b42fa29e651c9d1 # Parent 32fda28194d648da63c57027e32bf5c41cb5c59c Add hg revision id to version string for dev builds. diff -r 32fda28194d6 -r 5c5f6d93d9d4 setup.py --- a/setup.py Thu Nov 24 18:24:53 2011 +0100 +++ b/setup.py Wed Nov 30 09:41:29 2011 +0100 @@ -1,4 +1,5 @@ from setuptools import setup, find_packages +import os.path, subprocess version = '0.6dev' @@ -23,6 +24,16 @@ requires.append('ordereddict') +if version.endswith('dev') and os.path.isdir('.hg'): + # add hg revision id to version string + p = subprocess.Popen(['hg', 'id', '--id'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + if not p.returncode: + rev = out.strip().replace('+', '') + version += '-' + rev + + setup(name='ltpdarepo', version=version, keywords='',