4

I wrote a console application that uses SharpSVN to update 3 folders in my repository. Wanted to convert that to a batch script to removed the dependency on SharpSVN.

Came up with this:

CD C:\Program Files\TortoiseSVN\bin\
START TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\AMC\Core" /closeonend:0
START TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\AMC\Modules" /closeonend:0
START TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\MW" /closeonend:0

I found this as an answer to another SO question. When I run it, I get 3 windows pop up from Tortoise.

One says:

Error: Working copy 'C:\AMG\trunk\AMG_AccountManager\AMC' locked.
Error: 'C:\AMG\trunk\AMG_AccountManager\AMC' is already locked.

A second one says:

Error: Working copy 'C:\AMG\trunk\AMG_AccountManager' locked.
Error: 'C:\AMG\trunk\AMG_AccountManager\AMC' is already locked.

And the third one successfully updates the Modules folder. Anyone know what's causing the first two to be locked?

1
  • I've seen this happen for no apparent reason. I don't know what causes it, but, an svn "clean" of the folder will usually fix it.
    – rrirower
    Dec 16, 2013 at 16:09

2 Answers 2

5

Found the answer to my issue. Basically, Tortoise puts a lock on a folder any time it tries to do something. My script was just immediately launching 3 updaters, without waiting for the previous one to finish.

The START command has a /wait flag that waits for whatever it runs to exit, so I modified my script as follows:

CD C:\Program Files\TortoiseSVN\bin\
START /wait TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\AMC\Core" /closeonend:1
START /wait TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\AMC\Modules" /closeonend:1
START /wait TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\MW" /closeonend:1

Unfortunately, I have to close the update window that Tortoise opens in order for the script to be fully automated. This means that I can't observe what files were modified or added.

1

TortoiseSVN when used manually can update multiple directories with a single command, simply by selecting multiple folders before running the Update command. The command-line svn update also accepts multiple targets. So, I'd fully expect the TortoiseSVN command-line should also accept multiple paths. http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-automation.html shows an example for committing multiple files, does that syntax also work for updating? I don't have TortoiseSVN on the computer I'm on at the moment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .