Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN Move code with history between two repositories

I have to work on two repositories and want to move one directory with code between the two while keeping revisionhistory.

I read a few questions here on SO, but am still not sure which way to go. Our Repositories are HUGE (files (orkingcopy) not including revisions>several GB), since everything is checked in (code +designdata + ...).

The solutions I have seen so far are:

  1. svnadmin dump + filter + import: not an option due to repository size
  2. svnsync: We already have data in the second repository (the repositories are huge already, I don't think merging them is a good idea, besides decidng that is not my job), and from what I gathered this requires the second repository to be empty.
  3. Third Party Solution: crashes repeatedly, because it can not delete a file because "another process hast the file opened" (enevthough i can remove the file via the os, and it gets created by the script)

Are there other solutions, approaches to this, or am I missing something about one of the solutions?

like image 843
ted Avatar asked Oct 22 '12 11:10

ted


People also ask

Does svn move keep history?

Moving/renaming in subversion keeps history intact. Save this answer.

What is working copy in svn?

A Subversion working copy is your own private working area, which looks like any other ordinary directory on your system. It contains a COPY of those files which you will have been editing on the website. You can edit these files however you wish, in the usual way.


1 Answers

The svnadmin dump + filter + import works even with large repositories.

There are some things you need to do for performance. Find out which revision was the one that first created the folder you want to copy. Then check the log to find the last revision that modified anything in that folder. You only need to dump revisions in that range.

Use the --incremental flag to svndump.

Do not try to use the Deltas flag with SVN Dump. SvnDumpFilter won't work on dumps created with "deltas". Don't try to save the huge dump to a file and and run SvnDumpFilter on the file. Instead do it in one step with a pipe.

If your start revision was 10000 and your end revision was 20000 and the path you want to copy was projects/source, the command should look like

svnadmin dump --incremental -r10000:20000 YourRepoPath | svndumpfilter include projects/source --drop-empty-revs --renumber-revs > source.dump

Followed by an svnadmin load command to load the dump into your other repo.

like image 183
maddoxej Avatar answered Oct 18 '22 22:10

maddoxej