#!/usr/bin/perl -w # -*- perl -*- use P4CGI ; use strict ; # ################################################################# # CONFIGURATION INFORMATION # All config info should be in P4CGI.pm # ################################################################# # # P4 change browser # View list of changes for selected part of depot # ################################################################# # Get file spec argument my $filespec = P4CGI::cgi()->param("FSPC") ; $filespec = "//..." unless defined $filespec ; # Get label argument my $label = P4CGI::cgi()->param("LABEL") ; if(defined $label and $label eq "-") { $label = undef ; } ; # Get spec of files to exclude from list of changes my $exfiles = P4CGI::cgi()->param("EXFSPC") ; if(defined $exfiles and $exfiles eq "-") { $exfiles = undef ; } ; # Get label to exclude my $exlabel = P4CGI::cgi()->param("EXLABEL") ; if(defined $exlabel and $exlabel eq "-") { $exlabel = undef ; } ; # Get status my $status = P4CGI::cgi()->param("STATUS") ; unless(defined $status) { $status = "submitted" ; } ; # Assume filespec is a file spec, set title my $title = "Changes for $filespec" ; # Get max changes to show my $maxchanges = P4CGI::cgi()->param("MAXCH") ; my $changeoffset ; my $choffstr="" ; if(defined $maxchanges && $maxchanges =~ /^\d+$/) { # Get offset of first change $changeoffset = P4CGI::cgi()->param("CHOFFSET") ; if(defined $changeoffset) { $choffstr="\@$changeoffset" ; $changeoffset = P4CGI::cgi()->param("CHOFFSETDISP") ; $title = "Changes for $filespec (offset:$changeoffset)" ; } else { $changeoffset = 0 ; } $maxchanges = "-m $maxchanges" ; } else { $maxchanges = "" ; } if(defined $label) { $choffstr="" ; if($filespec eq "//...") { $title ="Changes for label <code>$label</code>"; $filespec .= "\@$label" ; } else { $title .= " and label $label" ; $filespec =~ s/ /@$label / ; $filespec .= "\@$label" ; } } # Get list of changes to exclude my @exclude; if(defined $exlabel) { if(defined $exfiles) { $exfiles .= "\@$exlabel" ; } else { $exfiles = "//...\@$exlabel" ; } } local *P4 ; if(defined $exfiles) { &P4CGI::p4call(*P4,"changes \"$exfiles\"") ; $title .= " <br>excluding changes in <code>$exfiles</code>" ; while(<P4>) { /^Change (\d+)/ ; push @exclude,$1 ; } close P4 ; push @exclude,0 ; } $filespec = "\"$filespec\"" ; if($status eq "pending") { $title = "Pending changes" ; $filespec = "" ; } ; &P4CGI::p4call(*P4,"changes -l $maxchanges -s $status $filespec$choffstr") ; print "", &P4CGI::start_page($title, &P4CGI::ul_list("<b>Change No.</b> -- see details of change")) ; my $nextToExclude = shift @exclude ; if(!defined $nextToExclude) { $nextToExclude = 0 ; } ; my ( $change, $misc ) ; my $skipped=0 ; my $skip; print "<dl>" ; my $displayed = 0 ; my $lastch ; while (<P4>) { $_ = &P4CGI::fixSpecChar($_) ; if(/^Change (\d+) (.*)$/) { $skip="no" ; ( $change, $misc ) = ($1,$2) ; $lastch = $change ; while($nextToExclude > $change) { if($skipped>0) { print "<dt><font color=green><hr>\n", "$skipped change" , $skipped > 1 ? "s":"", "<hr></font>\n"; }; $skipped=0 ; print "<dt>", &P4CGI::ahref("-url",P4CGI::CHV_URL(), "CH=$nextToExclude", "<font color=red>Change $nextToExclude only in $exfiles</font>"), "<dd> "; $nextToExclude = shift @exclude ; } if ($change == $nextToExclude) { $nextToExclude = shift @exclude ; $skip="yes" ; $skipped++ ; next ; } # last if ($fromChange != 0) and ($change <= $fromChange) ; if($skipped>0) { print "<dt><font color=green><hr>\n", "$skipped change" , $skipped > 1 ? "s":"", "<hr></font>\n"; } $skipped=0 ; print "<dt>", &P4CGI::ahref("-url",P4CGI::CHV_URL(), "CH=$change", "Change $change "), "$misc<dd>\n"; $displayed++ ; } else { next if $skip eq "yes"; chop; print &P4CGI::magic("<tt>$_</tt><br>\n") ; } } close P4; print "</dl>\n" ; my $mc = P4CGI::cgi()->param("MAXCH") ; if(defined $mc and ($mc == $displayed)) { $lastch-- ; $changeoffset += $mc ; print "", &P4CGI::ahref("-url",P4CGI::CHB_URL(), "FSPC=".P4CGI::cgi()->param("FSPC"), "STATUS=$status", "CHOFFSET=$lastch", "CHOFFSETDISP=$changeoffset", "MAXCH=$mc", "Next $mc changes") ; } print "",&P4CGI::end_page(); # # That's it folks #
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 382 | heather_van_steenburgh | Bring up to 0.99f level | ||
#1 | 381 | heather_van_steenburgh |
The version of P4DB in the public depot isn't 0.99f. Branch for 0.99f |
||
//guest/heather_van_steenburgh/perforce/utils/p4db/chb.cgi | |||||
#1 | 380 | heather_van_steenburgh | P4DB baseline |