问题
Wanted to merge my branch back into the main trunk today. Haven't worked on this project for a week and haven't done any commits, etc. in that time-frame. Attempted to do a switch from the branch back to the trunk and get this error:
No write-lock in 'Y:\Website\_Working Copy\app'
I've never had or seen this issue in the past and can't find any documentation on what is going wrong...what could this be and what can I try?
Also, I just upgraded TortoiseSVN & SVN to latest versions to see if that would repair a damaged file but no-go.
回答1:
Hmm... That is odd, but it's a problem in your working copy. I'd abort troubleshooting the svn switch by getting a fresh checkout the trunk. You should then be able to merge the branch into this new working copy.
回答2:
I was switching from a branch to trunk and just got the same error.
With TortoiseSvn, I was able to do a "Clean Up" and that fixed the issue for me.
回答3:
If you're using TortoiseSVN, what could be happening is that a (wayward) TSVNCache process is holding open .svn/wc.db which prevents a write lock on the file from being created during the switch operation. Killing the process (or at least forcing the handle closed) will release the handle on the file, allowing other operations that modify the working copy metadata to happen.
回答4:
I had this problem in a recurrent fashion, always in the same project, at each and every commit. Chris' answer may work (i.e. restart TSVNCache process) but that's a one off.
What cleared off the problem definitively for me was to:
1) go down to the file(s) that TSVN complained about, and do SVN Update on each of them, TSVN then issues a "merged file ..." message, because of the commit that succeeded, but the automated update that had failed.
2) once all files were committed and my overall project directory stable, I deleted the to folder, and checked it out from scratch.
No more problems since. Touch wood.
来源:https://stackoverflow.com/questions/9403185/tortoisesvn-write-lock-error