{"thread":{"id":"3515","subject":"[PATCH] cvsserver: Eclipse compat -- now \"compare with latest from HEAD\" works","startedAt":"2006-03-02T05:42:01Z","lastAt":"2006-03-02T05:42:01Z","messageCount":1,"participants":["Martin Langhoff"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"17018","messageId":"1141278121670-git-send-email-martin@catalyst.net.nz","threadId":"3515","inReplyTo":null,"subject":"[PATCH] cvsserver: Eclipse compat -- now \"compare with latest from HEAD\" works","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2006-03-02T05:42:01Z","receivedAt":"2006-03-02T05:42:01Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"The Eclipse client uses cvs update when that menu option is triggered.\nAnd doesn't like the standard cvs update response. Give it *exactly* what\nit wants.\n\nAnd hope the other clients don't lose the plot too badly.\n\n---\n\nOr pull from my cvsserver branch\n\n---\n\n\n git-cvsserver.perl |   27 ++++++++++++++++++++++++---\n 1 files changed, 24 insertions(+), 3 deletions(-)\n\n3d9afa6824c09083b26c4d371fee54acd1216bba\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex d641c03..7b3ba1b 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -714,8 +714,27 @@ sub req_update\n \n         #$log->debug(\"Target revision is $meta->{revision}, current working revision is $wrev\");\n \n-        # Files are up to date if the working copy and repo copy have the same revision, and the working copy is unmodified _and_ the user hasn't specified -C\n-        next if ( defined ( $wrev ) and defined($meta->{revision}) and $wrev == $meta->{revision} and $state->{entries}{$filename}{unchanged} and not exists ( $state->{opt}{C} ) );\n+        # Files are up to date if the working copy and repo copy have the same revision,\n+        # and the working copy is unmodified _and_ the user hasn't specified -C\n+        next if ( defined ( $wrev )\n+                  and defined($meta->{revision})\n+                  and $wrev == $meta->{revision}\n+                  and $state->{entries}{$filename}{unchanged}\n+                  and not exists ( $state->{opt}{C} ) );\n+\n+        # If the working copy and repo copy have the same revision,\n+        # but the working copy is modified, tell the client it's modified\n+        if ( defined ( $wrev )\n+             and defined($meta->{revision})\n+             and $wrev == $meta->{revision}\n+             and not exists ( $state->{opt}{C} ) )\n+        {\n+            $log->info(\"Tell the client the file is modified\");\n+            print \"MT text U\\n\";\n+            print \"MT fname $filename\\n\";\n+            print \"MT newline\\n\";\n+            next;\n+        }\n \n         if ( $meta->{filehash} eq \"deleted\" )\n         {\n@@ -727,7 +746,8 @@ sub req_update\n             print \"Removed $dirpart\\n\";\n             print \"$filepart\\n\";\n         }\n-        elsif ( not defined ( $state->{entries}{$filename}{modified_hash} ) or $state->{entries}{$filename}{modified_hash} eq $oldmeta->{filehash} )\n+        elsif ( not defined ( $state->{entries}{$filename}{modified_hash} )\n+\t\tor $state->{entries}{$filename}{modified_hash} eq $oldmeta->{filehash} )\n         {\n             $log->info(\"Updating '$filename'\");\n             # normal update, just send the new revision (either U=Update, or A=Add, or R=Remove)\n@@ -763,6 +783,7 @@ sub req_update\n             # transmit file\n             transmitfile($meta->{filehash});\n         } else {\n+            $log->info(\"Updating '$filename'\");\n             my ( $filepart, $dirpart ) = filenamesplit($meta->{name});\n \n             my $dir = tempdir( DIR => $TEMP_DIR, CLEANUP => 1 ) . \"/\";\n-- \n1.2.4.g09a27-dirty\n"}]}