0

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

4

2 回答 2

2

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

Checkout仅用于第一次结帐。

于 2012-10-31T05:08:29.487 回答
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

我正在使用批处理文件,如果其他情况像他第一次这样做那么它将结帐并且它已经存在然后它会更新

于 2012-11-07T05:25:30.060 回答