0

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?

Community
  • 1
  • 1
sab669
  • 3,984
  • 8
  • 38
  • 75

1 Answers1

4

You can't perform three simultaneous update operations on the same working copy. It's by design and that's exactly what working copy locking accomplishes.

If you want to use TortoiseSVN you'll have to use the /wait flag of the start command and do updates one by one:

/wait : Starts an application and waits for it to end.

If you don't need a fancy GUI you can just call svn directly (assuming you selected the command line tools when you installed TortoiseSVN).

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • Oh, I see. So do i just do like `START TortoiseProc.exe /wait `? – sab669 Dec 16 '13 at 16:20
  • 1
    I haven't tried it myself. Beware that `/wait` is a flag of `start`, not `TortoiseProc.exe`. – Álvaro González Dec 16 '13 at 16:21
  • Thanks. I did START /wait and that works, but I have to click "OK" on the screen that Tortoise throws up before it'll update the next one... Not sure if I like this more than my existing Console app which just does them all. Thanks again. – sab669 Dec 16 '13 at 16:30
  • It's possible that `/closeonend:0` is not getting passed to `TortoiseProc.exe`. Batch syntax is terribly difficult to get right. – Álvaro González Dec 16 '13 at 16:34
  • Nah, that was my mistake. It should be a `1` instead of `0`. – sab669 Dec 16 '13 at 17:04
  • As @ÁlvaroG.Vicario points out, the *most* appropriate way to resolve this is to not use TortoiseProc.exe at all - just run `svn.exe`, and without the `start`. That will ensure that you're A) using the right tool for the job and B) not getting conflicting processes. – alroc Dec 16 '13 at 17:08
  • I'll find out, giant corporation so I don't know if they were installed on every machine or not. – sab669 Dec 16 '13 at 17:37