build-scripts/showrev.sh
changeset 13711 a375181874ce
parent 10420 0d91817f35e9
child 13784 cd8794af675f
equal deleted inserted replaced
13710:a1a6885cff94 13711:a375181874ce
     1 #!/bin/sh
     1 #!/bin/sh
     2 #
     2 #
     3 # Print the current source revision, if available
     3 # Print the current source revision, if available
     4 
     4 
     5 hg parents --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1)
     5 SDL_ROOT=$(dirname $0)/..
       
     6 cd $SDL_ROOT
       
     7 
       
     8 if [ -x "$(command -v hg)" ]; then
       
     9     rev="$(hg parents --template 'hg-{rev}:{node|short}' 2>/dev/null)"
       
    10     if [ "$?" == 0 ]; then
       
    11         echo $rev
       
    12         exit 0
       
    13     fi
       
    14 fi
       
    15 
       
    16 if [ -x "$(command -v p4)" ]; then
       
    17     rev="$(p4 changes -m1 ./...\#have 2>/dev/null| awk '{print $2}')"
       
    18     if [ "$?" == 0 ]; then
       
    19         echo $rev
       
    20         exit 0
       
    21     fi
       
    22 fi
       
    23 
       
    24 echo "hg-0:baadf00d"
       
    25 exit 1