svn upgrade
needs to be run at the top level of each working copy - you don't want to recurse into a WC 3 levels deep and then run it there, as you'll hose the WC. Reason: SVN pre-1.7 had a .svn
directory in each directory of the working copy, while 1.7+ uses a single .svn
in the root of the WC.
So, your recursion has to guarantee that you'll touch the top levels first - then as you go deeper if you find a .svn
directory, you know it's a separate WC and not a child of another.
Batch is dead, use PowerShell. Put this in a .ps1
file (or the PowerShell ISE) and run it:
function upgrade-svndirs {
param (
[string]$PathToUpgrade
)
$Dirs = get-childitem $PathToUpgrade|where-object{$_.PSIsContainer};
foreach ($dir in $dirs) {
$DirName = $dir.FullName;
$isWC = Get-ChildItem $DirName -Filter ".svn" -Force;
if ($isWC) {
svn upgrade "$DirName";
}
upgrade-svndirs -PathToUpgrade $DirName;
}
}
upgrade-svndirs C:\a;