@@ -78,24 +78,26 @@ if [ -d "$ROOT_DIR/.svn" ]; then
fi
# Find the revision like: rXXXXM-branch
BRANCH=`LC_ALL=C svn info "$SRC_DIR" | "$AWK" '/^URL:.*branches/ { split($2, a, "/"); for(i in a) if (a[i]=="branches") { print a[i+1]; break } }'`
TAG=`LC_ALL=C svn info "$SRC_DIR" | "$AWK" '/^URL:.*tags/ { split($2, a, "/"); for(i in a) if (a[i]=="tags") { print a[i+1]; break } }'`
REV_NR=`LC_ALL=C svn info "$SRC_DIR" | "$AWK" '/^Last Changed Rev:/ { print $4 }'`
if [ -n "$TAG" ]; then
REV=$TAG
else
REV="r$REV_NR"
elif [ -d "$ROOT_DIR/.git" ]; then
# We are a git checkout
# Refresh the index to make sure file stat info is in sync, then look for modifications
git update-index --refresh >/dev/null
if [ -n "`git diff-index HEAD \"$SRC_DIR\"`" ]; then
MODIFIED="2"
HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`
REV="g`echo $HASH | cut -c1-8`"
BRANCH=`git branch|grep '[*]' | sed 's@\* @@;s@^master$@@'`
REV_NR=`LC_ALL=C git log --pretty=format:%s "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
elif [ -d "$ROOT_DIR/.hg" ]; then
# We are a hg checkout
if [ -n "`hg status \"$SRC_DIR\" | grep -v '^?'`" ]; then
@@ -162,24 +162,32 @@ Function DetermineSVNVersion()
Else ' version <> "norev000"
' svn detection failed, reset error and try git
Err.Clear
Set oExec = WshShell.Exec("git rev-parse --verify HEAD")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
Loop
If oExec.ExitCode = 0 Then
hash = oExec.StdOut.ReadLine()
version = "g" & Mid(hash, 1, 8)
' Make sure index is in sync with disk
Set oExec = WshShell.Exec("git update-index --refresh")
WScript.Sleep 10
End If
Set oExec = WshShell.Exec("git diff-index --exit-code --quiet HEAD ../src")
If oExec.ExitCode = 1 Then
modified = 2
End If ' oExec.ExitCode = 1
Set oExec = WshShell.Exec("git symbolic-ref HEAD")
Status change: