Skip to content

Commit

Permalink
cvsserver: Eclipse compat - browsing 'modules' (heads in our case) works
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Martin Langhoff authored and Junio C Hamano committed Mar 1, 2006
1 parent 7172aab commit 858cbfb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,26 @@ sub req_update

argsplit("update");

#
# It may just be a client exploring the available heads/modukles
# in that case, list them as top level directories and leave it
# at that. Eclipse uses this technique to offer you a list of
# projects (heads in this case) to checkout.
#
if ($state->{module} eq '') {
print "E cvs update: Updating .\n";
opendir HEADS, $state->{CVSROOT} . '/refs/heads';
while (my $head = readdir(HEADS)) {
if (-f $state->{CVSROOT} . '/refs/heads/' . $head) {
print "E cvs update: New directory `$head'\n";
}
}
closedir HEADS;
print "ok\n";
return 1;
}


# Grab a handle to the SQLite db and do any necessary updates
my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log);

Expand Down

0 comments on commit 858cbfb

Please sign in to comment.