build-scripts/showrev.sh
author Ryan C. Gordon
Mon, 18 May 2020 15:52:51 -0400
changeset 13815 8c7bf8f29b8c
parent 13784 cd8794af675f
permissions -rwxr-xr-x
checker-buildbot.sh: Use Ninja, not GNU make, and expect scan-build in $PATH.
slouken@2982
     1
#!/bin/sh
slouken@2982
     2
#
slouken@2982
     3
# Print the current source revision, if available
slouken@2982
     4
slouken@13711
     5
SDL_ROOT=$(dirname $0)/..
slouken@13711
     6
cd $SDL_ROOT
slouken@13711
     7
slouken@13711
     8
if [ -x "$(command -v hg)" ]; then
slouken@13711
     9
    rev="$(hg parents --template 'hg-{rev}:{node|short}' 2>/dev/null)"
slouken@13784
    10
    if [ $? = 0 ]; then
slouken@13711
    11
        echo $rev
slouken@13711
    12
        exit 0
slouken@13711
    13
    fi
slouken@13711
    14
fi
slouken@13711
    15
slouken@13711
    16
if [ -x "$(command -v p4)" ]; then
slouken@13711
    17
    rev="$(p4 changes -m1 ./...\#have 2>/dev/null| awk '{print $2}')"
slouken@13784
    18
    if [ $? = 0 ]; then
slouken@13711
    19
        echo $rev
slouken@13711
    20
        exit 0
slouken@13711
    21
    fi
slouken@13711
    22
fi
slouken@13711
    23
slouken@13711
    24
echo "hg-0:baadf00d"
slouken@13711
    25
exit 1