2015-06-21 15:33:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Print the current source revision, if available
|
|
|
|
|
2020-04-08 15:41:55 +00:00
|
|
|
SDL_ROOT=$(dirname $0)/..
|
|
|
|
cd $SDL_ROOT
|
|
|
|
|
|
|
|
if [ -x "$(command -v hg)" ]; then
|
|
|
|
rev="$(hg parents --template 'hg-{rev}:{node|short}' 2>/dev/null)"
|
2020-04-29 15:32:08 +00:00
|
|
|
if [ $? = 0 ]; then
|
2020-04-08 15:41:55 +00:00
|
|
|
echo $rev
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -x "$(command -v p4)" ]; then
|
|
|
|
rev="$(p4 changes -m1 ./...\#have 2>/dev/null| awk '{print $2}')"
|
2020-04-29 15:32:08 +00:00
|
|
|
if [ $? = 0 ]; then
|
2020-04-08 15:41:55 +00:00
|
|
|
echo $rev
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "hg-0:baadf00d"
|
|
|
|
exit 1
|