Skip to content
Snippets Groups Projects
Commit 5cc9594c authored by anatoly techtonik's avatar anatoly techtonik
Browse files

Add version info to hggit for "hg --version -v"

getversion() also reports dulwich version
parent 017db283
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,15 @@
For more information and instructions, see :hg:`help git`
'''
__version__ = '0.8.1'
def getversion():
"""return version with dependencies for hg --version -v"""
import dulwich
dulver = '.'.join(str(i) for i in dulwich.__version__)
return __version__ + (" (dulwich %s)" % dulver)
from bisect import insort
import os
......
......@@ -9,5 +9,15 @@
except ImportError:
extra_req = ['ordereddict>=1.1']
from os.path import dirname, join
def get_version(relpath):
root = dirname(__file__)
for line in open(join(root, relpath), 'rb'):
line = line.decode('utf-8')
if '__version__' in line:
return line.split("'")[1]
setup(
name='hg-git',
......@@ -12,6 +22,6 @@
setup(
name='hg-git',
version='0.8.1',
version=get_version('hggit/__init__.py'),
author='The hg-git Authors',
maintainer='Augie Fackler',
maintainer_email='durin42@gmail.com',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment