tags:

views:

242

answers:

2

I'm trying to find a way to remove zombie locks using the Subversion command line tools. The eventual goal is to do this from a hook script, but I haven't been able to work out the command line to use when you only have a physical repository path. (Using svnadmin rmlocks only seems to work for locks which exist in the HEAD revision.)

Ideally, I'd like to do this via the post-commit hook script using the command line tools. (I'm aware of the python script for this purpose, but we'd prefer not to install python on that server for this single use.) We're a .NET shop, so creating a tool with the SharpSVN library is also a possibility, but the only unlock capability there appears to be in the SVNClient class.

So it's really two questions: Is there a way to do this with the command line tools? If not, is there a way to do it from SharpSVN? (Or perhaps another library?)

+1  A: 

There's a Python script (referenced here: http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2369399). I'd either use that, or translate it to .NET if you needed to.

Don
That's the script I referred to in my question. I haven't been able to find a command-line equivalent to the svn_repos_fs_unlock method. (svnadmin rmlocks only seems to work for lock in the HEAD revision.) Likewise, with SharpSVN, the only unlock method available is on the client side.
ThatBlairGuy
Sorry; don't know how I skipped over the fact that you mentioned the Python script. I basically answered you with your own question...SharpSVN is a .NET wrapper around the client API, so the same call should be available if the developers have implemented it. I searched for the svn_repos_fs_unlock method in the source and did not find it. You might want to ask on the SharpSVN forum, http://sharpsvn.open.collab.net/ds/viewForumSummary.do?dsForumId=728, just to make sure. If you're comfortable with C, you could call the API directly.
Don
Thanks. If it comes down to that, calling the API is a possibility, thought I'd just as soon avoid that if a suitable wheel already exists.
ThatBlairGuy
Because he says "We're a .NET shop". Thanks for the helpful comment, though.
Don
+1  A: 

It looks like the answer is "You can't get there from here."

  • Svnadmin provides a command-line for removing locks with a repository path, but it doesn't seem to work with zombie locks.
  • SharpSVN is primarily client-side; it does have a few methods for connecting with a repository path, but those (per the docs) are mostly for use in the library's unit tests.

So rewriting the python script in C using the Subversion API library.

ThatBlairGuy