I want to get the 'BASE' number by 'svn info' command in Windows batch file as the following batch script:
svn update
for /f "tokens=2" %%i in ('svn info -rBASE^|find "Revision"') do (
@echo %%i
set svn_rev=%%i
)
But I always got the 'HEAD' number of my svn managed project code. So I tried the command directly in console:
>svn info -rBASE
Path: AliceAgent4.0b5856
URL: https://192.168.1.116:3443/svn/ProjectAliceVR/AliceOperationAgent/branches/AliceAgent4.0b5856
Relative URL: ^/AliceOperationAgent/branches/AliceAgent4.0b5856
Repository Root: https://192.168.1.116:3443/svn/ProjectAliceVR
Repository UUID: 794566ed1-6640e-7746-860d-66136dce9e99a
Revision: 5936
Node Kind: directory
Last Changed Author: yuanhui.he
Last Changed Rev: 5933
Last Changed Date: 2019-03-21 15:10:43 +0800 (周四, 21 3月 2019)
The Revision
is 5936
, other than 5933
. Then, I tried the HEAD
parameter of svn
, it output the same result with BASE
:
> svn info -rHEAD
Path: AliceAgent4.0b5856
URL: https://192.168.1.116:3443/svn/ProjectAliceVR/AliceOperationAgent/branches/AliceAgent4.0b5856
Relative URL: ^/AliceOperationAgent/branches/AliceAgent4.0b5856
Repository Root: https://192.168.1.116:3443/svn/ProjectAliceVR
Repository UUID: 794566ed1-6640e-7746-860d-66136dce9e99a
Revision: 5936
Node Kind: directory
Last Changed Author: yuanhui.he
Last Changed Rev: 5933
Last Changed Date: 2019-03-21 15:10:43 +0800 (周四, 21 3月 2019)
EDIT:
I have tried 'svn info -rBASE^|find "Last Changed Rev:"'
but it only got a Changed
string in the batch script.
So, how can I get the number 5933
in the Last Changed Rev: 5933
line?