cvsserver: further improve messages on commit and status
commit: Also print the old revision similar to how cvs does it and prepend a line stating the filename so that one can actually understand what happened when commiting more than one file. status: Fix the RCS filename displayed. The directory was printed twice. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Frank Lichtenheld committed
Mar 13, 2007 at 18:25 UTC
392e28170bcd2dec93ed629e7f8b2c22c560bf34
1 file changed
+6
-3
git-cvsserver.perl
+6
-3
@@ -1069,6 +1069,7 @@ sub req_ci
1069
$log->info("Created index '$file_index' with for head $state->{module} - exit status $?");
1070
1071
my @committedfiles = ();
1072
+ my %oldmeta;
1073
1074
# foreach file specified on the command line ...
1075
foreach my $filename ( @{$state->{args}} )
@@ -1079,6 +1080,7 @@ sub req_ci
1080
next unless ( exists $state->{entries}{$filename}{modified_filename} or not $state->{entries}{$filename}{unchanged} );
1081
1082
my $meta = $updater->getmeta($filename);
1083
+ $oldmeta{$filename} = $meta;
1084
1085
my $wrev = revparse($filename);
1086
@@ -1207,16 +1209,17 @@ sub req_ci
1209
1210
$log->debug("Checked-in $dirpart : $filename");
1211
1212
+ print "M $state->{CVSROOT}/$state->{module}/$filename,v <-- $dirpart$filepart\n";
1213
if ( defined $meta->{filehash} && $meta->{filehash} eq "deleted" )
1214
{
1212
- print "M new revision: delete\n";
1215
+ print "M new revision: delete; previous revision: 1.$oldmeta{$filename}{revision}\n";
1216
print "Remove-entry $dirpart\n";
1217
print "$filename\n";
1218
} else {
1219
if ($meta->{revision} == 1) {
1220
print "M initial revision: 1.1\n";
1221
} else {
1219
- print "M new revision: 1.$meta->{revision}\n";
1222
+ print "M new revision: 1.$meta->{revision}; previous revision: 1.$oldmeta{$filename}{revision}\n";
1223
}
1224
print "Checked-in $dirpart\n";
1225
print "$filename\n";
@@ -1303,7 +1306,7 @@ sub req_status
1306
}
1307
if ( defined($meta->{revision}) )
1308
{
1306
- print "M Repository revision:\t1." . $meta->{revision} . "\t$state->{repository}/$filename,v\n";
1309
+ print "M Repository revision:\t1." . $meta->{revision} . "\t$state->{CVSROOT}/$state->{module}/$filename,v\n";
1310
print "M Sticky Tag:\t\t(none)\n";
1311
print "M Sticky Date:\t\t(none)\n";
1312
print "M Sticky Options:\t\t(none)\n";