Announcement

Collapse
No announcement yet.

SVN file/repo Locks report

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SVN file/repo Locks report

    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?

  • #2
    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/1...version-server

    Not sure if you could combine those two commands to get the script you're looking for?

    Comment


    • #3
      Originally posted by orbrey View Post
      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/1...version-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

      Comment


      • #4
        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

        Code:
        @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.

        Comment

        Working...
        X