Re: Help with importing all CVS projects (tags, branches and trunks)
Michael Haggerty <[email protected]>
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.user |
|---|---|
| Message-ID | <[email protected]> |
Mark-E wrote:
> I am working on a CVS to SVN Migration and I am working with the cvs2svn
> script.
> It works well except the default behavior creates the repository different
> than how I want.
>
> tags
> --- project A
> --- project B
>
> branches
> --- project A
> --- project B
>
> trunk
> --- project A
> --- project B
>
> When I import all my CVS code, I would prefer the repository be setup as
> follows:
>
> project A
> --- trunk
> --- tags
> --- branches
>
> project B
> --- tags
> --- branches
> --- trunk
>
> I see with the optionsfile I can do this however the instructions show how
> to do it listing individual projects in CVS. I have several hundred projects
> that I want to setup like this. That would take a lot of time to list all of
> the projects.
>
> Has anyone does this or does anyone know if you can easily import in this
> format globally?
> It is just not clear to me from the instructions on how or if I can do this
> w/out explicitly listing all projects in the options file.
The options file is Python code, so you can just write a loop in Python:
projects = [
'A',
'B',
'C',
# ...
]
for project in projects:
run_options.add_project(
r'test-data/main-cvsrepos/' + project,
trunk_path=(project + '/trunk'),
branches_path=(project + '/branches'),
tags_path=(project + '/tags'),
# ...
)
If you want to get really fancy, you could read the project names out of
a data file. Or even by listing the directories inside your main CVS
repository:
import os
cvs_repo_main_dir = r'test-data/main-cvsrepos'
projects = os.listdir(cvs_repo_main_dir)
projects.remove('CVSROOT') # Probably don't want to convert CVSROOT!
for project in projects:
# ...
Michael
------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1670&dsMessageId=2393188
To unsubscribe from this discussion, e-mail: [[email protected]].