Update multiple remote SVN repositories revprops using powershell

We use SVN and have repository per project.  All projects are stored in C:\Subversion and are named <client>-<project name>.  We use svnsync to backup our repositories to a geographically remote server.  Checking an updating remote SVN properties was a manual process.

Enter PowerShell… Since our folder structure is mirrored on both servers, getting a revprop for each repository is easy

PS C:\Subversion> dir | ? { $_.PSIsContainer -eq $true } | % { Write-Output $_.Name; svn propget svn:sync-from-url --revprop -r0 svn+ssh://<username>@<remote url>/$_ }|

Setting them is just as easy

PS C:\Subversion> dir | ? { $_.PSIsContainer -eq $true } | % { svn propset svn:sync-from-url file:///c:/subversion/$_ --revprop -r0 svn+ssh://<username>@<remote url>/$_ }

Leave a Comment

Filed under tech