Skip to content

Commit 858cbfb

Browse files
Martin LanghoffJunio C Hamano
authored andcommitted
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.
1 parent 7172aab commit 858cbfb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

git-cvsserver.perl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,26 @@ sub req_update
630630

631631
argsplit("update");
632632

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+
633653
# Grab a handle to the SQLite db and do any necessary updates
634654
my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log);
635655

0 commit comments

Comments
 (0)