How can I release locks in Subversion recursively?

前端 未结 9 1228
青春惊慌失措
青春惊慌失措 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: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
    

提交回复
热议问题