summaryrefslogtreecommitdiff
path: root/getrev.cmd
blob: 3fa8029f745ef327e91170bd95f01a9e2e9e0696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@echo off

:: Some SVN clients can use localized messages (e.g. SlikSVN), force English
set LC_ALL=C

:: Undefine for multiple runs in the same command prompt session
set Revision=
for /f "tokens=2" %%i in ('svn info ^| find "Revision: "') do set Revision=%%i

:: Set to UNKNOWN if no svn or working copy
if "%REVISION%"=="" (
  set REVISION=UNKNOWN
)

if "%Revision%"=="UNKNOWN" (
echo Unknown SVN revision. SVN missing in PATH or not a working copy.
) else (
echo SVN Revision: %Revision%
)
echo.

echo #define SVN_REVISION "SVN-r%REVISION%">src\svn_revision.h