cvsserver: Eclipse compat - browsing 'modules' (heads in our case) works
Eclipse CVS clients have an odd way of perusing the top level of the repository, by calling update on module "". So reproduce cvs' odd behaviour in the interest of compatibility. It makes it much easier to get a checkout when using Eclipse.
Martin Langhoff committed
Mar 1, 2006 at 20:03 UTC
858cbfbabe4ede5f5eba32041eb7448319e53e2a
1 file changed
+20
git-cvsserver.perl
+20
@@ -630,6 +630,26 @@ sub req_update
630
631
argsplit("update");
632
633
+ #
634
+ # It may just be a client exploring the available heads/modukles
635
+ # in that case, list them as top level directories and leave it
636
+ # at that. Eclipse uses this technique to offer you a list of
637
+ # projects (heads in this case) to checkout.
638
+ #
639
+ if ($state->{module} eq '') {
640
+ print "E cvs update: Updating .\n";
641
+ opendir HEADS, $state->{CVSROOT} . '/refs/heads';
642
+ while (my $head = readdir(HEADS)) {
643
+ if (-f $state->{CVSROOT} . '/refs/heads/' . $head) {
644
+ print "E cvs update: New directory `$head'\n";
645
+ }
646
+ }
647
+ closedir HEADS;
648
+ print "ok\n";
649
+ return 1;
650
+ }
651
+
652
+
653
# Grab a handle to the SQLite db and do any necessary updates
654
my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log);
655