Search code examples
svnadministration

What is the best way to see what files are locked in Subversion?


I finally got my group to switch from SourceSafe to Subversion. Unfortunately, my manager still wants to use exclusive locks on every single file. So I set the svn:needs-lock property on every file and created a pre-commit hook to make sure the property stays set.

We are running Subversion on a Linux server. Most of us use Windows machines and a few use Macs. We are using various SVN clients (TortoiseSVN, SmartSVN, Subclipse, etc.).

What we now need is a good/easy method to see all the files that are currently locked in the entire repository (and who has them locked). I have poked around a little in Tortoise and Subclipse, but haven't found what I am looking for. Our projects have many subdirectories that are multiple levels deep, so it would be too time consuming to look at each individual directory.

What I would like is a single report I can run that lists everything that is currently locked and who has it locked. What is the best way to get this type of information?


Solution

  • What you're looking for is the svnadmin lslocks command.

    I have this set up at work because we keep some Word documents in our Subversion repository (with svn:needs-lock). I have a cron job set up that every day, checks the list of locks and emails a report of all locks older than 7 days to the whole team. That way we can tell who has been slacking and sitting on a locked copy of a document for a long time.