From b0ae0c98b0d5bf4b42425799814a9712d66c0073 Mon Sep 17 00:00:00 2001
From: mhagger
If you need to convert certain CVS modules (in one large -repository) to Subversion now and other modules later, -you may want to convert your repository one module at a time. This -situation is typically encountered in large organizations where each -project has a separate lifecycle and schedule, and a one-step -conversion process is not practical. -
- -First you have to decide whether you want to put your converted -projects into a single Subversion repositories or multiple ones. This -decision mostly depends on the degree of coupling between the projects -and is beyond the scope of this FAQ. See the -Subversion book for a discussion of repository organization. -
- -If you decide to convert your projects into separate Subversion -repositories, then please follow the instructions in How can I convert part of a CVS -repository? once for each repository. -
- -If you decide to put more than one CVS project into a single -Subversion repository, then please follow the instructions in How can I convert separate projects in my CVS -repository into a single Subversion repository?. -
- -This question assumes that you will convert all of your projects at +the same time. If you must convert your projects at different times, +please see What if I don't want to convert all +of my projects at once?
+cvs2svn supports multiproject conversions, but you have to use the options file method to start the conversion. In your options file, you simply call @@ -292,21 +265,21 @@ start the conversion. In your options file, you simply call repository. For example, if your CVS repository has the layout:
- /project_a - /project_b + /project-a + /project-b
and you want your Subversion repository to be laid out like this:
- project_a/ + project-a/ trunk/ ... branches/ ... tags/ ... - project_b/ + project-b/ trunk/ ... branches/ @@ -319,10 +292,10 @@ repository. For example, if your CVS repository has the layout:run_options.add_project( - 'my/cvsrepo/project_a', - trunk_path='project_a/trunk', - branches_path='project_a/branches', - tags_path='project_a/tags', + 'my/cvsrepo/project-a', + trunk_path='project-a/trunk', + branches_path='project-a/branches', + tags_path='project-a/tags', symbol_transforms=[ #...whatever... ], @@ -331,10 +304,10 @@ run_options.add_project( ], ) run_options.add_project( - 'my/cvsrepo/project_b', - trunk_path='project_b/trunk', - branches_path='project_b/branches', - tags_path='project_b/tags', + 'my/cvsrepo/project-b', + trunk_path='project-b/trunk', + branches_path='project-b/branches', + tags_path='project-b/tags', symbol_transforms=[ #...whatever... ], @@ -464,6 +437,155 @@ run_options.add_project( information. +What if I don't want to convert + all of my projects at once?
+ +Suppose you need to convert some CVS projects to + Subversion now and other projects later. This + situation is typically encountered in large organizations where each + project has a separate lifecycle and schedule, and a one-step + conversion process is not practical.
+ +First you have to decide whether you want to put your converted + projects into a single Subversion repository or multiple + repositories. This is mostly an administrative decision and is + beyond the scope of this FAQ. + See the + Subversion book for a discussion of repository organization.
+ +If you decide to convert your projects into separate Subversion + repositories, then please follow the instructions + in How can I convert part of a CVS + repository?, once for each repository.
+ +If, on the other hand, you want to convert the CVS projects at + different times but put them into a single Subversion repository, + then you need to follow the instructions in this section.
+ +NOTE: importing projects one at a time into a single + Subversion repository will usually break date-based range commands + (e.g. svn diff -r {2002-02-17:2002-03-18}) for the + overlapping dates. This is because Subversion uses a bisect-based + search to locate commits from a given date, and this algorithm fails + for non-monotonic dates. While this is not the end of the world, it + can be an inconvenience.
+ +Remember that a multiproject Subversion repository should usually + be laid out like this:
+ ++ project-a/ + trunk/ + ... + branches/ + ... + tags/ + ... + project-b/ + trunk/ + ... + branches/ + ... + tags/ + ... ++ +Note that each project has its own top-level directory that + contains trunk, branches, and tags + subdirectories. The procedure is to convert each project separately + to a dumpfile with the following directory structure:
+ ++ project-a/ + trunk/ + ... + branches/ + ... + tags/ + ... ++ +and then to load the dumpfile into the Subversion repository + using svnadmin load.
+ +Example:
+ ++
+ +- If the svn repository doesn't already exist, create it: +
+ ++ svnadmin create /path/to/svnrepos +- Remember to make a backup before starting. Never run + cvs2svn on a live CVS repository--always work on a copy of your + repository.
+ +- Run cvs2svn against one of the projects that you want converted: +
+ + ++ # Create a dumpfile containing the new CVS repository contents + $ cvs2svn --dumpfile=/tmp/project-a.dump \ + --trunk=project-a/trunk \ + --branches=project-a/branches \ + --tags=project-a/tags \ + /path/to/cvsrepo/project-a +- Use svnadmin load to import the dump into the + Subversion repository: +
+ ++ $ cd ~/svndump + $ svnadmin load /path/to/svnrepos </tmp/project-a.dump +- Repeat steps 3 and 4 for each module you want to convert.
+ +Variations:
+ +
+ server/ + project-a/ + project-b/ + client/ + project-c/ + project-d/ ++ + but you want to convert project-a and project-b + at different times. The above recipe will not work, because + svnadmin load would give an error when project-b + tries to create directory server/, because the directory + already exists from when project-a was loaded. The + solution is to convert project-b as a top-level project: +
+ $ cvs2svn --dumpfile=/tmp/project-b.dump \ + /path/to/cvsrepo/project-b ++ but then load it using the --parent-dir option: +
+ $ svnadmin load --parent-dir=project-b /path/to/svnrepos </tmp/project-b.dump ++