1@echo off
2
3:: Some SVN clients can use localized messages (e.g. SlikSVN), force English
4set LC_ALL=C
5set SVN_REV=
6
7for /f "tokens=2" %%i in ('svn info ^| find "Revision:"') do set SVN_REV=%%i
8
9:: Set to UNKNOWN if no svn or working copy
10if "%SVN_REV%"=="" (
11    for /f %%i in ('git rev-list --count HEAD') do set SVN_REV=%%i
12)
13if "%SVN_REV%"=="" (
14  set SVN_REV=UNKNOWN
15  echo Unknown SVN revision. SVN missing in PATH or not a working copy.
16)
17echo SVN Revision: %SVN_REV%
18echo.
19
20echo #define SVN_REVISION "%SVN_REV%">src\svn_revision.h
21
22set SVN_REV=
23