setup.py
author Christian Ebert <blacktrash@gmx.net>
Tue, 15 Jun 2010 21:58:53 +0200
changeset 769 3bf3212b13bc
parent 238 e4a389eca1b9
permissions -rw-r--r--
Postpone manifest calculation in kwtemplater.overwrite We can check for file existence in the working directory (needed in case of recording) by simply using the given context and calculate the manifest only when there are in fact candidates for expansion/shrinking.

#!/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'])