diff options
author | michi_cc <michi_cc@openttd.org> | 2010-07-02 16:34:15 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2010-07-02 16:34:15 +0000 |
commit | 848aa4472f2d80a4833a2e3051f50de9db8380e6 (patch) | |
tree | f22192fd2f9fb964777596b901508e501fc62a7b /projects | |
parent | 34f32cbbf47b2cb332b51342c429da93856281d7 (diff) | |
download | openttd-848aa4472f2d80a4833a2e3051f50de9db8380e6.tar.xz |
(svn r20050) -Add: git revision detection for custom git-svn clones.
Diffstat (limited to 'projects')
-rwxr-xr-x | projects/determineversion.vbs | 11 |
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 |