[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: files being locked in a repository

From: Thompson, Graeme (GE Infra, Aviation) <Graeme.Thompson_at_ge.com>
Date: Tue, 15 Apr 2008 11:51:14 -0400

We have a small script (windows batch file) to create a list of all
locks in a repository formatted in html (Note that this requires sed,
grep and nxslt2 utilities)
 
It can take either a working copy folder or a repository URL as the
first argument.
 
lslocks.bat:
-----------------------------------
@echo off
svn info %1 | grep URL | sed -e "s/URL: //" > c:\lock_temp_url.txt
if errorlevel 1 goto end
echo Getting SVN information for
type c:\lock_temp_url.txt
svn info -R --xml --targets c:\lock_temp_url.txt > c:\lock_temp_info.xml
echo Formatting results as HTML
nxslt2.exe c:\lock_temp_info.xml lock_transform.xsl -o c:\locks.html
del c:\lock_temp_url.txt
del c:\lock_temp_info.xml
c:\locks.html
:end
------------------------------------
 
 
lock_transform.xsl
------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
   <html>
   <head>
     <title>Locks</title>
   </head>
   <body>
      <h1>Locks</h1>
      <table>
         <tbody>
            <tr>
               <th>URL</th>
               <th>Lock Owner</th>
               <th>Lock Description</th>
               <th>Creation Time</th>
               <th>Expiry Time</th>
            </tr>
               <xsl:for-each select="//info/entry/lock">
               <xsl:sort select="owner"/>
                  <tr>
                     <td><xsl:value-of select="../url"/></td>
                     <td><xsl:value-of select="owner"/></td>
                     <td><xsl:value-of select="comment"/></td>
                     <td><xsl:value-of select="created"/></td>
                     <td><xsl:value-of select="expires"/></td>
                  </tr>
               </xsl:for-each>
         </tbody>
      </table>
   </body>
   </html>
</xsl:template>
</xsl:stylesheet>
------------------------------------------------------
 
 
Any suggestions for improvements are always welcome.....
 
Hope this helps,
 
Graeme

  _____

From: Miguel Rentes [mailto:miguel.rentes_at_efacec.pt]
Sent: 15 April 2008 16:11
To: users_at_subversion.tigris.org
Subject: files being locked in a repository

Hi everyone!

How can I get a complete list of files being currently locked and by
which user? Is it possible to generate a report that gives me this
information without having to do a checkout of the whole repository into
my computer?

I'm using the graphical client rapidSVN (and Trac) but can't see in a
glance which files are being locked in a SVN repository. This
information would be important for me. Any suggestions?

Best regards,

-- 
Miguel Rentes 
Software Engineer 
 
ID/GR 
Address: 
Rua Eng. Frederico Ulrich apartado 3078 
4471-907 Moreira da Maia - Portugal 
Phone: +351 22 940 20 00 (DDI: 22 940 33 88) 
Fax: +351 22 948 54 28 
Email: miguel.rentes_at_efacec.pt 
 <http://efacec.pt/email.jpg> Disclaimer 

e_logo_engen.jpg
Received on 2008-04-15 17:53:02 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.