We have been doing a bit of repository hopping at work and, as a kludge, I am trying to rewrite some of the old history into a new repository we will be working in. How can I reload an SVN dumpfile into an existing directory in a repository?
I have already done an svnadmin dump
of the old trunk and branches I want to move. I have processed them to remove the trunk
and branches/myBranch
prefixes from the paths in the dumpfiles. I have also loaded one into newRepo/fromOldRepo_ref/development
.
$ svn copy --parents file://`pwd`/newRepo/fromOldRepo_ref/development@172 file://`pwd`/newRepo/fromOldRepo_ref/features/2169 -m "Branch to 2169 reference branch"
Committed revision 182.
$ svnadmin load --parent-dir fromOldRepo_ref/features/2169 newRepo < dumpfile
<<< Started new transaction, based on original revision 2171
svnadmin: E160020: File already exists: filesystem 'newRepo/db', transaction '182-53', path 'fromOldRepo/features/2169'
* adding path : fromOldRepo/features/2169 ...
I then did the above branch from newRepo/fromOldRepo_ref/development@172
to newRepo/fromOldRepo_ref/features/2169
. After that I want to create more commits in 2169
by loading another dumpfile, but it errs as shown above. Can this be resolved?
Going forward, I know that there are many other real fixes to our procedures, tools, and practices that would avoid me wanting to do this in the future. But at present, that doesn't help. :]
While the --deltas
option is not compatible with svndumpfilter
, --incremental
is. --deltas
stores each commit as a delta in the dump file and thus saves disk space. --incremental
captures the first entry as a conceptual delta (as opposed to just saving disk space) thus allowing the contents of a directory to be loaded from the dump file into an existing directory. When that first commit included changes to the folder properties, I also had to change the contents of the dump file to a change type of change
rather than add
.