use a more portable code to get current hg revision. se #5831

This commit is contained in:
Yann Leboulanger 2010-08-17 11:34:53 +02:00
parent 691943f73c
commit f4e0992e9c
2 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash
gajimversion="0.13.90.1"
if [ -d ".hg" ]; then
hgversion="-$(hexdump -n6 -e'6/1 "%02x"' .hg/dirstate)"
node=$(hg tip --template "{node}")
hgversion="-${node:0:12}"
else
hgversion=""
fi

View File

@ -30,8 +30,11 @@ localedir = '../po'
version = '0.13.90.1'
import subprocess
try:
hgversion = subprocess.Popen('hexdump -n6 -e\'6/1 "%02x"\' ../.hg/dirstate',
shell=True, stdout=subprocess.PIPE).communicate()[0]
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]
version += '-' + hgversion
except Exception:
pass