-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cvs2svn: Got Malformed RCS delta error while reproducing newer revison file from older revision file. #18
Comments
Thanks for the careful report and the research. Your conclusions could be corroborated if you try converting the same file, first with the |
Thank you for the suggestion. Both of with Diff of dump files with CVS and with RCS are just UUID and svn:date of r1.
And with
This was incorrect. Only r1.1 == r3 was the same. All other revisions are broken. After applying PR #19, cvs2svn with |
…t_db. As the return value of RCSStream.invert_diff() is not to be applied for flat text content but for internal logical lines in RCSStream, which may contain some unterminated logical lines at any position, so we should use the content of internal logical lines in RCSStream as base text which is used to get the content of the next newer revision. With this commit, it is implemented by splitting the checkout() method in TextRecord, checkout() method for external use for as in the past and checkout_as_lines() method for internal use. * cvs2svn_lib/checkout_internal.py (TextRecord.checout_as_lines): New method. Replacement of checkout() method but returns internal lines in RCSStream instead of a plain text. (TextRecord.checkout): Use checkout_as_lines() for default implementation. (FullTextRecord.checkout, DeltaTextRecord.checkout): Removed to use default implementation. (FullTextRecord.checkout_as_lines): New method. Just same logic as the past checkout() method. (DeltaTextRecord.checkout_as_lines): New method. Just same logic as the past checkout() method but uses internal lines in rcs_stream instead of its text. (_Sink.set_revision_info): Record the internal lines in rcs_stream instead of its text at revision 1.1. * cvs2svn_lib/rcs_stream.py (RCSStream.__init__): Allow to set lines directly in addition to a text. (RCSStream.get_lines): New method.
(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
: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: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.
The text was updated successfully, but these errors were encountered: