Permalink
Browse files

use 'hg identify' to generate .hgrev file

  • Loading branch information...
1 parent b2d2e9c commit 5b4469d8e6a051337a2383278252cef865dd444f @kwmsmith kwmsmith committed Jul 29, 2010
Showing with 3 additions and 4 deletions.
  1. +3 −4 setup.py
View
@@ -6,10 +6,9 @@
if 'sdist' in sys.argv and sys.platform != "win32" and sys.version_info >= (2,4):
# Record the current revision in .hgrev
import subprocess # os.popen is cleaner but deprecated
- changset = subprocess.Popen("hg log --rev tip | grep changeset",
- shell=True,
- stdout=subprocess.PIPE).stdout.read()
- rev = changset.decode('ISO-8859-1').split(':')[-1].strip()
+ changeset = subprocess.Popen("hg identify --id --rev tip".split(),
+ stdout=subprocess.PIPE).stdout.read()
+ rev = changeset.decode('ISO-8859-1').strip()
hgrev = open('.hgrev', 'w')
hgrev.write(rev)
hgrev.close()

0 comments on commit 5b4469d

Please sign in to comment.