Re: HOWTO have not the <project> sub folder under trunk, branches, tags

Michael Haggerty <[email protected]>
Newsgroups gmane.comp.version-control.subversion.cvs2svn.user
Message-ID <[email protected]>
On 03/08/2011 06:31 PM, Luca Coppolaro wrote:
> I am converting multiple CVS projects to multiple SVN repos (one
> repository for each project).
> 
> I'm using this script (into the options file) to do the batch conversion:
> ##############################################
> import os
> cvs_repo_main_dir = r'../cvs'
> projects = os.listdir(cvs_repo_main_dir + '/')
> projects.remove('CVSROOT')
> 
> for project in projects:
>     run_options.add_project(
>         cvs_repo_main_dir,
>         trunk_path='trunk',
>         branches_path='branches',
>         tags_path='tags',
>     initial_directories=[  ],
>     symbol_transforms=[
>         ReplaceSubstringsSymbolTransform('\\','/'),
>         NormalizePathsSymbolTransform(),
>         ],
>     symbol_strategy_rules=[   ] + global_symbol_strategy_rules,
>     )
> ##############################################
> 
> The resulting svn repository structure is something like that:
> foo \
>     tags \
>         V-1.00 \ foo \ < project files >
>         V-1.01 \ foo\ < project files >
>         V-1.02 \ foo\ < project files >
>     trunk \ foo\ < project files >
> 
> But I would like to remove the trailing < foo > subfolder to have
> something like this:
> 
> foo \
>     tags \
>         V-1.00\ < project files >
>         V-1.01\ < project files >
>         V-1.02\ < project files >
>     trunk\ < project files >
> 
> How can I achieve this?

Each add_project() call should specify the subdirectory of the
repository corresponding only to that project, like

# I assume that projects is a list of string ["foo", "bar", ...]
# containing the names of the projects to be converted.
for project in projects:
    run_options.add_project(
        os.path.join(cvs_repo_main_dir, project),
        trunk_path=('%s/trunk' % project),
        branches_path=('%s/branches' % project),
        tags_path=('%s/tags' % project),
    initial_directories=[  ],
    symbol_transforms=[
        ReplaceSubstringsSymbolTransform('\\','/'),
        NormalizePathsSymbolTransform(),
        ],
    symbol_strategy_rules=[   ] + global_symbol_strategy_rules,
    )

Michael

-- 
Michael Haggerty
[email protected]
http://softwareswirl.blogspot.com/

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1670&dsMessageId=2710332

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.