@matheusbsbs / matheus-bagliano / commits / 8e4c4e7dc3
Fork 0

cvsserver: make the output of 'update' more compatible with cvs.

Native cvs update outputs the string "cvs update: Updating <DIR>" for every directory it processes (to stderr) unless -q or -Q is given on comman-line. This is used, e.g., by emacs pcl-cvs to split files by directory. This commit implements this feature in cvsserver. Signed-off-by: Sergei Organov <osv@javad.com> Acked-by: Martin Langhoff <martin.langhoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sergei Organov committed Dec 7, 2009 at 14:11 UTC 8e4c4e7dc322bf6a2cf468152ea71eff26ebc034
1 file changed +16
git-cvsserver.perl
+16
@@ -981,6 +981,8 @@ sub req_update
981
982 #$log->debug("update state : " . Dumper($state));
983
984 + my $last_dirname = "///";
985 +
986 # foreach file specified on the command line ...
987 foreach my $filename ( @{$state->{args}} )
988 {
@@ -988,6 +990,20 @@ sub req_update
990
991 $log->debug("Processing file $filename");
992
993 + unless ( $state->{globaloptions}{-Q} || $state->{globaloptions}{-q} )
994 + {
995 + my $cur_dirname = dirname($filename);
996 + if ( $cur_dirname ne $last_dirname )
997 + {
998 + $last_dirname = $cur_dirname;
999 + if ( $cur_dirname eq "" )
1000 + {
1001 + $cur_dirname = ".";
1002 + }
1003 + print "E cvs update: Updating $cur_dirname\n";
1004 + }
1005 + }
1006 +
1007 # if we have a -C we should pretend we never saw modified stuff
1008 if ( exists ( $state->{opt}{C} ) )
1009 {