自动构建获取最新的龟甲SVN?

时间:2012-10-31 05:00:19

标签: svn batch-file tortoisesvn

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存储库修订号不同,那么它正在替换文件而不是合并或离开。

2 个答案:

答案 0 :(得分:2)

使用UPDATE命令而不是每次CHECKOUT存储库都是一个好主意。

Checkout仅适用于首次结帐。

答案 1 :(得分:2)

@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

我正在使用批处理文件,如果其他条件如果他第一次做,那么它将结帐并且它已经存在然后它将进行更新