Skip to content

Latest commit

 

History

History
executable file
·
25 lines (21 loc) · 478 Bytes

showrev.sh

File metadata and controls

executable file
·
25 lines (21 loc) · 478 Bytes
 
1
2
3
4
#!/bin/sh
#
# Print the current source revision, if available
Apr 8, 2020
Apr 8, 2020
5
6
7
8
9
SDL_ROOT=$(dirname $0)/..
cd $SDL_ROOT
if [ -x "$(command -v hg)" ]; then
rev="$(hg parents --template 'hg-{rev}:{node|short}' 2>/dev/null)"
Apr 29, 2020
Apr 29, 2020
10
if [ $? = 0 ]; then
Apr 8, 2020
Apr 8, 2020
11
12
13
14
15
16
17
echo $rev
exit 0
fi
fi
if [ -x "$(command -v p4)" ]; then
rev="$(p4 changes -m1 ./...\#have 2>/dev/null| awk '{print $2}')"
Apr 29, 2020
Apr 29, 2020
18
if [ $? = 0 ]; then
Apr 8, 2020
Apr 8, 2020
19
20
21
22
23
24
25
echo $rev
exit 0
fi
fi
echo "hg-0:baadf00d"
exit 1