写一个获取SVN ID 的 .bat
时间: 2024-05-19 13:16:07 浏览: 138
文件:
@echo off
setlocal
set SVN_URL=http://svn.example.com/trunk
set SVN_USERNAME=username
set SVN_PASSWORD=password
for /f "tokens=2 delims=: " %%a in ('svn info %SVN_URL% --username %SVN_USERNAME% --password %SVN_PASSWORD% ^| findstr /c:"Revision: "') do set SVN_REVISION=%%a
echo SVN revision number: %SVN_REVISION%
endlocal
pause
请注意,你需要将SVN_URL、SVN_USERNAME和SVN_PASSWORD替换为你自己的SVN仓库URL、用户名和密码。此外,你还需要安装SVN客户端,并将其添加到环境变量中,以便在命令提示符中运行svn命令。
相关问题
写一个获取SVN commit ID 的 .bat
@echo off
setlocal
set SVN_PATH=C:\Program Files\TortoiseSVN\bin\svn.exe
set REPO_URL=https://svn.example.com/svn/myproject/trunk
for /f "tokens=2" %%a in ('%SVN_PATH% info %REPO_URL% ^| find "Revision"') do (
set REVISION=%%a
)
echo The current SVN commit ID is %REVISION%.
endlocal
pause>nul
阅读全文