svnsync - couldn't get lock on destination repos
Using svnsync
$ svnsync --non-interactive sync ${REPO}
after an abort of the process there was this error message with retry
Failed to get lock on destination开发者_如何学编程 repos, currently held by 'svn.test.com:0e4e0d98-631d-0410-9a00-9330a90920b3'
...
Failed to get lock on destination repos, currently held by 'svn.test.com:0e4e0d98-631d-0410-9a00-9330a90920b3'
svnsync: Couldn't get lock on destination repos after 10 attempts
Is there a way to fix this problem?
Actually, there is some functionality built into svnsync (since v1.7) that can "steal" the lock.
svnsync help sync
shows:
--steal-lock : Steal locks as necessary. Use, with caution,
if your mirror repository contains stale locks
and is not being concurrently accessed by another
svnsync instance.
and when I run it, I get a nice:
Stole lock previously held by '[hostname]'
So, you don't need the propdel thing after all
You have to remove the lock property on the remote repository via svn command line on the remote site which has been left over from a failure during synchronization.
svn propdel --revprop -r0 svn:sync-lock file:///path/to/the/repository
Technically, it is the destination repository that you need to delete the property from, not necessarily the remote repository, as the destination could be local. So for this specific question:
svn propdel --revprop -r0 svn:sync-lock ${REPO}
Removing the Lock worked for me. However, I had to use a slightly different command, as I needed to send the username and password of the account to use to unlock the account.
svn pdel --revprop -r 0 --username ??? --password ??? svn:sync-lock file:///path/to/the/repository
I also had to run this command from the drive that the repository was on. (change to d: in the command prompt before running the command, if my Repository was on d:)
Prior to entering the username and password, when I ran the command I got the following error:
revprop change blocked by pre-revprop-change hook (exit code 255)
I found and opened the pre-revprop-change
hook file, and it had code in there listing only a certain username that could make the required changes. Using that username and password in the above command removed the hook.
To confirm the presence of lock(although the err obviously tells it), run proplist with -verbose
svn pl --revprop -v -r 0 file:///svn/slave
then delete the prop as necessary!
You have to do two things to solve the problem. One is deleted the lock as noted above. Then you have to edit the pre-revprop-change.tmpl file to be empty, and make it executable. Use chmod +x on Linux/Unix/Mac but change the file name to pre-revprop-change.bat on Windows. After this you can load dump files into your repository and then mirror it where ever you need.
精彩评论