summaryrefslogtreecommitdiff
path: root/projects
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-07-02 16:34:15 +0000
committermichi_cc <michi_cc@openttd.org>2010-07-02 16:34:15 +0000
commit848aa4472f2d80a4833a2e3051f50de9db8380e6 (patch)
treef22192fd2f9fb964777596b901508e501fc62a7b /projects
parent34f32cbbf47b2cb332b51342c429da93856281d7 (diff)
downloadopenttd-848aa4472f2d80a4833a2e3051f50de9db8380e6.tar.xz
(svn r20050) -Add: git revision detection for custom git-svn clones.
Diffstat (limited to 'projects')
-rwxr-xr-xprojects/determineversion.vbs11
1 files changed, 11 insertions, 0 deletions
diff --git a/projects/determineversion.vbs b/projects/determineversion.vbs
index 9d9f21f6e..338b3d2b0 100755
--- a/projects/determineversion.vbs
+++ b/projects/determineversion.vbs
@@ -203,6 +203,17 @@ Function DetermineSVNVersion()
revision = Mid(oExec.StdOut.ReadLine(), 7)
revision = Mid(revision, 1, InStr(revision, ")") - 1)
End If ' Err.Number = 0
+ If revision = "" Then
+ ' No revision? Maybe it is a custom git-svn clone
+ ' Reset error number as WshShell.Exec will not do that on success
+ Err.Clear
+ Set oExec = WshShell.Exec("git log --pretty=format:%b --grep=" & Chr(34) & "git-svn-id:.*@[0-9]*" & Chr(34) & " -1 ../src")
+ If Err.Number = 0 Then
+ revision = oExec.StdOut.ReadLine()
+ revision = Mid(revision, InStr(revision, "@") + 1)
+ revision = Mid(revision, 1, InStr(revision, " ") - 1)
+ End If ' Err.Number = 0
+ End If ' revision = ""
End If ' Err.Number = 0
End If ' oExec.ExitCode = 0
End If ' Err.Number = 0