[viewvc-dev] Re: [PATCH] cvs2svn: improve CVSNT compatibility
Michael Haggerty <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Message-ID | <[email protected]> |
Nicolas Nasdrovisky wrote:
> I am currently testing the migration of my CVSNT repositories to SVN,
> using CVS2SVN.
> Everything works fine, except for the handling of the “binary mode”
> (-kb) switch.
>
> Current version of <cvs2svn_rcsparse/common.py> parses the “expand”
> keyword, but on recent CVSNT repositories, the “binary mode” switch is
> located under the “kopt” keyword.
Thanks for the patch.
"expand" appears once in the file header and applies to all revisions of
the file, whereas "kopt" appears in an individual revision descriptor
and only applies to that revision. If we want to support the CVSNT
behavior exactly, I think we would have to change cvs2svn to make it set
the "binary" attribute of the file based on the current revision rather
than only once when the file is first added. On the other hand, one
could argue that most files that are ever set to binary were probably
always binary, though the user perhaps forgot to set the "binary"
attribute when checking in the file. So treating all revisions of such
as file as binary is probably not such a terrible mistake.
I also think that CVSNT supports other "kopt" option values that
standard CVS doesn't use ("u"?). It would help to teach cvs2svn what
these mean, at least as far as whether they indicate that the file
should be treated as binary.
The cvs2svn_rcsparse code is taken from the ViewVC project. All in all,
it would be better if you would submit this first patch there. If it is
accepted there then we would re-import the ViewVC code into cvs2svn, and
then we could start adding better support for revision-wise binary files
to cvs2svn. Therefore I am CCing this email to the
[email protected] mailing list.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
nn080407.patch
(text/plain, 861 B)
Index: cvs2svn_rcsparse/common.py
===================================================================
--- cvs2svn_rcsparse/common.py (revision 4489)
+++ cvs2svn_rcsparse/common.py (working copy)
@@ -256,11 +256,15 @@
# permissions 644;
# hardlinks @configure.in@;
# this is "newphrase" in RCSFILE(5). we just want to skip over these.
+ # keyword "kopt" is however handled to improve compatibility with CVSNT repositories
+ # kopt contains binary mode information, as "expand" keyword does not exist in recent CVSNT repositories
while 1:
token = self.ts.get()
if token == 'desc' or token[0] in string.digits:
self.ts.unget(token)
break
+ if token == 'kopt':
+ self._parse_admin_expand(token)
# consume everything up to the semicolon
self._read_until_semicolon()