How can I release locks in Subversion recursively?

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

    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.

提交回复
热议问题