How can I release locks in Subversion recursively?

前端 未结 9 1225
青春惊慌失措
青春惊慌失措 2021-02-01 12:24

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

相关标签:
9条回答
  • 2021-02-01 13:30

    Ok I got it. Here's what worked for me.

    • Check out a working copy
    • Then go in Windows explorer menu, TortoiseSVN -> Check for modifications...
    • Click on Check repository button
    • Select All the files, right click and select the break lock option
    • Delete the working copy and the one in repository. Voila! :)
    0 讨论(0)
  • 2021-02-01 13:31

    Unless you have admin access to the svn machine and can use the 'svnadmin' tool, your best option seems to be this:

    1. Checkout the problematic directory using svn checkout --ignore-externals *your_repo*
    2. Use svn status --show-updates on the checked out repository to find out which files are potentially locked (if someone finds the documentation on the meaning of the status codes please comment).
    3. Use svn unlock --force *some_file* on the files found at 2.

    I've used the following one-liner to automate 2. and 3.:

    svn status -u | head -n -1 | awk '{ print $3 }' | xargs svn unlock --force
    
    0 讨论(0)
  • 2021-02-01 13:31

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

    svnadmin lslocks <path_to_repo> |grep -B2 Owner |grep Path |sed "s/Path: \///" | xargs svnadmin rmlocks <path_to_repo>
    
    0 讨论(0)
提交回复
热议问题