comparison scripts/src-version.sh @ 139:148776c3f4c9

scripts/src-version.sh: brought over from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 06 Feb 2019 21:03:09 +0000
parents
children
comparison
equal deleted inserted replaced
138:f8fb2995eb3f 139:148776c3f4c9
1 #!/bin/sh
2
3 tmpfile=/tmp/fc_hg_id$$
4
5 hg id -in > $tmpfile 2> /dev/null
6 if [ $? != 0 ]
7 then
8 rm -f $tmpfile
9 echo unknown
10 exit 0
11 fi
12
13 read global local < $tmpfile
14 rm -f $tmpfile
15
16 global_noplus=`echo $global | tr -d +`
17 local_noplus=`echo $local | tr -d +`
18
19 if [ "$global" = "$global_noplus" -a "$local" = "$local_noplus" ]
20 then
21 dirty=
22 else
23 dirty=-dirty
24 fi
25
26 echo $local_noplus:$global_noplus$dirty