comparison scripts/src-version.sh @ 16:84160e9a0383

scripts/src-version.sh: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 07:23:41 +0000
parents
children
comparison
equal deleted inserted replaced
15:08ecd0bd517d 16:84160e9a0383
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