You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Miguel Rentes <mi...@efacec.pt> on 2008/04/15 15:10:35 UTC

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/
EFACEC - Sistemas de Electronica, SA
/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@efacec.pt <ma...@efacec.pt>
*Disclaimer* <http://efacec.pt/email.jpg>

RE: files being locked in a repository

Posted by "Thompson, Graeme (GE Infra, Aviation)" <Gr...@ge.com>.
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@efacec.pt] 
Sent: 15 April 2008 16:11
To: users@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@efacec.pt 
 <http://efacec.pt/email.jpg> Disclaimer