views:

223

answers:

1

I am working with a legacy VSS repository which was transferred over to a new SVN repository a few months ago. In the meantime, before we go live with the SVN repository, we need to bring over all the changes that have happened on the VSS one between then and now.

I was looking at different ways to do this which seem to be things such as:

1.) svn_load_dirs.pl then merge the files manually? 2.) svn import straight into the trunk and merge files manually 3.) checkout a working copy of my SVN repository, copy in the changed files which will overwrite some of the ones in my working copy then commit the changes.

My question is, can any of these options be used (or any other options) to automate things so that I don't have to merge the files, and can instead just overwrite them? I think only Option 3 would do this but any help is appreciated.

A: 

Have you done anything with the code in the VSS repository since you first imported it? If not, then I would probably delete the whole Subversion repository, then reimport the code in VSS back into a fresh Subversion repository. That way you'll preserve all the VSS history without having to write a one-off import script to pull in just the changes since the last import.

To be extra sure, you could make the entire VSS repository read-only (so nobody accidentally modifies it) before you do the import into Subversion.

Greg Hewgill
Thanks Greg. The code in the VSS repository has been our main source control system since we did the import to SVN and so SVN reflects the source control as it was back in November whereas VSS has all the changes since then, and it is these changes I want to bring over. From what I have been told, a full delete and reimport would take almost a week to run which isn't ideal for our situation. There are about 7000 files which have changed and maintaining VSS history isn't a show-stopper.Any thoughts?
Andy Strang
In that case, using `svn_load_dirs.pl` is probably the least error-prone way to do that. It will automatically handle any new added files or old removed files, as well as changes to existing files. Be aware, though that `svn_load_dirs.pl` is a powerful, slightly quirky command and it will pay to do a trial run before doing the real thing. I recommend creating a *copy* of your entire Subversion repository (just a full directory copy will do fine) and trying the update with the copy first. Once you get the options right, then do it on your real repository.
Greg Hewgill
Wouldn't I need to manually merge 7000 files though as the VSS files I am bringing over are the ones that have changed? How can we get around this?
Andy Strang
You said that the files in Subversion haven't changed since the last time they were imported from VSS. If that is true, then there is no merging required, manual or otherwise. Essentially, just overwrite what's in Subversion with whatever's in VSS right now.
Greg Hewgill
Ah, I think I have been being stupid all along. I have been obsessing about merges since I was putting together a tutorial on merging recently when they clearly shouldn't be an issue here! Thanks Greg - will let you know how things go!
Andy Strang
One more thing. If I try and use SVN import, it fails as there is already a file (or 7000) with that name in the repository. Will svn_load_dirs.pl have the same problem or can it overwrite files with the same name?
Andy Strang
`svn_load_dirs.pl` is designed for precisely what you want to do. On the other hand, `svn import` assumes an empty destination.
Greg Hewgill