diff --git a/oxtimelines/__init__.py b/oxtimelines/__init__.py index 639908e..3a2ea29 100644 --- a/oxtimelines/__init__.py +++ b/oxtimelines/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 # GPL 2008-2014 -__version__ = 'bzr' +__version__ = 'git' from glob import glob diff --git a/setup.py b/setup.py index dba95f8..413257f 100644 --- a/setup.py +++ b/setup.py @@ -6,19 +6,15 @@ try: except: from distutils.core import setup -def get_bzr_version(): - import os - info = os.path.join(os.path.dirname(__file__), '.bzr/branch/last-revision') - if os.path.exists(info): - f = open(info) - rev = int(f.read().split()[0]) - f.close() - if rev: - return u'%s' % rev +def get_version(): + import subprocess + rev = subprocess.check_output(['git', 'rev-list', 'HEAD', '--count']).strip() + if rev: + return u'0.%s' % rev return u'unknown' setup(name='oxtimelines', - version='0.%s' % get_bzr_version() , + version='0.%s' % get_version() , scripts=[ 'bin/oxtimelines', ],