I'm developing a web using subversion as version control, but got "working directory locked" error message
Here's the story:
I have
PC-A:
PC-B:
I have create repository on PC-A using VisualSVN.
From PC-B, I Checkout http:\\PC-A:81\svn\test\trunk to D:\xampp\htdocs\test-lalala.
From PC-A, I also checkout http:\\PC-A:81\svn\test\trunk to D:\xampp\htdocs\test-lalala.
I Create a post-commit hooks running my-post-commit.bat file so when I commit to http:\\PC-A:81\svn\test\trunk, folder D:\xampp\htdocs\test-lalalaon PC-A will updated, so other people can see the result.
"C:\Program Files\VisualSVN Server\bin\svn.exe" update "D:\xampp\htdocs\test-lalala" --username myusername --password mypassword --config-dir "C:\Program Files\VisualSVN Server\conf"
On PC-B, Create index.php file, and commit. When I commit, I get this error message
On PC-A, I try to right-click on D:\xampp\htdocs\test-lalala TortoiseSVN > CleanUp, and check "cleanup working copy status" and "Include externals" (checked by default). Try to add file and commit, but still got the same error message.
I try to look for lock file on .svn folder but there are no lock file. I also try to delete working copy on PC-A D:\xampp\htdocs\test-lalala and checkout again, but when I commit, still got the same error message.
How to solve this error message? So when I commit, the folder will updated automatically ?
The lock tells other users that the file is being edited, and you can avoid merge issues. When you set up source control, you can configure SVN to make files with certain extensions read only. Users must get a lock on these read-only files before editing.
A Subversion working copy is your own private working area, which looks like any other ordinary directory on your system. It contains a COPY of those files which you will have been editing on the website.
Every time I get a Working copy locked error I run a "Clean up". After that everything is back to normal.
On the command line you can execute svn cleanup
which also removes lock files.
Note: Perform this operation on one level up directory and that should resolve most of the times.
To anyone still having this issue (Error: Working copy '{DIR}' locked.), I have your solution:
I found that when one of TortoiseSVN windows crash, it leaves a TSVNCache.exe that still has a few handles to your working copy and that is causing the Lock issues you are seeing (and also prevents Clean Up from doing it's job).
So to resolve this:
Either
1a) Use Process Explorer or similar to delete the handles owned by TSVNCache.exe
1b) ..Or even easier, just use Task Manager to kill TSVNCache.exe
Then
2) Right click -> TortoiseSVN -> Clean up. Only "Clean up working copy status" needs to be checked.
From there, happy updating/committing. You can reproduce Lock behavior by doing SVN Update and then quickly killing it's TortoiseProc.exe process before Update finishes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With