Question

I was wondering if I right click on a file in the SVN repo browser, does it get permanently deleted? can it be recovered?

Was it helpful?

Solution

This question/answer from the SVN FAQ might interest you :

How do I completely remove a file from the repository's history?

There are special cases where you might want to destroy all evidence of a file or commit. (Perhaps somebody accidentally committed a confidential document.) This isn't so easy, because Subversion is deliberately designed to never lose information. Revisions are immutable trees which build upon one another. Removing a revision from history would cause a domino effect, creating chaos in all subsequent revisions and possibly invalidating all working copies.

The project has plans, however, to someday implement an svnadmin obliterate command which would accomplish the task of permanently deleting information. (See issue 516.)

In the meantime, your only recourse is to svnadmin dump your repository, then pipe the dumpfile through svndumpfilter (excluding the bad path) into an svnadmin load command.

If it's that hard, there are little chances it can be done easily from Tortoise SVN...
(And it's not the goal of Source Control...)

OTHER TIPS

You'll find that you can only delete from the Repo Browser when you are viewing the HEAD revision. This is identical to deleting a file from your working copy and then checking in the delete. In both cases, you'll be able to restore from the previous revision.

Deleting a file via the repo-browser context menu basically creates a new global revision where just that file was deleted, so it appears in the log as such - you can always revert to that revision to get the file back, or you can just pull it directly from the repository into your working copy.

No... Deleting a file (even using the repo browser) only affects working copies. It would be a pretty lousy revision control system if you couldn't recover a file from the past. It is actually pretty difficult to modify files in a committed revision, even if you have root access to the server.

Doesn't right-click just bring up some sort of menu? And with SVN is that you can always revert anyways.

I deleted a top level directory from Repo Browser by accident and the only way to get it back was the following:

  • Export the top level folder from a previous version history
  • Make a new folder in the repository to replace the one deleted.
  • Add the exported files back to the new directory (same name as previous)
  • Update the working copy, it will delete and then re-add the same files.

Its annoying but at least the working and repo will be back in sync. The "Revert Changes from this Revision" didnt work for undoing repo deletes, it only reverts in working directory not the "Undo" the delete to the repository.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top