1

I am using svn checkout command in a batch file to checkout the my source code folder from SVN and then build the code.

But sometimes checkout fails and thus code build fails as all the folders are not checkedout. So how would one come to know whether checkout has failed so that i can restart the checkout process.

2
  • Please provide error Message Commented Apr 17, 2013 at 7:19
  • 1
    Peter: why? The question is clear enough and the reason why the checkout fails sometimes is fairly irrelevant to the question of how to figure out that it failed. Commented Apr 17, 2013 at 8:09

1 Answer 1

3

svn should exit with a non-zero exit code if something failed, so

svn checkout ...
if errorlevel 1 (
  echo something failed
)

To build something more robust that simply tries the checkout until it succeeds you can use something like this:

:l
rem reset errorlevel to 0
ver > nul
if exist foo rd /s /q foo > nul
svn checkout http://... foo || goto l

which should try until success.

Sign up to request clarification or add additional context in comments.

1 Comment

I tried this but its not working. What I am doing is disconnecting the LAN cable while checkout is going on which leads to checkout failure. But It doesn't return errorlevel it seems.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.