From: Rob H. <for...@us...> - 2002-06-19 07:19:06
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv30079/lib/SandWeb Modified Files: Shell.pm Repository.pm Log Message: explicit check for the existence of the reference to the log object in some places, so that the tests will run. There must be a better way, maybe we can create the log object in the test and pass it to the Repository object? Not critical, would be nice though. Index: Shell.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Shell.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -U2 -r1.14 -r1.15 --- Shell.pm 19 Jun 2002 07:09:00 -0000 1.14 +++ Shell.pm 19 Jun 2002 07:19:04 -0000 1.15 @@ -92,6 +92,8 @@ my $command = $args{'command'}; - $log->debug("VCS call to Unix shell"); - $log->debug("VCS command is : $command"); + if ($log) { + $log->debug("VCS call to Unix shell"); + $log->debug("VCS command is : $command"); + } my $output; @@ -124,5 +126,7 @@ $output = join('', @lined_output); } else { - $log->debug("Not using VCS username/password"); + if ($log) { + $log->debug("Not using VCS username/password"); + } $output = `$command 2>&1`; } Index: Repository.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -U2 -r1.45 -r1.46 --- Repository.pm 19 Jun 2002 07:10:02 -0000 1.45 +++ Repository.pm 19 Jun 2002 07:19:04 -0000 1.46 @@ -134,7 +134,9 @@ } } - - $log->debug("Performing add operation"); - $log->debug("Params: @params"); + + if ($log) { + $log->debug("Performing add operation"); + $log->debug("Params: @params"); + } my %return = $self->call_vcs( command => 'add', @@ -245,6 +247,8 @@ } - $log->debug("Performing checkout operation"); - $log->debug("Params: @params"); + if ($log) { + $log->debug("Performing checkout operation"); + $log->debug("Params: @params"); + } my %return = $self->call_vcs( command => 'checkout', @@ -289,6 +293,8 @@ } - $log->debug("Performing commit operation"); - $log->debug("Params: @params"); + if ($log) { + $log->debug("Performing commit operation"); + $log->debug("Params: @params"); + } my %return = $self->call_vcs( command => 'commit', @@ -599,6 +605,8 @@ } - $log->debug("Performing remove operation"); - $log->debug("Params: @params"); + if ($log) { + $log->debug("Performing remove operation"); + $log->debug("Params: @params"); + } my %return = $self->call_vcs( command => 'remove', |