tags:

views:

49

answers:

1

Is it possible to import a directory tree into subversion if a large number of the files already exist in the repository? Many of the files that will be imported will match those in the repository, both in path and content, but some will be older, and some will be newer, and some files will be in either the repo or the imported tree but not the other. Is it possible to do this in such a way that the files getting imported are treated as the head of the repo so that changed, deleted files still maintain their history?

+2  A: 

Here are the steps to get this work easily.

  1. Copy the directory over the svn directory with the option to no overwrite files.
  2. Do a recursive add on all the files in the directory (that will cause the new files to be added to svn.)
  3. Do another copy, the time allow overwrite.
  4. Commit

If you do it like this what will happen, is you will add all your files that didn't exist before in that directory to SVN, then you will overwrite the ones that did exist, which svn will see as a change. You can then check those in. I would do it in these steps to make sure that you separate those two actions, so you can validate they happen correctly independently.

John Sonmez
+1 That seems to do exactly what I was looking for! However, is there an easy way to remove all of the "extra" files? aka, the ones that exist in th repo, but not in the verson want as the head?
cdeszaq