Re: CVS2SVN import from CVSNT

Michael Haggerty <[email protected]> Tue, 09 Jul 2013 12:21:20 +0200
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <[email protected]>
On 07/08/2013 07:16 PM, Sean Ryan wrote:
>   I too am trying to use cvs2svn against a cvsnt repo..  I have read
> other articles on it, and have seen the issues (and also some of the
> patches).  The patches that I found after coding this one share one
> thing in common, they either use all or one of the kopt flags for the
> entire file..  I chose a different method, I choose simply to see if
> binary was EVER used on this file. If so, I treated it as binary.  (it
> would be good to create a log of file that have heterogeneous flags, but
> that was a bit beyond my grasp of python in the time I wanted to take.. :) )
> 
> I'd love to know what you think about this..  
> 
> This is my fix from common.py:
> 
>     while 1:
>       token = self.ts.get()
>       if token == 'desc' or token[0] in string.digits:
>         self.ts.unget(token)
>         break
>       elif token == 'kopt':
>         # Added By Sean Ryan to import CVSNT kopt flags:, if ever a
> binary, always a binary
>         tokenvalue = self.ts.get()
>         self.ts.unget(tokenvalue)
>         if tokenvalue == 'b':
>           self._parse_admin_expand(token)
>           self.ts.unget(';')
>       # consume everything up to the semicolon
>       self._read_until_semicolon()

Thanks for your suggestion.

(In the future, please post your changes as "diff -u" output to make it
easier to see what you have changed.)

Yes, this (like other schemes that have been proposed) is better than
nothing, even though it is not the 100% correct solution.  But for
something like this to be mergeable into cvs2svn, in my opinion it would
have to be implemented more cleanly:

* The changes in cvs2svn_rcsparse would have to be acceptable to the
ViewVC project (from which that code is borrowed), so they have to
provide a reasonable interface that is not cvs2svn-specific.  Probably
either Sink should have a separate callback function for newphrases (or
even multiple callbacks that are called depending on where the newphrase
was found), or the Sink.define_revision() callback needs an extra
parameter to which any newphrases that were found are passed.

* *Then* cvs2svn_lib.collect_data._FileDataCollector could be changed to
implement some policy based on the kopt newphrases passed to it.

By the way, if rcsparse were taught about newphrases, another obvious
application would be to take advantage of the commitid data that newer
versions of CVS (and CVSNT) store in commits.  Using that info might
give better changesets in some cases.

Michael

-- 
Michael Haggerty
[email protected]
http://softwareswirl.blogspot.com/

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=3060074

To unsubscribe from this discussion, e-mail: [[email protected]].