Description
(This was reported by @jun66j5 on twitter, in Japanese language, with larger example.)
It seems cvs2svn cannot handle some RCS files which contains "a" command with in complete (not end with '\n') line before the last line in the target file.
Here is an example file irregular.txt,v
:
head 1.5;
access;
symbols;
locks; strict;
comment @# @;
1.5
date 2021.11.26.04.16.45; author futatuki; state Exp;
branches;
next 1.4;
1.4
date 2021.11.26.04.14.23; author futatuki; state Exp;
branches;
next 1.3;
1.3
date 2021.11.26.03.46.06; author futatuki; state Exp;
branches;
next 1.2;
1.2
date 2021.11.26.03.41.39; author futatuki; state Exp;
branches;
next 1.1;
1.1
date 2021.11.26.03.34.28; author futatuki; state Exp;
branches;
next ;
desc
@create a new file irregular.txt
@
1.5
log
@r1.5:
@
text
@aaa
bbb
ccc
hhh@
1.4
log
@r1.4:
@
text
@d4 1
a4 1
ggg@
1.3
log
@r1.3: s/eee/fff/
@
text
@d3 1
a3 1
fff@
1.2
log
@r1.2: s/ddd/eee/
@
text
@d3 1
a3 1
eee@
1.1
log
@r1.1
@
text
@d3 1
a3 1
ddd@
For each revision diff text, the last 'a' command adds incomplete line. Especially in r1.3 from r1.4, this diff text replaces an existing comlete line into an incomplete line, and as a result, this line connect the next existing line (although I don't believe CVS/RCS can produce such a curious diff, but there exists other than this in a real use case, and CVS/RCS can handle it).
With a sample CVS repository contains this irregular.txt,v
only (except RCSROOT), cvs2svn produces an error:
$ cvs2svn -s irregular-rcs-test-broken.svn /home/cvs/irregular-rcs-test
Writing temporary files to '/tmp/cvs2svn-Tlxzju'
Be sure to use --tmpdir='/tmp/cvs2svn-Tlxzju' if you need to resume this conversion.
----- pass 1 (CollectRevsPass) -----
Examining all CVS ',v' files...
/home/cvs/irregular-rcs-test/irregular.txt,v
/home/cvs/irregular-rcs-test/CVSROOT/checkoutlist,v
...
Starting Subversion r7 / 7
ERROR: Malformed RCS delta in /home/cvs/irregular-rcs-test/irregular.txt,v, revision 1.5: Deletion beyond file end
With the incomplete Subversion repository irregular-rcs-test-broken.svn
, r1.1 to r1.4 revision files of irregular.txt exactly equal to ones of original CVS repo's.
Although I also think those RCS delta was malformed, I think it is better to continue to build new revisions for Subversion repo, because newer revision files before mailformed delta are correct files.
I'll submit a PR for the issue.