summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Langhoff <martin@catalyst.net.nz>2006-03-01 07:03:58 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-01 09:10:27 (GMT)
commit858cbfbabe4ede5f5eba32041eb7448319e53e2a (patch)
treee7b1bf1429588afd5f62771d8d874e2e252340d6
parent7172aabb4b5a6d0345b3c57f2f7ededece81b9b7 (diff)
downloadgit-858cbfbabe4ede5f5eba32041eb7448319e53e2a.zip
git-858cbfbabe4ede5f5eba32041eb7448319e53e2a.tar.gz
git-858cbfbabe4ede5f5eba32041eb7448319e53e2a.tar.bz2
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.
-rwxr-xr-xgit-cvsserver.perl20
1 files changed, 20 insertions, 0 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 344b2f3..3c588c9 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -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);