AutoBuild.bat
@echo off
echo Setting the directory.....
set LocalPath="C:\Appli.Net\CPAMEMO52"
set SVNPath="svn://servername/MT5_2/trunk/"
echo Getting the latest source code
"C:\Program Files\TortoiseSVN\bin\svn.exe" checkout %SVNPath%/"CPA memotech Suite" %LocalPath%\CPA52
echo Getting the latest SQL
"C:\Program Files\TortoiseSVN\bin\svn.exe" checkout %SVNPath%/Sql %LocalPath%\CPA52SQL
echo Getting the latest Templates
"C:\Program Files\TortoiseSVN\bin\svn.exe" checkout %SVNPath%/Templates %LocalPath%\CPA52Templates
echo Starting Build...
"C:\WINDOWS\Microsoft.NET\Framework\v3.5\Msbuild.exe" "C:\Appli.Net\CPAMEMO52\CPA52\CPA memotech Suite.sln"
pause我每天都使用Autobuild.bat文件,获取文件并构建应用程序。
但问题是,如果本地文件修订号SVN存储库修订号不同,那么它将替换文件,而不是合并或离开。
发布于 2012-11-07 13:25:30
@echo off
echo Setting the directory.....
set LocalPath="D:\Appli.Net\5.2"
set SVNPath="svn://servername/MT5_2/trunk/"
(dir /b /a "%LocalPath%" | findstr . ) > nul && (echo Getting the latest source code
"C:\Program Files\TortoiseSVN\bin\svn.exe" update %SVNPath%/"CPA memotech Suite" %LocalPath%\CPA52
echo Getting the latest SQL
"C:\Program Files\TortoiseSVN\bin\svn.exe" update %SVNPath%/Sql %LocalPath%\CPA52SQL
echo Getting the latest Templates
"C:\Program Files\TortoiseSVN\bin\svn.exe" update %SVNPath%/Templates %LocalPath%\CPA52Templates) || (echo Getting the latest source code
"C:\Program Files\TortoiseSVN\bin\svn.exe" checkout %SVNPath%/"CPA memotech Suite" %LocalPath%\CPA52
echo Getting the latest SQL
"C:\Program Files\TortoiseSVN\bin\svn.exe" checkout %SVNPath%/Sql %LocalPath%\CPA52SQL
echo Getting the latest Templates
"C:\Program Files\TortoiseSVN\bin\svn.exe" checkout %SVNPath%/Templates %LocalPath%\CPA52Templates)
echo Starting Build...
"C:\WINDOWS\Microsoft.NET\Framework\v3.5\Msbuild.exe" "D:\Appli.Net\5.2\CPA52\CPA memotech Suite.sln"
pause我正在使用批处理文件if else条件,比如如果他是第一次执行,那么它将签出,并且它已经存在,那么它将执行更新
发布于 2012-10-31 13:08:29
最好使用UPDATE命令,而不是每次对存储库执行CHECKOUT操作。
Checkout仅用于第一次检出。
https://stackoverflow.com/questions/13151523
复制相似问题