From 0fccdb26ae49bd8bb6022d48b769595e0a328278 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 19 Sep 2006 05:16:43 +0000 Subject: Bug 352235: Use Bugzilla->localconfig everywhere instead of :localconfig from Bugzilla::Config Patch By Max Kanat-Alexander r=LpSolit, a=myk --- Bugzilla/Attachment/PatchReader.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Bugzilla/Attachment') diff --git a/Bugzilla/Attachment/PatchReader.pm b/Bugzilla/Attachment/PatchReader.pm index 615ae91b4..8543d6e22 100644 --- a/Bugzilla/Attachment/PatchReader.pm +++ b/Bugzilla/Attachment/PatchReader.pm @@ -19,7 +19,6 @@ use strict; package Bugzilla::Attachment::PatchReader; -use Bugzilla::Config qw(:localconfig); use Bugzilla::Error; @@ -27,6 +26,7 @@ sub process_diff { my ($attachment, $format, $context) = @_; my $dbh = Bugzilla->dbh; my $cgi = Bugzilla->cgi; + my $lc = Bugzilla->localconfig; my $vars = {}; my ($reader, $last_reader) = setup_patch_readers(undef, $context); @@ -42,7 +42,7 @@ sub process_diff { } else { $vars->{'other_patches'} = []; - if ($interdiffbin && $diffpath) { + if ($lc->{interdiffbin} && $lc->{diffpath}) { # Get list of attachments on this bug. # Ignore the current patch, but select the one right before it # chronologically. @@ -84,6 +84,7 @@ sub process_diff { sub process_interdiff { my ($old_attachment, $new_attachment, $format, $context) = @_; my $cgi = Bugzilla->cgi; + my $lc = Bugzilla->localconfig; my $vars = {}; # Get old patch data. @@ -95,8 +96,8 @@ sub process_interdiff { # Send through interdiff, send output directly to template. # Must hack path so that interdiff will work. - $ENV{'PATH'} = $diffpath; - open my $interdiff_fh, "$interdiffbin $old_filename $new_filename|"; + $ENV{'PATH'} = $lc->{diffpath}; + open my $interdiff_fh, "$lc->{interdiffbin} $old_filename $new_filename|"; binmode $interdiff_fh; my ($reader, $last_reader) = setup_patch_readers("", $context); @@ -219,7 +220,9 @@ sub setup_patch_readers { } # Add in cvs context if we have the necessary info to do it - if ($context ne 'patch' && $cvsbin && Bugzilla->params->{'cvsroot_get'}) { + if ($context ne 'patch' && Bugzilla->localconfig->{cvsbin} + && Bugzilla->params->{'cvsroot_get'}) + { require PatchReader::AddCVSContext; $last_reader->sends_data_to( new PatchReader::AddCVSContext($context, Bugzilla->params->{'cvsroot_get'})); @@ -246,7 +249,8 @@ sub setup_template_patch_reader { $vars->{'collapsed'} = $cgi->param('collapsed'); $vars->{'context'} = $context; - $vars->{'do_context'} = $cvsbin && Bugzilla->params->{'cvsroot_get'} && !$vars->{'newid'}; + $vars->{'do_context'} = Bugzilla->localconfig->{cvsbin} + && Bugzilla->params->{'cvsroot_get'} && !$vars->{'newid'}; # Print everything out. print $cgi->header(-type => 'text/html', -- cgit v1.2.3-24-g4f1b