How do I get a SVN revision number of a remote repository in a windows batch file ? I want to check for a condition when the user enters blank i have to get HEAD revision.
I'm using the following snippet to get the revision number. Although the for loop returns all the necessary information w.r.t remote SVN server location including the revision number. Still the batch file throws The system cannot find the file specified and the variable %SVN_VERSION% still remains empty.
In the below mentioned code, the %SVN_PATH% points to the remote server URL
set /p "SVN_VERSION=Please specify the SVN Revision number. For HEAD revision press Enter"
if "%SVN_VERSION%" =="" (
for /f "delims=: tokens=1,2" %%a in ('svn info %SVN_PATH%') do (
if "%%a"=="Revision:" (
set /a SVN_VERSION=%%b
)
)
)
Thanks