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

I am using the Autobuild.bat file daily getting the files and build the application.
But the problem is, if local file revision number SVN repository revision number differ then it is replacing the file instead of merge or leave.

2
  • 1
    please help me to do merge or replacing the file Oct 31, 2012 at 5:00
  • please help me how to leave the file instead of replacing the file.. it is very urgent Oct 31, 2012 at 7:02

2 Answers 2

2

It could be a good idea to use the UPDATE command instead of each time CHECKOUT the repository.

Checkout is intended only for the first checkout.

2
  • I need to get the latest daily by using checkout and i need to get leave the file if any file revision number is different it is posible? Oct 31, 2012 at 5:20
  • Why you use checkout? Do you have a good reason and do you understand the difference between UPDATE and CHECKOUT?
    – jeb
    Oct 31, 2012 at 7:15
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

I am using the batch file if else condition like if he is doing first time then it will checkout and it is already exist then it will do update

2
  • You urgently need to learn how to use variables so that you don't keep repeating yourself. And when updating throw in svn revert -R to remove any local mods. Nov 7, 2012 at 7:38
  • DavidHeffernan I know how to use variables in programming and many thanks for the suggesting Apr 25, 2014 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.