{"thread":{"id":"3509","subject":"[PATCH] cvsserver: Checkout correctly on Eclipse","startedAt":"2006-03-02T00:58:57Z","lastAt":"2006-03-02T00:58:57Z","messageCount":1,"participants":["Martin Langhoff"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16999","messageId":"11412611372638-git-send-email-martin@catalyst.net.nz","threadId":"3509","inReplyTo":null,"subject":"[PATCH] cvsserver: Checkout correctly on Eclipse","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2006-03-02T00:58:57Z","receivedAt":"2006-03-02T00:58:57Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"Initial checkouts were failing to create Entries files under Eclipse.\nEclipse was waiting for two non-standard directory-resets to prepare for a new\ndirectory from the server.\n\nThis patch is tricky, because the same directory resets tend to confuse other\nclients. It's taken a bit of fiddling to get the commandline cvs client and\nEclipse to get a good, clean checkout.\n\nSigned-off-by: Martin Langhoff <martin@catalyst.net.nz>\n\n\n---\n\nHeh! Using git-format-patch I make sure I don't send you stray spaces ;-)\n\n(actually, I am back to using cperl-mode which highlights trailing ws)\n\nI'll rewind/reset my 'cvsserver' branch so it's all clean and you can pull\nfrom it and not fear white space monsters.\n\ncheers,\n\n\nmartin\n---\n\n git-cvsserver.perl |   33 ++++++++++++++++++++++++++-------\n 1 files changed, 26 insertions(+), 7 deletions(-)\n\n6a6ad59c4979e88e7f2a7b0997a3eb9fa115d6a7\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 3c588c9..d641c03 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -571,8 +571,19 @@ sub req_co\n     my $updater = GITCVS::updater->new($state->{CVSROOT}, $module, $log);\n     $updater->update();\n \n+    $checkout_path =~ s|/$||; # get rid of trailing slashes\n+\n+    # Eclipse seems to need the Clear-sticky command\n+    # to prepare the 'Entries' file for the new directory.\n+    print \"Clear-sticky $checkout_path/\\n\";\n+    print $state->{CVSROOT} . \"/$checkout_path/\\n\";\n+    print \"Clear-static-directory $checkout_path/\\n\";\n+    print $state->{CVSROOT} . \"/$checkout_path/\\n\";\n+\n     # instruct the client that we're checking out to $checkout_path\n-    print \"E cvs server: updating $checkout_path\\n\";\n+    print \"E cvs checkout: Updating $checkout_path\\n\";\n+\n+    my %seendirs = ();\n \n     foreach my $git ( @{$updater->gethead} )\n     {\n@@ -585,16 +596,24 @@ sub req_co\n         print \"Mod-time $git->{modified}\\n\";\n \n         # print some information to the client\n-        print \"MT +updated\\n\";\n-        print \"MT text U \\n\";\n         if ( defined ( $git->{dir} ) and $git->{dir} ne \"./\" )\n         {\n-            print \"MT fname $checkout_path/$git->{dir}$git->{name}\\n\";\n+            print \"M U $checkout_path/$git->{dir}$git->{name}\\n\";\n         } else {\n-            print \"MT fname $checkout_path/$git->{name}\\n\";\n+            print \"M U $checkout_path/$git->{name}\\n\";\n         }\n-        print \"MT newline\\n\";\n-        print \"MT -updated\\n\";\n+\n+\tif (length($git->{dir}) && $git->{dir} ne './' && !exists($seendirs{$git->{dir}})) {\n+\n+\t    # Eclipse seems to need the Clear-sticky command\n+\t    # to prepare the 'Entries' file for the new directory.\n+\t    print \"Clear-sticky $module/$git->{dir}\\n\";\n+\t    print $state->{CVSROOT} . \"/$module/$git->{dir}\\n\";\n+\t    print \"Clear-static-directory $module/$git->{dir}\\n\";\n+\t    print $state->{CVSROOT} . \"/$module/$git->{dir}\\n\";\n+\t    print \"E cvs checkout: Updating /$module/$git->{dir}\\n\";\n+\t    $seendirs{$git->{dir}} = 1;\n+\t}\n \n         # instruct client we're sending a file to put in this path\n         print \"Created $checkout_path/\" . ( defined ( $git->{dir} ) and $git->{dir} ne \"./\" ? $git->{dir} . \"/\" : \"\" ) . \"\\n\";\n-- \n1.2.3.g67153\n"}]}