Monday, October 20, 2008
Just reinstalled Windows recently on my desktop system and last night I went looking around for an easier to manage SVN server for Windows and that's how I found VisualSVN server, which seems to be what I was looking for. While late and tired (blaming yourself for being a dumb**s is never the first option) I setup the app to store the repositories in the same folder where I had the original repository and then started importing the old repository in the same place with the same name, SVN_ROOT - I know, what are the odds for that happening again to someone else, right? statistics show that if something stupid is possible to do, someone else will most likely do it again, and then this post will prove very useful :-) Basically VisualSVN worked for a few good minutes in a loop and created a deep structure like this...
... which btw, you can't delete cause most Microsoft tools are compiled with MAX_PATH = 260 chars - Microsoft KB 177665. What to do? Tried a few tools, spent a half an hour on the net and luckly I found this post on David Cumps' blog - big thanks to James C-S and Kenny for a clever solution using Robocopy with /MIR (or /PURGE) parameters to basically mirror a blank folder on top of the folder you want to remove - in my case:
ROBOCOPY D:\empty D:\SVN_ROOT\SVN_ROOT /MIR
I believe robocopy is included with Vista and Windows 2008 Server - for XP and 2003 Server, you find it as part of the Windows 2003 Resource Kit Tools.