#!/usr/local/bin/perl5
# -*- perl -*-
use P4CGI ;
use strict ;
#
#####################################################################
##
## CONFIGURATION INFORMATION
## All config info should be in $configFile (see init() in P4CGI.pm)
##
#####################################################################
##
## Changes By Branch
##
#####################################################################
# Set back references
my $homepage="index.cgi";
my $backtohome="Back to Home" ;
# Get branches
my $branch ;
my @branches ;
my @tmp ;
&P4CGI::p4call(\@tmp, "branches" ) ;
foreach (@tmp) {
/^Branch\s+(\S+)\s+.*$/ ;
push( @branches, $1 ) ;
}
# Get branch path, put together list of branch-name/path
my $listbranch ;
my $path ;
my @listbranches ;
foreach $branch (@branches) {
my $listed ;
local *P4 ;
&P4CGI::p4call(*P4, "branch -o $branch" );
while(<P4>) {
chomp ;
if( $listed == 1 ) { $listed=0 ; next ; }
next unless /^\s+\/\// ;
/^\s*\/\/\S+\s(\/\/.*)/ ;
$path = $1 ; $listed = 1 ;
$listbranch = $branch . " " . $path ;
push( @listbranches, $listbranch ) ;
}
close P4 ;
}
# Print title and legend
print
"",
&P4CGI::start_page("Changes by Branch",
&P4CGI::ul_list("<b>Branch:</b> to see changes for branch"),
$homepage,$backtohome) ;
# Print the page
if( scalar(@branches) == 0 ) {
print
"",
"<font color=red>No branches for this depot.</font>",
"<br>",
&P4CGI::end_page() ;
exit 1 ;
}
else {
my ($tbranch, $tpath) ;
print
"",
"<b>",
&P4CGI::start_table("width=100%"),
&P4CGI::table_row(-type => "th",
-align => "left",
"Branch","Path"),
"</b>";
foreach (@listbranches) {
($tbranch,$tpath) = split /\s/ ;
print
"",
&P4CGI::table_row(-valign => "top",
&P4CGI::ahref(-url => &P4CGI::CHB_URL(),
"FSPC=$tpath", "BRANCH=YES", "BR=$tbranch",
"$tbranch"),
"$tpath",
"<br>"),
}
}
# End the table, end the page
print
"",
&P4CGI::end_table(),
&P4CGI::end_page() ;
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #2 | 277 | Diane Holt | Avoid having a branch with multiple mappings be listed more than once. | ||
| #1 | 271 | Diane Holt |
The Perl files for P4DB. These (almost) match the files in rev 1 of the p4db.tar file -- a few files have some minor cosmetic changes in the code, and chv.cgi has a Legend item added that was missing in the one in the tar-file. These files, at rev 1 (and the files in p4db.tar at rev 1), are suitable for for running the app with release 98.2 of P4. |