Moving on from SVN_ASP_DOT_NET_HACK
February 19, 2008 4 Comments
I noticed that I was running TortoiseSVN in SVN_ASP_DOT_NET_HACK mode (where Subversion clients use ‘_svn’ instead of ‘.svn’ directories) unnecessarily as I don’t have silly old Visual Studio 2003 installed anymore which caused this mess in the first place.
The _svn directories work just as well as .svn, but nevertheless (due to mild OCD?), I created a batch script that ripped through my project directory renaming all ‘_svn’ directories to ‘.svn’, so I could remove the SVN_ASP_DOT_NET_HACK mode. It uses the wonderfully flexible FOR command drive the whole process. We don’t need no stinkin’ Powershell round these parts…
Save this script as something like “SvnRenameDirs.cmd” in the root of your projects folder:
:: Make script directory current pushd "%~dp0" :: Unhide, rename and re-hide svn dirs for /r /d %%D in (*) do @if exist "%%D\_svn" ( attrib -H "%%D\_svn" ren "%%D\_svn" ".svn" attrib +H "%%D\.svn" ) popd rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,0,3
At the end click the Environment Variables button in the System Properties dialog and remove the SVN_ASP_DOT_NET_HACK environment variable and then log out and back in again (or restart explorer.exe and TSVNCache.exe).