This is not designed to be easy to do, since Subversion is a source control repository, but it’s possible.
We had a large file added to our repository by a new guy, who will not since do such a thing again, and it’s not a big deal except that we do backups every day, and we’d rather just keep the damned thing out of the backups and out of permanent or volatile storage in general.
In our specific case:
- You are doing this on a DOS system (which is why I’m blogging it)
- You have required privs on the Subversion server (probably admin-level, or at least read/write privs in the filesystem)
- Your Subversion server is running (check your Services for SVNService running)
- Repository exists at
- You have a temp directory somewhere where you have lots of room to put your various versions of the Repository Dump (in our case,
- Our Subversion repository is called
- Your offending file is at path
/SPS/bad_file.txtin the repository
- Dump your whole repository to your temporary working area:
svnadmin dump "C:\Subversion_Repos\SPS" > "C:\Temp\Subversion_Rebuild\dump_for_filter_operation"
- Get spammed a line per revision in your repository. (i.e.
* Dumped revision 0.,
* Dumped revision 1., etc.)
- Use svndumpfilter to filter your bad file out of your dump and into a truncated dump file:
type "C:\Temp\Subversion_Rebuild\dump_for_filter_operation" | svndumpfilter exclude "/SPS/bad_file.txt" > "C:\Temp\Subversion_Rebuild\filtered_dump_file"(Note: UNIX’s
- Create a new repository (if you’re feeling daring, just delete the old one, but for my money, I’d probably do a hot backup of the old one just because and archive both the recent dump and the hot backup somewhere else for safekeeping until I was sure the new filtered copy worked):
svnadmin create "C:\Subversion_Repos\SPS2"
- Load filtered dump file into the new repository:
svnadmin load "C:\Subversion_Repos\SPS2" < "C:\Temp\Subversion_Rebuild\filtered_dump_file"
- Get spammed by load operation
- Test your Subversion repository and make sure it's working
You should be done!