From: Rob H. <for...@us...> - 2002-01-07 05:19:52
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb/Repository In directory usw-pr-cvs1:/tmp/cvs-serv22284/lib/SandWeb/Repository Modified Files: CVS.pm Log Message: added color for cvs updated. looks MUCH more readable now. Index: CVS.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository/CVS.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -U2 -r1.19 -r1.20 --- CVS.pm 2001/12/23 04:48:06 1.19 +++ CVS.pm 2002/01/07 05:19:48 1.20 @@ -516,6 +516,26 @@ if ($merge) { push @param, " -j" }; - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; + my @output_lines = (); + my @raw_output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; + + foreach my $line (@raw_output) { + if ($line =~ /^M/) { + $line =~ s/^M/\<font color\=\"blue\"\>Merged\<\/font\>/; + } + elsif ($line =~ /^U/) { + $line =~ s/^U/\<font color\=\"green\"\>Updated\<\/font\>/; + } + elsif ($line =~ /^C/) { + $line =~ s/^C/\<font color\=\"red\"\>Conflict\<\/font\>/; + } + elsif ($line =~ /warning/) { + $line =~ s/warning/\<font color\=\"red\"\>warning\<\/font\>/; + } + chomp $line; + push (@output_lines, "$line\n"); + } + + my $output = join(/ /, "@output_lines"); my %return = ( |