From: Rob H. <for...@us...> - 2001-12-18 09:07:41
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv17511/bin Modified Files: sandweb.cgi Log Message: multi-file VCS commands now work. fixed some other bugs throughout the program, mostly fallout from adding the file pulldown to the browse template. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.96 retrieving revision 1.97 diff -U2 -r1.96 -r1.97 --- sandweb.cgi 2001/12/18 02:29:02 1.96 +++ sandweb.cgi 2001/12/18 09:07:38 1.97 @@ -142,16 +142,17 @@ elsif ( param('action') eq 'vcsaction' ) { # called VCS action - my $filename; + my @filename; if ( param('filename') ) { - $filename = param('filename'), + @filename = param('filename'), } else { - $filename = '.'; + @filename = ('.'); } + vcsaction( cookie => $cookie, - filename => $filename, vcs_command => param('vcs_command'), location => param('location'), + filename => \@filename, ); } @@ -628,5 +629,10 @@ my $vcs_command = $args{'vcs_command'}; - my $filename = $args{'filename'}; + my @filename = (); + my $count = 0; + while ( $args{'filename'}->[$count] ) { + push (@filename, $args{'filename'}->[$count]); + $count++; + } my $location = $args{'location'}; my $message = param('message'); @@ -641,4 +647,6 @@ my $root = $userprefs->{'repository'}->{'root'}; my $sandbox = $userprefs->{'paths'}->{'users_dir'}; + my @vcs_output = (); + my @vcs_error = (); my $vcsroot; @@ -660,8 +668,13 @@ # can't give the leading / to the VCS $location =~ s/\///; - %return = $repository->commit( - file => "$location/$filename", - message => "$message", - ); + foreach my $file (@filename) { + %return = $repository->commit( + file => "$location/$file", + message => "$message", + ); + push (@vcs_output, "$return{'output'}\n"); + push (@vcs_error, "$return{'error'}\n"); + } + my $content = $ui->get_menu( MENU => 'vcs_output', @@ -669,6 +682,6 @@ PROGNAME => $progname, FULLPATH => "$users_dir/$username/$location", - VCS_OUTPUT => $return{'output'}, - VCS_ERROR => $return{'error'}, + VCS_OUTPUT => "@vcs_output", + VCS_ERROR => "@vcs_error", ); print header( -cookie => $cookie ); @@ -688,5 +701,5 @@ PROGNAME => $progname, FULLPATH => "$users_dir/$username/$location", - FILENAME => $filename, + FILENAME => "@filename", ); print header( -cookie => $cookie ); @@ -705,5 +718,11 @@ $location =~ s/\///; - %return = $repository->$vcs_command( file => "$location/$filename" ); + foreach my $file (@filename) { + %return = $repository->$vcs_command( + file => "$location/$file", + ); + push (@vcs_output, "$return{'output'}\n"); + push (@vcs_error, "$return{'error'}\n"); + } } my $content = $ui->get_menu( @@ -712,6 +731,6 @@ PROGNAME => $progname, FULLPATH => "$users_dir/$username/$location", - VCS_OUTPUT => $return{'output'}, - VCS_ERROR => $return{'error'}, + VCS_OUTPUT => "@vcs_output", + VCS_ERROR => "@vcs_error", ); print header( -cookie => $cookie ); |