I am having a problem with version control in Subversion. I checked out a working copy from respository and got locks on all of its files. Then, without releasing the locks I ha
From the advance locking section
$ svn status -u
M 23 bar.c
M O 32 raisin.jpg
* 72 foo.h
Status against revision: 105
$ svn unlock raisin.jpg
svn: 'raisin.jpg' is not locked in this working copy
That simply means the file is not locked in your current working directory , but if it is still locked at the repository level, you can force the unlock ("breaking the lock")
$ svn unlock http://svn.example.com/repos/project/raisin.jpg
svn: Unlock request failed: 403 Forbidden (http://svn.example.com)
$ svn unlock --force http://svn.example.com/repos/project/raisin.jpg
'raisin.jpg' unlocked.
(which is what you did through the TortoiseSVN GUI)
Doing an SVN cleanup will release the lock as well:
$ svn cleanup
The repository administrator can remove the locks (recursively), operating on hundreds of files inside a problematic directory -- but only by scripting since there is not a --recursive option to svnadmin rmlocks.
$repopath=/var/svn/repos/myproject/;
$problemdirectory=trunk/bikeshed/
IFS=$'\n'; for f in $(sudo svnadmin lslocks $repopath $problemdirectory \
| grep 'Path: ' \
| sed "s/Path: \///") ; \
do sudo svnadmin rmlocks $repopath "$f" ; done
This solution works with filenames that have spaces in them.
For me deleting the lock file inside .svn did not work since I got bad checksum msg after trying to update the file.
I got the following msg after executing svn cleanup inside the directory:
svn: In directory '' svn: Can't copy '.svn/tmp/text-base/file_name.svn-base' to 'filename.3.tmp': No such file or directory
So I copied my file to .svn/tmp/text-base and changed the name to file_name.svn-base. Then cleanup and update worked fine.
When I tried to run the script from above as originally provided, I was getting an error when it tried to set the variables: ./scriptname: line1: =/svn/repo/path/: No such file or directory ./scriptname: line2: =directory/: No such file or directory
I removed the '$' from the first two lines and this worked perfectly after that.
repopath=/var/svn/repos/myproject/;
problemdirectory=trunk/bikeshed/
IFS=$'\n'; for f in $(sudo svnadmin lslocks $repopath $problemdirectory \
| grep 'Path: ' \
| sed "s/Path: \///") ; \
do sudo svnadmin rmlocks $repopath "$f" ; done
If somebody else has locked the files remotely, I found that using TortoiseSVN 1.7.11 to do the following successfully unlocked them in my working copy. (similar to vikkun's answer)
Files in working copy should now be unlocked.