user1709746
user1709746

Reputation: 29

How do I remove a large number of revisions from Subversion

I have large repository that I would like to remove the oldest 6,000 revisions. It would be great if I could also remove unneeded groups of revisions in the middle also.

I have figured out how to eliminate the unwanted files and branches, but I am still left a lot of unneeded revisions.

Thanks

Upvotes: 1

Views: 201

Answers (1)

Peter Parker
Peter Parker

Reputation: 29715

You need to use svnadmin dump command you can create a dump file from arbitrary revisions and after this filter it to in/exclude certain paths. The syntax is:

svnadmin dump REPOS_PATH [-r LOWER[:UPPER]] [--incremental]

an example: you want to exclude the revisions 10-99 from your repostory:

svnadmin dump REPOS_PATH -r 0:9  > my_dump_file.dmp
svnadmin dump REPOS_PATH -r 100:HEAD  > my_dump_file.dmp --incremental

There are some problems:

  • changes of files in rev after 100 you have added in rev 10-99 in my example will create an error message you need to remove them from repo before

  • removement of files you use later as copy source will also result in errors in dump files.

Both restrictions you can mostly circumvent but it takes more iterations of dump/filter/load cycles and so more time. It is up to you when your time is up to handle these bordercases.

use svnbook to read detailed info of svnadmin dump and svndumpfilter

Upvotes: 1

Related Questions