Commit 5b4469d8 authored by Kurt Smith's avatar Kurt Smith

use 'hg identify' to generate .hgrev file

parent b2d2e9ce
...@@ -6,10 +6,9 @@ import sys ...@@ -6,10 +6,9 @@ import sys
if 'sdist' in sys.argv and sys.platform != "win32" and sys.version_info >= (2,4): if 'sdist' in sys.argv and sys.platform != "win32" and sys.version_info >= (2,4):
# Record the current revision in .hgrev # Record the current revision in .hgrev
import subprocess # os.popen is cleaner but deprecated import subprocess # os.popen is cleaner but deprecated
changset = subprocess.Popen("hg log --rev tip | grep changeset", changeset = subprocess.Popen("hg identify --id --rev tip".split(),
shell=True,
stdout=subprocess.PIPE).stdout.read() stdout=subprocess.PIPE).stdout.read()
rev = changset.decode('ISO-8859-1').split(':')[-1].strip() rev = changeset.decode('ISO-8859-1').strip()
hgrev = open('.hgrev', 'w') hgrev = open('.hgrev', 'w')
hgrev.write(rev) hgrev.write(rev)
hgrev.close() hgrev.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment