If you ever had a corrupted Subversion repository on your local and the cleanup method wasn't working as it should. Your best bet most of the time depending on the size of the project is to delete all of the svn directories in it and start over fresh. This is a quick and dirty way to do that.
Delete all of svn directories in your project with 2 bat files and 1 NAnt build script.
Your folder structure should resemble something like this.
\ProjectName
\Trunk
\Binaries\NAnt
\Build
\Source
First you need to download NAnt and place it somewhere on the server where you are planning on doing the cleanup. I like to add a binaries directory under my trunk directory and place all of my executables there.
Next you need to create a new NAnt build script with one task and save it in the build directory as clean.build.
clean.build
<?xml version="1.0" encoding="utf-8"?>
<project name="CleanUp" default="build" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<property name="trunk.dir" value="..\" />
<target name="clean" depends="clean.svn.folders" />
<target name="clean.svn.folders">
<echo message="Deleting all svn folders in directory"/>
<delete>
<fileset basedir="${trunk.dir}" defaultexcludes="false">
<include name="**/.svn" />
<include name="**/.svn/**/*" />
</fileset>
</delete>
</target>
</project>
Now create two bat files with notepad
build.bat
..\Binaries\NAnt\bin\nant.exe -buildfile:clean.build %*
clickToBuild.bat
@echo off
:input
cls
set INPUT=
set TARGET=
echo Please choose from the following build options:
echo .
echo 1 = Clean
echo .
set /P INPUT=Please specify your option from above: %=%
if "%INPUT%"=="" goto input
if "%INPUT%"=="1" set TARGET="clean"
if "%TARGET%"=="" goto input
echo .
echo .
echo .
build.bat %TARGET% & pause
Now you should have these files
- Trunk\Build\clean.build
- Trunk\Build\build.bat
- Trunk\Build\clickToBuild.bat
- Trunk\Binaries\Nant\Nant.exe
Now click on the bat file called clickToBuild.bat and select the number 1 to run and that’s it! All of the directories under your trunk named .svn will be deleted.