Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN - completely remove revision from SVN server

Tags:

repository

svn

I have unfortunately committed one big folder to SVN (it has about 1.4GB and about 10000 files, many of them binaries). Is there any possibility to get back to previous revision and make SVN server to forget that next revision was done? For example, this commit was revision 120. So I want to make the top revision 119 and to remove all files and SVN db settings of 120. revision.

I have tried delete that folder, so the 121 commit was done. And then I tried to merge the revisions 121 and 119. But it won't helped. The revision 120 is still in the system.

Then I wanted to make a mirror of the SVN repository using svnsync, but there is no option to set up to which revision I wish to make mirror. Unless I didn't find this option. (I would like to set the revisions from 0 to 119).

Do you know what can I do about it? Is there any command for totally remove one revision as it has never happened?

like image 485
srnka Avatar asked Jan 18 '12 12:01

srnka


People also ask

How do I delete a revision in svn?

Right-Click the revision you want to remove NOTE: this is the revision you want to remove, not the one you want to revert to. Select "Revert changes from this revision". Click "Yes" at the prompt. Update the checkout as normal, but to "HEAD".

How do I revert a revision in svn repository?

Right click on the selected revision(s), then select Context Menu → Revert changes from this revision. Or if you want to make an earlier revision the new HEAD revision, right click on the selected revision, then select Context Menu → Revert to this revision.

How do I permanently delete files from svn?

To remove a file from a Subversion repository, change to the directory with its working copy and run the following command: svn delete file… Similarly, to remove a directory and all files that are in it, type: svn delete directory…

What does svn revert do?

Reverts any local changes to a file or directory and resolves any conflicted states. svn revert will revert not only the contents of an item in your working copy, but also any property changes.


1 Answers

You have to dump the repository and then reload it, skipping over the revision you no longer want. (r120 in your example)

To do this, use the svnadmin dump command, followed by the svnadmin load command.

example:

svnadmin dump c:\svn\my_repo -r0:119 > repo.dump
svnadmin load c:\svn\my_new_repo < repo.dump

In more complicated scenarios, you might have to use svndumpfilter, but I don't think that's necessary in your case.

like image 77
William Leara Avatar answered Oct 04 '22 17:10

William Leara