allow for configured git url
authorAndrew Dunstan <andrew@dunslane.net>
Tue, 4 May 2010 14:01:00 +0000 (14:01 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Tue, 4 May 2010 14:01:00 +0000 (14:01 +0000)
cgi-bin/pgstatus.pl
cgi-bin/show_log.pl

index 41d5c331d4408b12f4746a47a6472f54afa47046..df499f5fedb6542b972d34e4568257cc17a273ad 100755 (executable)
@@ -231,12 +231,13 @@ if (@config_flags)
 }
 
 my $scm = $client_conf->{scm} || 'cvs';
+my $scmurl = $client_conf->{scm_url};
 
 my $logst = <<EOSQL;
     insert into build_status 
       (sysname, snapshot,status, stage, log,conf_sum, branch,
        changed_this_run, changed_since_success, 
-       log_archive_filenames , log_archive, build_flags, scm)
+       log_archive_filenames , log_archive, build_flags, scm, scmurl)
     values(?,?,?,?,?,?,?,?,?,?,?,?,?)
 EOSQL
 ;
@@ -256,6 +257,7 @@ $sth->bind_param(10,$log_file_names);
 $sth->bind_param(11,undef,{ pg_type => DBD::Pg::PG_BYTEA });
 $sth->bind_param(12,$config_flags);
 $sth->bind_param(13,$scm);
+$sth->bind_param(13,$scmurl);
 
 $sth->execute;
 $sth->finish;
index 58b6b0b7f030c2fb62a6ef181626cc4159c10607..925be5e83b5f70d14ac2b2d33b2656a629232006 100755 (executable)
@@ -26,7 +26,7 @@ my $logdate = $query->param('dt'); $logdate =~ s/[^a-zA-Z0-9_ -]//g;
 
 my $log = "";
 my $conf = "";
-my ($stage,$changed_this_run,$changed_since_success,$sysinfo,$branch);
+my ($stage,$changed_this_run,$changed_since_success,$sysinfo,$branch,$scmurl);
 my $scm;
 
 use vars qw($info_row);
@@ -41,7 +41,7 @@ if ($system && $logdate)
        my $statement = <<EOS;
 
   select log,conf_sum,stage, changed_this_run, changed_since_success,branch,
-      log_archive_filenames, scm
+      log_archive_filenames, scm, scmurl
   from build_status
   where sysname = ? and snapshot = ?
 
@@ -59,6 +59,7 @@ EOS
        my $log_file_names = $row->[6];
        $scm = $row->[7];
        $scm ||= 'cvs'; # legacy scripts
+       $scmurl = $row->[8];
        $log_file_names =~ s/^\{(.*)\}$/$1/;
        @log_file_names=split(',',$log_file_names)
            if $log_file_names;
@@ -88,13 +89,13 @@ EOS
 foreach my $chgd ($changed_this_run,$changed_since_success)
 {
        my $cvsurl = 'http://anoncvs.postgresql.org/cvsweb.cgi';
-       my $giturl = 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;';
+       my $giturl = $scmurl || 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=';
     my @lines = split(/!/,$chgd);
     foreach (@lines)
     {
                if ($scm eq 'git')
                {
-                       s!(^\S+)(\s+)(\S+)!<a href="$giturl;h=$3">$1</a>!;
+                       s!(^\S+)(\s+)(\S+)!<a href="$giturl$3">$1</a>!;
                }
                elsif ($scm eq 'cvs')
                {