summaryrefslogtreecommitdiffstats
path: root/importxml.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-04-20 07:24:06 +0200
committerlpsolit%gmail.com <>2006-04-20 07:24:06 +0200
commit6e1c04245ee581b081ca66e71daa6fa3c38e1222 (patch)
tree35f4de2c3c567e3054d2d34b180a6da58458e68d /importxml.pl
parent9fef4d440062fb2a5080c1cf79f847dc587b5459 (diff)
downloadbugzilla-6e1c04245ee581b081ca66e71daa6fa3c38e1222.tar.gz
bugzilla-6e1c04245ee581b081ca66e71daa6fa3c38e1222.tar.xz
Bug 334620: When calling importxml.pl with the -v option, information is displayed too many times - Patch by Frédéric Buclin <LpSolit@gmail.com> r=ghendricks a=myk
Diffstat (limited to 'importxml.pl')
-rwxr-xr-ximportxml.pl14
1 files changed, 11 insertions, 3 deletions
diff --git a/importxml.pl b/importxml.pl
index 59bea430c..08be03e5a 100755
--- a/importxml.pl
+++ b/importxml.pl
@@ -116,7 +116,7 @@ use constant DEBUG_LEVEL => 2;
use constant ERR_LEVEL => 1;
GetVersionTable();
-our $log;
+our @logs;
our @attachments;
our $bugtotal;
my $xml;
@@ -341,10 +341,12 @@ sub init() {
my $xmlversion = $root->{'att'}->{'version'};
if ($xmlversion ne $Bugzilla::Config::VERSION) {
- $log .= "Possible version conflict!\n";
+ my $log = "Possible version conflict!\n";
$log .= " XML was exported from Bugzilla version $xmlversion\n";
$log .= " But this installation uses ";
$log .= $Bugzilla::Config::VERSION . "\n";
+ Debug($log, OK_LEVEL);
+ push(@logs, $log);
}
Error( "no maintainer", "REOPEN", $exporter ) unless ($maintainer);
Error( "no exporter", "REOPEN", $exporter ) unless ($exporter);
@@ -449,6 +451,8 @@ sub process_bug {
my $exporter = Bugzilla::User->new_from_login($exporter_login);
my $urlbase = $root->{'att'}->{'urlbase'};
+ # We will store output information in this variable.
+ my $log = "";
if ( defined $bug->{'att'}->{'error'} ) {
$log .= "\nError in bug " . $bug->field('bug_id') . "\@$urlbase: ";
$log .= $bug->{'att'}->{'error'} . "\n";
@@ -1180,6 +1184,7 @@ sub process_bug {
$log .= "You may have to set certain fields in the new bug by hand.\n\n";
}
Debug( $log, OK_LEVEL );
+ push(@logs, $log);
Bugzilla::BugMail::Send( $id, { 'changer' => $exporter_login } ) if ($mail);
# done with the xml data. Lets clear it from memory
@@ -1218,7 +1223,10 @@ my $root = $twig->root;
my $maintainer = $root->{'att'}->{'maintainer'};
my $exporter = $root->{'att'}->{'exporter'};
my $urlbase = $root->{'att'}->{'urlbase'};
-$log .= "Imported $bugtotal bug(s) from $urlbase,\n sent by $exporter.\n\n";
+
+# It is time to email the result of the import.
+my $log = join("\n\n", @logs);
+$log .= "\n\nImported $bugtotal bug(s) from $urlbase,\n sent by $exporter.\n";
my $subject = "$bugtotal Bug(s) successfully moved from $urlbase to "
. Param("urlbase");
my @to = ($exporter, $maintainer);