cvsserver: Eclipse compat -- now "compare with latest from HEAD" works
The Eclipse client uses cvs update when that menu option is triggered. And doesn't like the standard cvs update response. Give it *exactly* what it wants. And hope the other clients don't lose the plot too badly. Signed-off-by: Junio C Hamano <junkio@cox.net>
Martin Langhoff committed
Mar 2, 2006 at 18:42 UTC
ec58db15a9e1d3377170c9839e509074a8202735
1 file changed
+24
-3
git-cvsserver.perl
+24
-3
@@ -714,8 +714,27 @@ sub req_update
714
715
#$log->debug("Target revision is $meta->{revision}, current working revision is $wrev");
716
717
- # 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
718
- next if ( defined ( $wrev ) and defined($meta->{revision}) and $wrev == $meta->{revision} and $state->{entries}{$filename}{unchanged} and not exists ( $state->{opt}{C} ) );
717
+ # Files are up to date if the working copy and repo copy have the same revision,
718
+ # and the working copy is unmodified _and_ the user hasn't specified -C
719
+ next if ( defined ( $wrev )
720
+ and defined($meta->{revision})
721
+ and $wrev == $meta->{revision}
722
+ and $state->{entries}{$filename}{unchanged}
723
+ and not exists ( $state->{opt}{C} ) );
724
+
725
+ # If the working copy and repo copy have the same revision,
726
+ # but the working copy is modified, tell the client it's modified
727
+ if ( defined ( $wrev )
728
+ and defined($meta->{revision})
729
+ and $wrev == $meta->{revision}
730
+ and not exists ( $state->{opt}{C} ) )
731
+ {
732
+ $log->info("Tell the client the file is modified");
733
+ print "MT text U\n";
734
+ print "MT fname $filename\n";
735
+ print "MT newline\n";
736
+ next;
737
+ }
738
739
if ( $meta->{filehash} eq "deleted" )
740
{
@@ -727,7 +746,8 @@ sub req_update
746
print "Removed $dirpart\n";
747
print "$filepart\n";
748
}
730
- elsif ( not defined ( $state->{entries}{$filename}{modified_hash} ) or $state->{entries}{$filename}{modified_hash} eq $oldmeta->{filehash} )
749
+ elsif ( not defined ( $state->{entries}{$filename}{modified_hash} )
750
+ or $state->{entries}{$filename}{modified_hash} eq $oldmeta->{filehash} )
751
{
752
$log->info("Updating '$filename'");
753
# normal update, just send the new revision (either U=Update, or A=Add, or R=Remove)
@@ -763,6 +783,7 @@ sub req_update
783
# transmit file
784
transmitfile($meta->{filehash});
785
} else {
786
+ $log->info("Updating '$filename'");
787
my ( $filepart, $dirpart ) = filenamesplit($meta->{name});
788
789
my $dir = tempdir( DIR => $TEMP_DIR, CLEANUP => 1 ) . "/";