From: Nick J. <nje...@us...> - 2002-02-13 07:00:06
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv7802 Modified Files: sandweb.cgi Log Message: * NOW the checkout_commit() is actually executed. But the $repository->checkout() method call isn't working it seems. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.169 retrieving revision 1.170 diff -U2 -r1.169 -r1.170 --- sandweb.cgi 13 Feb 2002 06:44:13 -0000 1.169 +++ sandweb.cgi 13 Feb 2002 06:59:57 -0000 1.170 @@ -106,4 +106,7 @@ my $submit = CGI::param('Submit'); my $vcs_command = CGI::param('vcs_command'); + my $module_name = CGI::param('module_name'); + + $log->debug("action: $action submit: $submit"); ####################################################### @@ -199,4 +202,6 @@ checkout_commit( ck_auth => $ck_auth, + repo_name => $repo_name, + module_name => $module_name, ); } else { @@ -1250,8 +1255,8 @@ exit 0; } - my $module = $args{'module_name'}; + my $module_name = $args{'module_name'}; my $repo_name = $args{'repo_name'}; - my $repo_server = $user->{'repo'}->{'server'}; + my $repo_server = $user->{'repo'}->{$repo_name}->{'server'}; my $repo_username = $user->{'repo'}->{$repo_name}->{'username'}; my $repo_type = $user->{'repo'}->{$repo_name}->{'type'}; @@ -1259,5 +1264,8 @@ my $repo_root = $user->{'repo'}->{$repo_name}->{'root'}; - my @module_list = @{$user->{'repo'}->{$repo_name}->{'module_list'}}; + my @module_list = (); + if ($user->{'repo'}->{$repo_name}->{'module_list'}) { + @module_list = @{$user->{'repo'}->{$repo_name}->{'module_list'}}; + } my $username = $auth->get_userinfo('username'); @@ -1277,35 +1285,36 @@ } + my $repository = SandWeb::Repository->new( + root => $vcsroot, + repo_type => $repo_type, + sandbox => "$users_dir/$repo_username", + ); + # foreach my $file (@filename) { -# %return = $repository->$vcs_command( -# file => "$location/$file", -# ); -# push (@vcs_output, "$return{'output'}\n"); -# push (@vcs_error, "$return{'error'}\n"); + my %return = $repository->checkout( + file => "$module_name", + ); + push (@vcs_output, "$return{'output'}\n"); + push (@vcs_error, "$return{'error'}\n"); # } -# -# my $repository = SandWeb::Repository->new( -# root => $vcsroot, -# repo_type => $repo_type, -# sandbox => "$users_dir/$username", -# ); - -# my $content = $ui->get_menu( -# MENU => 'vcs_output', -# LOCATION => $location, -# FILENAME => "@filename", -# PROGNAME => $progname, -# VCS_OUTPUT => "@vcs_output", -# VCS_ERROR => "@vcs_error", -# ); -# print CGI::header( -cookie => $ck_auth ); -# $ui->print_screen( -# TITLE=> "SandWeb : VCS $vcs_command", -# MENU_TITLE => 'SandWeb', -# SUBMENU_TITLE => "VCS $vcs_command", -# FOOTER => '', -# CONTENT => $content, -# ERROR => $error, -# ); + + $log->debug('dump', \%return); + + my $content = $ui->get_menu( + MENU => 'vcs_output', + LOCATION => $module_name, #$location, + #FILENAME => "@filename", + PROGNAME => $progname, + VCS_OUTPUT => "@vcs_output", + VCS_ERROR => "@vcs_error", + ); + print CGI::header( -cookie => $ck_auth ); + $ui->print_screen( + TITLE=> "SandWeb : checkout", + MENU_TITLE => 'SandWeb', + SUBMENU_TITLE => "checkout", + FOOTER => '', + CONTENT => $content, + ); exit 0; } |