mercurial python module is not installed in site-packages under windows. use hg binary instead to get current revision

This commit is contained in:
Yann Leboulanger 2010-08-17 11:55:58 +02:00
parent f4e0992e9c
commit 8af6bd2aae
1 changed files with 3 additions and 5 deletions

View File

@ -30,11 +30,9 @@ localedir = '../po'
version = '0.13.90.1'
import subprocess
try:
from mercurial import ui, hg
from mercurial.context import hex as hex_
repo = hg.repository(ui.ui(), '..')
node = repo['tip'].node()
hgversion = hex_(node)[:12]
node = subprocess.Popen('hg tip --template {node}', shell=True,
stdout=subprocess.PIPE).communicate()[0]
hgversion = node[:12]
version += '-' + hgversion
except Exception:
pass