tags:

views:

121

answers:

2

Hello!

I'm converting a large, multi-project CVS repository into Subversion using cvs2svn. It's working really nicely, but there are a few CVS projects that really ought to be branches of other projects.

Using an options file I'm able to specify that the trunk of project 'ShouldBeBranch' should be placed in '/OtherProject/branches/ShouldBeBranch', but I can't find a way of avoiding creating Subversion directories for the tags and branches of the ShouldBeBranch project (which are empty, but still created).

The only option I can see at the moment is to delete the directories from Subversion once the conversion has completed, but I was wondering if anyone knew a way that this could be done within the conversion process? I'm also looked at the symbol hints file, but with 270 projects specifying a project by index number looks too difficult!

Many thanks, David

+1  A: 

Doing the fixups after the import seems like the best thing to me. If you svn move project\trunk of a project to branch\something, Subversion will just track history.

This blog post describes a way to do rename paths using a dump/load cycle. This way will change history, such that when you look back at the history of files it would seem that they have always been inside branch\something.

If you were to go back to the old version, you would expect it to be in project\trunk. Therefore I don't think it's a good thing to try to change history.

Sander Rijken
+2  A: 

Presumably your "ShouldBeBranch" project itself has branches and tags. Where do you want those to end up?

If you only want the trunk of the "ShouldBeBranch" project to be included in the conversion:

  • exclude all other symbols from the "ShouldBeBranch" project
  • set its trunk_path to a path within the other project
  • set the branches_path and tags_path to None in your options file (this prevents them from being created)

The part of your options file that adds the "ShouldBeBranch" project will thus contain lines like this:

run_options.add_project(
    # ...
    trunk_path='OtherProject/branches/ShouldBeBranch',
    branches_path=None,
    tags_path=None,
    # ...
    symbol_strategy_rules=[
        ExcludeRegexpStrategyRule(r'.*'),
        ],
    )
mhagger
ShouldBeBranch actually doesn't have any branches or tags of its own, so I think the "None" solution will do the trick... I'd not seen that anywhere!Thanks, David
David Oakley
Hi there mhagger,I'm using cvs2svn 2.1.1, which is the package available in Ubuntu 9.04. With that version, cvs2svn throws an exception when it tries to split the path:Traceback (most recent call last):... File "/var/lib/python-support/python2.6/cvs2svn_lib/common.py", line 115, in path_split pos = path.rfind('/')AttributeError: 'NoneType' object has no attribute 'rfind'Exception AttributeError: "'NoneType' object has no attribute 'error'" in <bound method Popen.__del__ of <subprocess.Popen object at 0x86e72cc>> ignoredIs that something that has changed in 2.2.0? Thanks!
David Oakley
Upgraded to latest release of cvs2svn (version 2.2.0), and mhagger's suggestion now works perfectly: no spurious directories created. Many thanks!
David Oakley