Question

I have a batch file I'm running from a Windows XP w/service pack 3 workstation which applies SQL changes to a database using sqlcmd.exe in SQL 2005.

I've got a command-line entry for TortoiseSVN to automatically update the local copy of my repository like so:

tortoiseproc /command:update /path:"C:/SVN/My Code/Dev/2009.07.23" /closeonend:3

According to the documentation, the /closeonend:3 option will leave the TortoiseSVN dialog box open if any errors, conflicts or merges occur during the update.

If such does occur, and the user closes the dialog without resolving the issues, they could potentially omit changes we want applied to a given branch's test database.

When the TortoiseSVN dialog box is closed in the case of an error, conflict, or merge following an update, will the ERRORLEVEL be set to some nonzero value, enabling me to bypass the rest of the batch file? Or will it happily return 0 to indicate it did its job successfully even if the code isn't quite right?

Was it helpful?

Solution 2

I ended up just manually updating my local SVN repository prior to performing the other actions in the batch file.

OTHER TIPS

Old question, but I encountered the same thing today and there is a solution...

TortoiseProc returns -1 on error and 0 on success, so the following solved the problem for me:

TortoiseProc /path:"%targetdir%" /command:update /closeonend:3
IF %ERRORLEVEL% NEQ 0 goto SvnError

:SvnSuccess
echo It worked!
goto Done

:SvnError
echo It didn't work!

:Done
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top