[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: cvs2svn.py in version 6411

From: Mike Wilcox <mike_at_trouble.org.uk>
Date: 2003-07-11 10:06:03 CEST

kfogel@collab.net wrote:
>
> "It's right."

Thought as much.

>
>
>> 1) When converting our CVS repository, I want to split it into 3
>> SVN repositories, which means I create the repositories first, then
>> loop for each subproject in CVS. This was also to try to keep the
>> tags & branches separate for the different projects.
>>
>> Conversion of the first project into each svn repository works
>> fine, but the subsequent ones fail because the loader, prior to
>> creating 'trunk/<proj>', tries to re-create the 'trunk' directory -
>> which now already exists.
>
>
> I'll need a small, concrete example to understand what this means, I
> think. There are too many possible interpretations. For example, I
> don't know what you mean by "Conversion of the first project into
> each svn repository works fine." At first I thought you were putting
> each project in its own repository, but now it sounds like you're
> trying to put trunk in one repos, branches in another, and tags in a
> third? Or maybe you're using the word "repository" to mean
> "subdirectory within a repository"?...

OK. I realise I explained it in a way that wasn't obvious to understand
- I think I used repository where I meant project in at least one place.

Rather than explain my aims, I can prune the problem down to a similar
example using the test CVS repository:

    tools/cvs2svn/test-data/main-cvsrepos

In my terms, each subdirectory of this would be a 'project'. I want to
divide the projects across 2 SVN repositories. eg:

    proj -> svn-dev
    interleaved -> svn-dev
    full-prune -> svn-archive
    partial-prune -> svn-archive

Initial commands to do this:

   $ cd tools/cvs2svn
   $ mkdir tmp
   $ cd tmp
   $ cvs2svn.py --create -s svn-dev ../test-data/main-cvsrepos/proj
   $ cvs2svn.py -s svn-dev ../test-data/main-cvsrepos/proj/interleaved
   $ cvs2svn.py --create -s svn-archive \
../test-data/main-cvsrepos/full-prune
   $ cvs2svn.py -s svn-archive \
../test-data/main-cvsrepos/proj/partial-prune

The 2nd & 4th cvs2svn commands fail at the start of pass 5:

   ----- pass 5 -----
   loading cvs2svn-dump into svnrepos
   <<< Started new txn, based on original revision 1
        * adding path : trunk ...svn: Item already exists in filesystem
   svn: file already exists: filesystem `svnrepos/db', transaction `k',
path `trunk'

*This* is the problem I was trying (and failing) to relate.

Then...

Because I know that the above commands would jumble the project contents
together inside the SVN repositories, I would have added the "--trunk"
option:

   $ cvs2svn.py --create -s svn-dev --trunk trunk/proj \
../test-data/main-cvsrepos/proj

This results in:

Traceback (most recent call last):
   File "../cvs2svn.py", line 2131, in ?
     main()
   File "../cvs2svn.py", line 2127, in main
     convert(ctx, start_pass=start_pass)
   File "../cvs2svn.py", line 2016, in convert
     _passes[i](ctx)
   File "../cvs2svn.py", line 1980, in pass4
     sym_tracker.finish(dumper, ctx)
   File "../cvs2svn.py", line 1599, in finish
     self.fill_branch(dumper, ctx, name, [1])
   File "../cvs2svn.py", line 1570, in fill_branch
     self.fill_name(dumper, ctx, branch, None, jit_new_rev)
   File "../cvs2svn.py", line 1544, in fill_name
     is_tag, jit_new_rev)
   File "../cvs2svn.py", line 1435, in copy_descend
     dumper.copy_path(src_path, parent_rev, copy_dst, val)
   File "../cvs2svn.py", line 905, in copy_path
     entries)
   File "../cvs2svn.py", line 603, in change_path
     for ent in new_val.keys():
AttributeError: 'NoneType' object has no attribute 'keys'

However, I realise that doing this might have hit your limitation you
mentioned lower down.

Incidentally - if I *also* add the "--branches" option, the fault
disappears.

> Oh my goodness. I think what you're trying may be beyond cvs2svn's
> capabilities right now. I'm interested in supporting it eventually,
> but right now it's more important to fix bugs in the core
> functionality. One of the current issues is that cvs2svn needs
> documentation -- and if it had docs, they'd probably say not to try
> passing multi-component paths as arguments to --trunk, --tags, etc.
> :-)

Then I understand the limitation at least :-)

I will say that I went down the route of using one cvs2svn command per
CVS project *because* of the documentation - it warns that converting a
repository and the CVSROOT directory 'might not be what you wanted'.

But, once you do have one command per project, you really need the 3
options to keep the projects contents, branches & tags separate from
other projects.

However, there are 2 workarounds that I can think of:

1. Issue each project-oriented cvs2svn command, but between each one,
manually re-arrange the SVN repository so that the next project won't
collide, or cause the loader to die.

2. Re-arrange the cvsroot into N separate directories, moving the
projects around as required (so creating N 'new' CVS repositories). Then
issue one repository-oriented cvs2svn command per 'new' CVS repository.

There are probably more...

Cheers,

    Mike

(I've not forgotten the file for the very first problem)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 11 10:29:18 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.