rcls / crap

Cvs Remote Access Program
GNU General Public License v3.0
46 stars 12 forks source link

crap-clone gives up when encountering "malformed version" #7

Closed egassemcinatas closed 10 years ago

egassemcinatas commented 10 years ago

I am trying to convert the repository of privoxy. crap-clone chokes on a file it regards as malformed:

$ crap-clone  :pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa  current
Pserver 'anonymous'@'ijbswa.cvs.sourceforge.net':'2401' '/cvsroot/ijbswa'
Password 'A'
Logged in successfully
Valid-requests Root Valid-responses valid-requests Repository Directory Max-dotdot Static-directory Sticky Entry Kopt Checkin-time Modified Is-modified UseUnchanged Unchanged Notify Questionable Argument Argumentx Global_option Gzip-stream wrapper-sendme-rcsOptions Set Gssapi-authenticate expand-modules ci co update diff log rlog add remove update-patches gzip-file-contents status rdiff tag rtag import admin export history release watch-on watch-off watch-add watch-remove watchers editors init annotate rannotate noop version
Log (/cvsroot/ijbswa/current/doc/source/Attic/announce.sgml,v) has malformed version 2.0

It would be nice if such files could at least be ignored (automatically or by an option or a blacklist) so the import could proceed.

rcls commented 10 years ago

Aaarrrggghhhh... normally CVS uses a 0 in the revision number to indicate start-of-branch (e.g., 1.2.0.2 starts the 1.2.2 branch). But it looks like n.0 is special, and 2.0 should just follow on from the last 1.x version. CVS was written by an infinite collection on monkeys typing at random with instructions to make everything as inconsistent and obfuscated as possible. In this case, the correct thing to do is fix crap-clone rather than blacklist around it. (Although in general having the ability to blacklist files would be useful). I'll see what I can do ... in the mean time, I believe that sourceforge allows you to download a tarball of the cvs repo. You grab that, remove the announce.sgml,v file (or just edit it), and then run crap-clone locally. (That will be much more efficient in terms of network bandwidth too).

egassemcinatas commented 10 years ago

Thanks for your quick reply, and the hint about downloading the whole repo. Unfortunately a great many (all?) files in that repository have a version 2.0. This is not terribly urgent from my point of view; I will put it off until crap-clone can deal with these versions.

rcls commented 10 years ago

Could you try the n-dot-zero branch of crap. This should successfully convert your cvs repo. Let me know how it goes.

egassemcinatas commented 10 years ago

This gets farther than before, but later on git fast-import crashes due to "stream ends early", and there is an error from CVS too. This looks like it is a different issue from the version numbers. I have packed the crap-clone command output, git crash report and .git/crap/marks.txt into this archive:

http://volkerschatz.com/tmp/crap-clone-dot0.tgz

The command I used to obtain the CVS repo was:

 rsync -av rsync://ijbswa.cvs.sourceforge.net/cvsroot/ijbswa/* ../privoxy-cvsrepo/
rcls commented 10 years ago

Ok, looks like I'm sending date/times through to CVS in a localized format the server doesn't understand:

Can't parse date/time: 2001-05-18 00:56:17 CEST

As a workaround, try setting TZ=UTC in your environment and rerunning?

I'll fix up the date-time formatting.

rcls commented 10 years ago

Ok, I changed the code to the CVS server as UTC. The n-dot-zero branch now successfully does the conversion for me, with the timezone set to CET.

egassemcinatas commented 10 years ago

It works for me too now.

Thanks a lot for your quick work!