add support for the perforce p4db web page changeView.cgi

This commit is contained in:
kestes%walrus.com 2004-06-15 01:16:55 +00:00
parent 8150854a1a
commit 8d48c74e1c
2 changed files with 49 additions and 12 deletions

View File

@ -75,8 +75,8 @@
# Contributor(s):
# $Revision: 1.26 $
# $Date: 2004/06/08 11:48:00 $
# $Revision: 1.27 $
# $Date: 2004/06/15 01:16:55 $
# $Author: kestes%walrus.com $
# $Source: /home/hwine/cvs_conversion/cvsroot/mozilla/webtools/tinderbox2/src/lib/TinderDB/VC_Perforce.pm,v $
# $Name: $
@ -156,7 +156,7 @@ use Utils;
use VCDisplay;
$VERSION = ( qw $Revision: 1.26 $ )[1];
$VERSION = ( qw $Revision: 1.27 $ )[1];
@ISA = qw(TinderDB::BasicTxtDB);
@ -524,12 +524,34 @@ sub render_authors {
my ($vc_info);
$vc_info .= "Filespec: $filespec <br>\n";
$vc_info .= "Changes: @change_nums <br>\n";
# The Link Choices inside the popup.
my $link_choices = "Checkins by <b>$author</b><br>";
$link_choices .= " for $vc_info \n<br>";
$link_choices .= " for $vc_info \n";
# Most VCDisplay's do not have this function but the
# perforce p4db does and we try to use it if possible. I
# do not see a clean way to break this abstraction so I
# peek at the configuration information.
if ($TinderConfig::VCDisplayImpl == 'VCDisplay::Perforce_P4DB') {
require 'VCDisplay/Perforce_P4DB.pm';
foreach $change_num (@change_nums) {
$link_choices .=
VCDisplay::Perforce_P4DB::changeView(
'change_num' => $change_num,
"linktxt" => "Change: $change_num",
);
$link_choices .= "<br>";
}
} else {
$link_choices .= "Changes: @change_nums <br>\n";
}
$link_choices .= "<br>\n";
$link_choices .=
VCDisplay::query(
'tree' => $tree,

View File

@ -4,8 +4,8 @@
# have installed perforce with P4DB to let your webserver render html
# pages of your VC repository.
# $Revision: 1.5 $
# $Date: 2004/06/08 00:00:12 $
# $Revision: 1.6 $
# $Date: 2004/06/15 01:16:54 $
# $Author: kestes%walrus.com $
# $Source: /home/hwine/cvs_conversion/cvsroot/mozilla/webtools/tinderbox2/src/lib/VCDisplay/Perforce_P4DB.pm,v $
# $Name: $
@ -80,7 +80,7 @@ $TIMEQUERY = $P4DB_URL."/filesChangedSince.cgi";
$BLAME = $P4DB_URL."/fileViewer.cgi";
$GUESS = $P4DB_URL."/fileSearch.cgi";
$CHANGEVIEW=$P4DB_URL."/changeView.cgi";
# convert time() format to form that p4db uses in
# filesChangedSince.cgi
@ -174,10 +174,10 @@ sub prepare_perforce_args {
($args{'mindate'} && $args{'maxdate'}) &&
($args{'mindate'} > $args{'maxdate'}) &&
(die (
"Bonsai mindate is GREATER then maxdate.\n".
"Bonsai requires that mindate be an earlier time then maxdate.\n".
"mindate: $args{'mindate'}: ".time2bonsai($args{'mindate'})."\n".
"maxdate: $args{'maxdate'}: ".time2bonsai($args{'maxdate'})."\n".
"Perforce mindate is GREATER then maxdate.\n".
"Perforce requires that mindate be an earlier time then maxdate.\n".
"mindate: $args{'mindate'}: ".time2p4db($args{'mindate'})."\n".
"maxdate: $args{'maxdate'}: ".time2p4db($args{'maxdate'})."\n".
""));
# Perforce does not seem to allow us to specify a time interval.
@ -308,6 +308,21 @@ sub query {
}
# p4db has a nice page for viewing particular change sets. This breaks
# the tinderbox abstractions because the notion of a changeset is
# particular to perforce but I will allow vc_perforce to use it.
sub changeView {
my (%args) = @_;
$args{'href'} = "$CHANGEVIEW?CH=".$args{'change_num'};
my ($output) = HTMLPopUp::Link(%args);
return $output;
}
1;