--- cvsquery.cgi Wed Sep 25 04:20:59 2002 +++ cvsquerynew.cgi Wed Dec 4 04:04:36 2002 @@ -68,11 +68,15 @@ my $sm_font_tag = ""; my $generateBackoutCVSCommands = 0; +my $generateUpdateCVSCommands = 0; if (defined $::FORM{'generateBackoutCVSCommands'}) { $generateBackoutCVSCommands = 1; } +elsif (defined $::FORM{'generateUpdateCVSCommands'}) { + $generateUpdateCVSCommands = 1; +} -if (!$generateBackoutCVSCommands) { +if (!$generateBackoutCVSCommands && !$generateUpdateCVSCommands) { print "Content-type: text/html "; @@ -224,6 +228,7 @@
Mail everyone on this page ($pCount people)
Show commands which could be used to back out these changes +
Show commands to update to these versions "; if (defined $::FORM{'generateBackoutCVSCommands'}) { @@ -241,6 +246,23 @@ } my $prev_revision = PrevRev($ci->[$::CI_REV]); print "cvs update -j$ci->[$::CI_REV] -j$prev_revision $ci->[$::CI_DIR]/$ci->[$::CI_FILE]\n"; + } + exit; +} +elsif (defined $::FORM{'generateUpdateCVSCommands'}) { + print "Content-type: text/plain + +# This page can be saved as a shell script and executed. It should be +# run at the top of your CVS work area. It will update your workarea to +# the versions selected by your query + +"; + foreach my $ci (reverse @{$result}) { + if ($ci->[$::CI_REV] eq "") { + print "echo 'Changes made to $ci->[$::CI_DIR]/$ci->[$::CI_FILE] need to be updated by hand'\n"; + next; + } + print "cvs update -r$ci->[$::CI_REV] $ci->[$::CI_DIR]/$ci->[$::CI_FILE]\n"; } exit; }