I have a branch in a badly structured svn repo that needs to be stripped out and moved to another svn repository. (I'm trying to clean it up some).
If I do an svn log
and not stop on copy/rename I can see all 3427 commits that I care about. Is there some way to dump the revisions out, short of writing some major scripts?
I would follow the advice in this question but this branch has been moved all over the place and I would like to preserve the moves as well.
I guess this might be similar to what @ZacThompson (and @Pekka) mean: I think
svndumpfilter
is your friend.From your question I think you have the idea what it is meant to do but struggle with the copying/moving of the branch all over the place? An answer to that can be found in the before mentioned SVN Documentation, I believe:
Meaning: make
svndumpfilter
include all paths the branch ever lived at. Or am I missing something?Another possibility might be the
svndumpfilter2
mentioned by @compie in the thread you linked although I believe it is not even necessary (and I don't know either of @compie orsvndumpfilter2
).You need to use HotCopy to backup the repository directory. Then it should be a matter of simply restoring the repository.
You will want to use some combination of:
If you want to do the whole branch, you may not even need svndumpfilter. But if you do:
http://svnbook.red-bean.com/nightly/en/svn.reposadmin.maint.html#svn.reposadmin.maint.filtering
There is another solution that is pretty simple and solves the "preserve the moves" issue. Please see the last paragraph of the Apache Subversion FAQ entry "How do I completely remove a file from the repository's history?". The solution does not rely on the
svndumpfilter
.You can perform the following steps:
Configure path-based authorization rules to deny read access for a USERNAME account to the PATHS of the file or a folder you want to remove from repository history.
Please note the plural noun paths. The file or folder you want to get rid of could have different names or can be located in different places across a repository history. Please consider this when setting up deny rules.
Create an empty repository,
Replicate the source repository with
svnsync
tool to the target repository under account USERNAME. For details on repository synchronization withsvnsync
please refer to SVNBook chapter "Repository Replication".Unlike
svndumpfilter
,svnsync
automatically translatessvn copy
operations with an unreadable source path into normal additions, which is useful if history involves copy operations and still needs to be filtered. :)