Skip to content
Snippets Groups Projects
Commit f4e0992e authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

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

parent 691943f7
No related branches found
No related tags found
No related merge requests found
#!/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 @@
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment