7

I am aware that the whole point of SVN is to never be able to delete anything permanently and my question is not about a "permanent delete" feature or similar.

It has come to my attention that code has been committed to our SVN repo by accident. It's code that belongs to another company and before there are any legal implications, I need to work out a way to remove this code permanently, including all traces of it ever being there.

Note 1: there has been other code revisions since.

Note 2: all the code that needs to be removed is contained under one folder

Note 3: the SVN is hosted with a third party in the cloud (Atlassian).

The way I am thinking now is:

  • Do an SVN dump of all revisions and restore it locally
  • "Delete" all data in the hosted SVN (How do I even do that?)
  • And then sync the revisions on a per folder basis where I exclude the folder in question. I have imported revision history based on folders in the past so I know this is possible.

If there isn't any easier way, how do I delete / empty an entire SVN server or create a new one to replace the current one? Again, since our SVN is hosted with a third party, I can't access the file structure of the server itself but need to rely on SVN commands.

BlueVoodoo
  • 3,626
  • 5
  • 29
  • 37
  • 2
    Even if you delete the hosted SVN files, the 3rd party host will have your old files in their server backups. You can only wish the backups are encrypted and stays that way. You should contact to Atlassian about that. – bmkorkut Jul 06 '12 at 13:27
  • 1
    replace `folder` with `file` and you're there: http://stackoverflow.com/questions/2050475/delete-file-with-all-history-from-svn-repository But the argument of @bmkorkut about backed up files in the cloud is quite valid. If they're doing their backup properly, you'll **never** get the folder out of all copies of your repo – eckes Jul 06 '12 at 13:45
  • @eckes Thanks for that link. svnadmin obliterate would have been nice but I understand why it's not there. I guess I now need to work out how I go about testing this before performing it on our own repo. – BlueVoodoo Jul 06 '12 at 13:55

2 Answers2

2

svndumpfilter is a command-line utility for removing history from a Subversion dump file by either excluding or including paths beginning with one or more named prefixes.

Basically you need to make a complete dump of repository, filter unwanted folders out of it, and import the rest as new repository. But since your repository is hosted by third party, I guess you need to arrange that kind of repository access first (unless they already provide some interface for that).

hamstergene
  • 24,039
  • 5
  • 57
  • 72
  • Thanks for your answer. Wasn't aware of svndumpfilter, that will save me some time when importing it back at least. – BlueVoodoo Jul 06 '12 at 13:57
0

For #1 and #3 in your plan you may find useful svnrdump utility. It has commands "dump" and "load" just like svnadmin, but can work with remote repositories.

maxim1000
  • 6,297
  • 1
  • 23
  • 19