From 9deffcd325ed1b35c23b2f3724885484c0a1800d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Feb 2021 08:50:16 -0800 Subject: [PATCH] Updated the revision header with git revision --- build-scripts/showrev.sh | 8 ++++---- build-scripts/updaterev.sh | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build-scripts/showrev.sh b/build-scripts/showrev.sh index d3b131a14..71be3fea9 100755 --- a/build-scripts/showrev.sh +++ b/build-scripts/showrev.sh @@ -5,9 +5,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)" - if [ $? = 0 ]; then +if [ -x "$(command -v git)" ]; then + rev=$(echo "$(git remote get-url origin 2>/dev/null)@$(git rev-list HEAD~.. 2>/dev/null)") + if [ "$rev" != "@" ]; then echo $rev exit 0 fi @@ -21,5 +21,5 @@ if [ -x "$(command -v p4)" ]; then fi fi -echo "hg-0:baadf00d" +echo "" exit 1 diff --git a/build-scripts/updaterev.sh b/build-scripts/updaterev.sh index 485d04580..eb20e8069 100755 --- a/build-scripts/updaterev.sh +++ b/build-scripts/updaterev.sh @@ -8,10 +8,9 @@ srcdir=.. header=$outdir/include/SDL_revision.h rev=`sh showrev.sh 2>/dev/null` -if [ "$rev" != "" -a "$rev" != "hg-0:baadf00d" ]; then - revnum=`echo $rev | sed 's,hg-\([0-9]*\).*,\1,'` +if [ "$rev" != "" ]; then echo "#define SDL_REVISION \"$rev\"" >"$header.new" - echo "#define SDL_REVISION_NUMBER $revnum" >>"$header.new" + echo "#define SDL_REVISION_NUMBER 0" >>"$header.new" if diff $header $header.new >/dev/null 2>&1; then rm "$header.new" else