setup.py
author Christian Ebert <blacktrash@gmx.net>
Tue, 16 Mar 2010 22:28:58 +0100
changeset 702 c118a9c5ca24
parent 238 e4a389eca1b9
permissions -rw-r--r--
Make kwdemo less verbose 1) Set the branchname always silently with dirstate.setbranch(). We create a branch so that testing the {branches} template does not come up empty. But kwdemo is hardly the place to inform the user by inference why {branches} is empty on the default branch. "demobranch" is ascii and cannot be changed, so using the internal command instead of commands.branch() is safe. 2) Do not show full path to temporary directory (distracting long lines on Mac OS X). 3) No special debug output. Output only related to keyword, no internals like unsetting of commit hooks etc.

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