svn-del.exe

svn-del.exe removes all .svn directories from a copy of a development – the PhoneBook project, for example.

This tool can be used for

  • turning a copy of the PhoneBook project into a .zip file for distribution
  • deploying the PhoneBook on a web server
  • for removing the .svns from the scratch directory created by newversion.cmd
How svn-del.exe works

The method CollectSvns scours all subdirectories from a given root directory. All sub-directories named .svn are added to the list of directories that will be deleted. The method is recursive, the .svn directories are collected in the method's accu, an
argument of CollectSvns.

Each .svn sub-directory in the list is treated in the following way (method SvnEmptyDelete:

  • all files in that directory have their read-only attribute removed (empty)
  • the directory is then deleted (delete)

Since every .svn directory contains sub-directories, each sub-directory must be treated in the same way (methods EmptyFiles and DeleteDirectories):

  • remove all files after clearing all their attributes (what includes the read-only attribute)
  • delete the empty directory

This works recursively, of course. Note that SvnEmptyDelete throws an exception if the specified root directory is not a directory named .svn. In this regard it is different from the similar method SvnEmptyDelete.

Another error condition is running svn-del for a directory under C:\Development. Since this is (by rubicon convention) the development tree with real projects, not copies of projects, svn-del refuses to work on any directory in that tree.