Mary
Mary

Reputation: 43

SVN error "working copy xxx locked" and there is no .lock file

My working copy is locked and search for solution about it, and I found one that says .lock file should be removed. But the problem is there is no .lock file created in my folder. How to solve this. Please help. Thanks.

Upvotes: 4

Views: 11354

Answers (3)

Highly Irregular
Highly Irregular

Reputation: 40559

If you also get the error "sqlite: attempt to write a readonly database" with the "working copy xxx locked" error, then it appears that it can also be caused by insufficient permissions for writing to the working copy.

I've explored that problem separately here. Fixing the permissions fixed the problem.

It's frustrating that a more appropriate error isn't given for such a simple problem!

Upvotes: 0

Siddharth
Siddharth

Reputation: 9574

SVN is a wonderful tool, but has usability issues when things dont get checkedout or committed completely and nicely. Its state information is stored on the server and the client. The wonderful thing about it is that the server never gets screwed, and it never screws with your original source files.

That said, I have 2 suggestions for your

  1. When you have client issues, dont sit and research and debug the svn issue. Its a waste of time and effort. Know that your data is not lost and that your server is just wow :).
  2. Checkout your project in a different location. From the old location copy all files to the new location (use meld, araxis merge or beyond compare) and commit.

NOTE : DONT copy directories from old location to new location. As pointed out correctly by @Steve Py, directories contain .svn folders and hold state information for that particular instance of checkedout project. If you must, create fresh directories in your new location and only copy files.

TIP : When you use a directory compare tool, its change (right to left OR left to right) are not REVERSIBLE. Once you hit that button, you are screwed :). So that old location I was talking about, back it up :).

Upvotes: 1

Steve Py
Steve Py

Reputation: 34793

SVN uses hidden directories, .svn or _svn by default. Before resorting to tinkering with these folders:

Usually the best thing you can do is fire up a copy of TortoiseSVN (http://tortoisesvn.net/) and hook it to your repository and working directories. Tortoise hooks into Explorer so it gives you a bit more holistic view of your working folder structure. Try the Unlock command on the files/folders, in question. If this works, (or doesn't) Follow up with a "Cleanup" against the parent folder for the item in question (1 folder level higher) and then try the desired operation again.

If you're using Ankh or a similar VS plugin these kind of locking issues can be fairly common, and annoying. :)

Upvotes: 5

Related Questions