threads / discuss / 11477

Trouble importing from public CVS repo

Subject: Trouble importing from public CVS repo

## tl;dr

3 messages between Jan 4, 2008 and Jan 5, 2008.

replies: 2people: 2as markdown or json

Jeff Garzik· Jan 4, 2008, 21:41 UTC · lore
I'm trying to convert this public repo into a git repository:
    :pserver:anonymous@cvs.lysator.liu.se:/cvsroot/unfs3

cvsps seems to produce a nice long list of patchesets for the "unfs3" module, and running

   cvs -d:pserver:anonymous@cvs.lysator.liu.se:/cvsroot/unfs3 co -P unfs3
works as expected.  However, running
   [jgarzik@core unfs3]$ git-cvsimport -v 
-d:pserver:anonymous@cvs.lysator.liu.se:/cvsroot/unfs3 unfs3
produces
Initialized empty Git repository in /spare/repo/unfs3/.git/
Running cvsps...
connect error: Network is unreachable
cvs rlog: Logging unfs3
cvs rlog: Logging unfs3/Config
cvs rlog: Logging unfs3/Extras
cvs rlog: Logging unfs3/contrib
cvs rlog: Logging unfs3/contrib/nfsotpclient
cvs rlog: Logging unfs3/contrib/nfsotpclient/mountclient
cvs rlog: Logging unfs3/contrib/rpcproxy
cvs rlog: Logging unfs3/doc
Fetching LICENSE   v 1.1
New LICENSE: 1416 bytes
Fetching Makefile.in   v 1.1
Unknown: error

This machines and package (git-cvs-1.5.3.3-3.fc7) work just fine with a large number of other CVS repositories [nice work].

	Jeff
Sean· Jan 4, 2008, 23:17 UTC · re: Jeff Garzik · lore

Re: Trouble importing from public CVS repo

On Fri, 04 Jan 2008 16:41:10 -0500 Jeff Garzik <jeff@garzik.org> wrote:

Show 20 quoted lines
> $ git-cvsimport -v -d:pserver:anonymous@cvs.lysator.liu.se:/cvsroot/unfs3 unfs3
> 
> produces
> 
> Initialized empty Git repository in /spare/repo/unfs3/.git/
> Running cvsps...
> connect error: Network is unreachable
> cvs rlog: Logging unfs3
> cvs rlog: Logging unfs3/Config
> cvs rlog: Logging unfs3/Extras
> cvs rlog: Logging unfs3/contrib
> cvs rlog: Logging unfs3/contrib/nfsotpclient
> cvs rlog: Logging unfs3/contrib/nfsotpclient/mountclient
> cvs rlog: Logging unfs3/contrib/rpcproxy
> cvs rlog: Logging unfs3/doc
> Fetching LICENSE   v 1.1
> New LICENSE: 1416 bytes
> Fetching Makefile.in   v 1.1
> Unknown: error
> 
Hi Jeff,

See the same problem here and it has something to do with how files are being fetched from the cvs server. I'm not much inclined to research it further, however the ugly hack below appears to allow the repo to be imported. At least importing the first 10 commits (-L 10) looked okay... Perhaps it's a clue to how the issue could be resolved properly.

HTH, Sean

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 6d8ff93..357665d 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -421,7 +421,7 @@ sub _line {
 			$res += $self->_fetchfile($fh, $cnt);
 		} else {
 			chomp $line;
-			if ($line eq "ok") {
+			if ($line eq "ok" or $line =~ /^error/i) {
 				# print STDERR "S: ok (".length($res).")\n";
 				return $res;
 			} elsif ($line =~ s/^E //) {
-- 
1.5.4.rc2.17.g257f
Jeff Garzik· Jan 5, 2008, 00:40 UTC · re: Sean · lore

Re: Trouble importing from public CVS repo

Sean wrote:
Show 13 quoted lines
> diff --git a/git-cvsimport.perl b/git-cvsimport.perl
> index 6d8ff93..357665d 100755
> --- a/git-cvsimport.perl
> +++ b/git-cvsimport.perl
> @@ -421,7 +421,7 @@ sub _line {
>  			$res += $self->_fetchfile($fh, $cnt);
>  		} else {
>  			chomp $line;
> -			if ($line eq "ok") {
> +			if ($line eq "ok" or $line =~ /^error/i) {
>  				# print STDERR "S: ok (".length($res).")\n";
>  				return $res;
>  			} elsif ($line =~ s/^E //) {
Kick ass, this local hack worked quite well.  Thanks :)
	Jeff

← back to recent threads