use a more portable code to get current hg revision. se #5831
This commit is contained in:
parent
691943f73c
commit
f4e0992e9c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue