@matheusbsbs / matheus-bagliano / commits / c8c4f22025
Fork 0

cvsserver: Checkout correctly on Eclipse

Initial checkouts were failing to create Entries files under Eclipse. Eclipse was waiting for two non-standard directory-resets to prepare for a new directory from the server. This patch is tricky, because the same directory resets tend to confuse other clients. It's taken a bit of fiddling to get the commandline cvs client and Eclipse to get a good, clean checkout. Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>

Martin Langhoff committed Mar 2, 2006 at 13:58 UTC c8c4f220256eb6065e571793f4687c19eb7c6417
1 file changed +26 -7
git-cvsserver.perl
+26 -7
@@ -571,8 +571,19 @@ sub req_co
571 my $updater = GITCVS::updater->new($state->{CVSROOT}, $module, $log);
572 $updater->update();
573
574 + $checkout_path =~ s|/$||; # get rid of trailing slashes
575 +
576 + # Eclipse seems to need the Clear-sticky command
577 + # to prepare the 'Entries' file for the new directory.
578 + print "Clear-sticky $checkout_path/\n";
579 + print $state->{CVSROOT} . "/$checkout_path/\n";
580 + print "Clear-static-directory $checkout_path/\n";
581 + print $state->{CVSROOT} . "/$checkout_path/\n";
582 +
583 # instruct the client that we're checking out to $checkout_path
575 - print "E cvs server: updating $checkout_path\n";
584 + print "E cvs checkout: Updating $checkout_path\n";
585 +
586 + my %seendirs = ();
587
588 foreach my $git ( @{$updater->gethead} )
589 {
@@ -585,16 +596,24 @@ sub req_co
596 print "Mod-time $git->{modified}\n";
597
598 # print some information to the client
588 - print "MT +updated\n";
589 - print "MT text U \n";
599 if ( defined ( $git->{dir} ) and $git->{dir} ne "./" )
600 {
592 - print "MT fname $checkout_path/$git->{dir}$git->{name}\n";
601 + print "M U $checkout_path/$git->{dir}$git->{name}\n";
602 } else {
594 - print "MT fname $checkout_path/$git->{name}\n";
603 + print "M U $checkout_path/$git->{name}\n";
604 }
596 - print "MT newline\n";
597 - print "MT -updated\n";
605 +
606 + if (length($git->{dir}) && $git->{dir} ne './' && !exists($seendirs{$git->{dir}})) {
607 +
608 + # Eclipse seems to need the Clear-sticky command
609 + # to prepare the 'Entries' file for the new directory.
610 + print "Clear-sticky $module/$git->{dir}\n";
611 + print $state->{CVSROOT} . "/$module/$git->{dir}\n";
612 + print "Clear-static-directory $module/$git->{dir}\n";
613 + print $state->{CVSROOT} . "/$module/$git->{dir}\n";
614 + print "E cvs checkout: Updating /$module/$git->{dir}\n";
615 + $seendirs{$git->{dir}} = 1;
616 + }
617
618 # instruct client we're sending a file to put in this path
619 print "Created $checkout_path/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "\n";