How can I release locks in Subversion recursively?

I have a problem with version control in Subversion. I checked the working copy from the repository and got locks in all my files. Then, without releasing the lock, I deleted the folder from the disk.

  • I can’t delete a folder from the repository because it received a lock
  • If I try to release the locks recursively, it says that the locks will not be released.
  • In the "Repository Overview" view, I can only break locks into specific rather than recursive folders.

How can I break the locks in the repository? I am using TortoiseSVN for Windows. Is there a command to recursively break locks for a folder?

+45
version-control svn locking
Jul 01 '10 at 5:18
source share
9 answers

OK I understood.

  • What I did, I checked the working copy.
  • Then went to the explorer menu, TortoiseSVN β†’ Check for changes ...
  • Click Check Repository
  • Select All Files, right-click and select the option to lock the gap.
  • Delete a working copy and one in the repository. Voila! :)

Hello

+54
Jul 01 2018-10-10T00:
source share

Performing SVN cleanup will also release the lock:

$ svn cleanup 
+29
Feb 11 '13 at
source share

From the pre-blocking section

 $ svn status -u M 23 bar.c MO 32 raisin.jpg * 72 foo.h Status against revision: 105 $ svn unlock raisin.jpg svn: 'raisin.jpg' is not locked in this working copy 

It just means that the file is not locked in your current working directory, but if it is still locked at the repository level, you can force unlock ("blocking violation")

 $ 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. 

(this is what you did with the TortoiseSVN GUI)

+15
Jul 01 '10 at 6:41
source share

If someone locked the files remotely, I found that using TortoiseSVN 1.7.11 to do the following successfully unlocked in my working copy. (similar to vikkun answer)

  • Right click on working copy> Check Changes
  • Click the Check Repository button
  • Select the files you want to unlock
  • Right Click> Get Lock
  • Check the "Steal Lock" box.
  • Once the lock is stolen, select again
  • Right Click> Lock Lock

Now the files in the working copy should be unlocked.

+7
Jul 09 '13 at 16:05
source share

The repository administrator can remove the locks (recursively) by working with hundreds of files inside the problem directory, but only with the help of scripts, since there is no recursive option for 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 file names that contain spaces.

+2
Dec 19 '13 at 16:31
source share

If you do not have administrator access to the svn machine and you can use the 'svnadmin' tool, your best option is as follows:

  • Checkout the problem catalog with svn checkout --ignore-externals *your_repo*
  • Use svn status --show-updates in the extracted repository to find out which files are potentially locked (if someone finds documentation about the meaning of status codes, please comment).
  • Use svn unlock --force *some_file* for files found in 2.

I used the following single-line file for automation 2. and 3 .:

 svn status -u | head -n -1 | awk '{ print $3 }' | xargs svn unlock --force 
+2
Sep 02 '16 at 0:26
source share

If you have access to the svnadmin tool on the repo server, you can use this alternative to remove all locks (based on the script sent by VonC)

 svnadmin lslocks <path_to_repo> |grep -B2 Owner |grep Path |sed "s/Path: \///" | xargs svnadmin rmlocks <path_to_repo> 
+2
May 31 '17 at 16:22
source share

For me, deleting the lock file inside .svn did not work, since I had an unsuccessful msg checksum after trying to update the file.

I got the following msg after doing svn cleanup inside the directory:

svn: In the directory '' svn: Cannot copy '.svn / tmp / text-base / file_name.svn-base' to 'filename.3.tmp': there is 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.

0
May 13 '13 at 13:00
source share

When I tried to run the script from above, as it was originally, I got an error when I tried to set the variables:. / scriptname: line1: = / svn / repo / path /: There is no such file or directory. / scriptname: line2: = directory /: There is no such file or directory

I removed the '$' from the first two lines and after that it did a great job.

 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 
0
Nov 19 '14 at 18:21
source share



All Articles