setup.py
author Martin Geisler <mg@daimi.au.dk>
Sat, 03 Jan 2009 17:15:21 +0100
branchstable
changeset 520 e2fc27c86733
parent 238 e4a389eca1b9
permissions -rw-r--r--
mq: lowercase output This extension produces quite a lot of informational messages during its normal operation and it is hard to say which strings can be changed and which cannot. [ original upstream description ]

#!/usr/bin/env python
# $Id$

from distutils.core import setup
import os, time

# specify version, Mercurial version otherwise
version = ''

unknown_version = 'unknown'

def getversion():
    global version, unknown_version
    if not version and os.path.isdir('.hg'):
        p = os.popen('hg --quiet identify 2> %s' % os.devnull)
        ident = p.read()[:-1]
        if not p.close() and ident:
            if ident[-1] != '+':
                version = ident
            else:
                version = ident[:-1]
                version += time.strftime('+%Y%m%d')
    return version or unknown_version

setup(name='hgkw',
      version=getversion(),
      description='Mercurial keyword extension (standalone)',
      author='Christian Ebert',
      author_email='blacktrash@gmx.net',
      url='http://www.blacktrash.org/hg/hgkeyword/',
      license='GNU GPL',
      packages=['hgkw'])