# HG changeset patch # User anatoly techtonik # Date 1413802486 -10800 # Node ID a206ee74f129a33cca0377e9ab66350795c02532 # Parent 458f883b68dc0de32f92c1cd5ee3153436db505b evolve: add various version info to save time on troubleshooting diff -r 458f883b68dc -r a206ee74f129 hgext/evolve.py --- a/hgext/evolve.py Mon Nov 03 10:25:20 2014 +0000 +++ b/hgext/evolve.py Mon Oct 20 13:54:46 2014 +0300 @@ -19,6 +19,7 @@ - improves some aspect of the early implementation in Mercurial core ''' +__version__ = '5.1.0' testedwith = '3.2' buglink = 'http://bz.selenic.com/' @@ -85,7 +86,7 @@ return oldmemfilectx(*args, **kwargs) else: raise util.Abort('Your Mercurial is too old for this version of Evolve\n' - 'requires version 3.2 or above') + 'requires version %s or above' % min(testedwith.split())) # This extension contains the following code diff -r 458f883b68dc -r a206ee74f129 setup.py --- a/setup.py Mon Nov 03 10:25:20 2014 +0000 +++ b/setup.py Mon Oct 20 13:54:46 2014 +0300 @@ -2,10 +2,21 @@ # Credit to Augie Fackler from distutils.core import setup +from os.path import dirname, join + +def get_version(relpath): + '''Read version info from a file without importing it''' + for line in open(join(dirname(__file__), relpath), 'rb'): + # Decode to a fail-safe string for PY3 + # (gives unicode object in PY2) + line = line.decode('utf8') + if '__version__' in line: + if "'" in line: + return line.split("'")[1] setup( name='hg-evolve', - version='5.0.0', + version=get_version('hgext/evolve.py'), author='Pierre-Yves David', maintainer='Pierre-Yves David', maintainer_email='pierre-yves.david@ens-lyon.org',