You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Tobias Ringström <to...@ringstrom.mine.nu> on 2003/11/11 23:47:03 UTC

[PATCH] Issue 1440 - cvs2svn fails with AttributeError: 'NoneType' object has no attribute 'get'

A lot of people are hitting issue 1440.  I've looked into it and I'd 
like to share some thoughts and a simple patch.

The root of the problem is that a branch can be rooted in a dead CVS 
revision.  This happens if you add a file to a branch that is either 
nonexistant or deleted in the revision where the branch is rooted.  For 
example, if you add a new file in a branch that does not exist in trunk, 
it will be created as version 1.1.2.1, but a dead parent revision 1.1 is 
also created.

When the current code discovers that the parent revision is dead, it 
tries to find a parent in the next older trunk revision.  This works for 
some simple cases, but not for all, and most notably not for the 1.1.2.1 
case above.  The discussion in the issue tracker suggests that cvs2svn 
should have a way to find the youngest older trunk revision where the 
file exists and perform a copy from that revision, and if that fails 
just perform an add.

There are two ways the new file can be created, namely add or merge, and 
there is no way we can know which one, and even if we could somehow find 
out that it was a merge, we couldn't know which revision it was merged 
from.  If we perform a copy with history, we will probably make a 
mistake, and possibly confuse the user a tiny bit.  The obvious solution 
is then to alway do an add and not a copy.

The attached patch performs that, but I need a review from a cvs2svn 
expert to be sure that it really works as intended since I'm more or 
less fumbling in the dark when it comes to cvs2svn.  I've tested it on a 
bunch of repositories, including the cvs2svn tests suite, and it seems 
to do the right thing.  I modified the cvs2svn test 14 to match the new 
behaviour.  Test 16 was also fixed by this change.

It would be great to have issue 1440 fixed in 0.33.

/Tobias

* tools/cvs2svn/cvs2svn.py
   (RepositoryMirror::change_path) Handle branch files with dead parents.
* tools/cvs2svn/run-tests.py
   (phoenix_branch) Do not require copy with history for test to pass.
   Remove the XFail from the phoenix_branch test.