SVN file/repo Locks report

kenp11
kenp11
We need to run a locks report daily. Does anyone have a Windows batch script or VB script that can check SVN locks through the URL. Since there are so many repositories and new ones are added and removed we did not want to specify each repository. Is there a way to get the list of repositories and then check for the locked file? I saw SVN Status command and there are 5 different locked status. Is there a way to get a daily report on these files? SVN INFO command we have to specify each file which wil not work. Any ideas?

Last updated

orbrey
orbrey
Hi there,  If you run svn status -v --show-updates in the repository root it'll list all the files in the repository along with the lock status, as per http://stackoverflow.com/a/9785504/3464004  As for listing repositories, it'll depend on your server config but svn list should do the job - some detail on how to get that working here: http://stackoverflow.com/questions/1693638/how-to-display-list-of-repositories-from-subversion-server  Not sure if you could combine those two commands to get the script you're looking for?
kenp11
kenp11
orbrey;168653Hi there,    If you run svn status -v --show-updates in the repository root it'll list all the files in the repository along with the lock status, as per http://stackoverflow.com/a/9785504/3464004    As for listing repositories, it'll depend on your server config but svn list should do the job - some detail on how to get that working here: http://stackoverflow.com/questions/1693638/how-to-display-list-of-repositories-from-subversion-server    Not sure if you could combine those two commands to get the script you're looking for?
   Yes i would have to use several commands. Each repository would need to be queried as well. I was hoping for a cleaner way
orbrey
orbrey
Try saving this code snippet to a .bat file in the folder above your main repository directory on the server (hopefully all your repositories are in the same directory?) and running it from there - should list what you need?    Don't forget to set the REPOS_DIR variable to the name of the folder that holds the repositories :)      @echo off    SET REPOS_DIR=repos      FOR /f %%i IN ('dir /B /A:D %REPOS_DIR%\*') DO (  echo Listing files and lock status for repository %REPOS_DIR%\%%i  svn status -v --show-updates %REPOS_DIR%\%%i >> %REPOS_DIR%\RepoLockStatus_%date%_%time%.txt  )      Hope that does what you need? Realise it's not easy to run this remotely (unless you can remote desktop into the server) but it's a lot closer to where you need to be.

1-4 of 4

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.