use a more portable code to get current hg revision. se #5831
This commit is contained in:
parent
691943f73c
commit
f4e0992e9c
2 changed files with 7 additions and 3 deletions
|
@ -1,7 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
gajimversion="0.13.90.1"
|
gajimversion="0.13.90.1"
|
||||||
if [ -d ".hg" ]; then
|
if [ -d ".hg" ]; then
|
||||||
hgversion="-$(hexdump -n6 -e'6/1 "%02x"' .hg/dirstate)"
|
node=$(hg tip --template "{node}")
|
||||||
|
hgversion="-${node:0:12}"
|
||||||
else
|
else
|
||||||
hgversion=""
|
hgversion=""
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -30,8 +30,11 @@ localedir = '../po'
|
||||||
version = '0.13.90.1'
|
version = '0.13.90.1'
|
||||||
import subprocess
|
import subprocess
|
||||||
try:
|
try:
|
||||||
hgversion = subprocess.Popen('hexdump -n6 -e\'6/1 "%02x"\' ../.hg/dirstate',
|
from mercurial import ui, hg
|
||||||
shell=True, stdout=subprocess.PIPE).communicate()[0]
|
from mercurial.context import hex as hex_
|
||||||
|
repo = hg.repository(ui.ui(), '..')
|
||||||
|
node = repo['tip'].node()
|
||||||
|
hgversion = hex_(node)[:12]
|
||||||
version += '-' + hgversion
|
version += '-' + hgversion
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue