21 July 2005

TortoiseSVN: converting from _svn to .svn

After you have migrated all your VS 2003 solutions away from web applications, you will be able to use the standard svn tools. Unfortunately, once you install the standard TortoiseSVN, your old projects will be unusable until they are re-checked out.

Don't worry! There is a better way.

Below are two scripts that allow you to quickly and easily convert from a project using _svn (hacked TortoiseSVN) to .svn (standard TortoiseSVN).

@rem dotNetSVN.cmd 
@echo off

rem convert .svn folders to _svn

setlocal
for /f "delims=" %%a in ('dir /AH /b /s .svn*') do attrib -h "%%a"
for /f "delims=" %%a in ('dir /AD /b /s .svn*') do move "%%a" "%%a\..\_svn"
for /f "delims=" %%a in ('dir /AD /b /s _svn*') do attrib +h "%%a"
endlocal
@rem normalSVN.cmd 
@echo off

rem convert _svn folders to .svn

setlocal
for /f "delims=" %%a in ('dir /AH /b /s _svn*') do attrib -h "%%a"
for /f "delims=" %%a in ('dir /AD /b /s _svn*') do move "%%a" "%%a\..\.svn"
for /f "delims=" %%a in ('dir /AD /b /s .svn*') do attrib +h "%%a"
endlocal