srnka
srnka

Reputation: 1305

SVN - completely remove revision from SVN server

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?

Upvotes: 12

Views: 13509

Answers (2)

William Leara
William Leara

Reputation: 10697

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.

Upvotes: 14

Milad Naseri
Milad Naseri

Reputation: 4118

You can do either of these two things:

  1. Login to your SVN server, remove the files you don't want there, and logout. This will create another revision, but since it's done via the server interface, there's little chance of things breaking down.
  2. Revert to revision 119, make some small changes, then commit. Resolve all conflicts by accepting yours.

Upvotes: -1

Related Questions