summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-12-27 15:43:12 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-04-10 18:31:51 +0200
commitfc0c6f372f22627c9f83719d287515e086edfdd9 (patch)
tree385bb0d7cd74bf109ea5872e2d806392e26920ba
parent9e7e44b7b378d8a819d84f515b3f44439b9751ed (diff)
downloadbugzilla-fc0c6f372f22627c9f83719d287515e086edfdd9.tar.gz
bugzilla-fc0c6f372f22627c9f83719d287515e086edfdd9.tar.xz
WIP: Migrate duplicate ID
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--Bugzilla/Migrate.pm4
-rw-r--r--Bugzilla/Migrate/Flyspray.pm5
2 files changed, 9 insertions, 0 deletions
diff --git a/Bugzilla/Migrate.pm b/Bugzilla/Migrate.pm
index da2d1a750..973928397 100644
--- a/Bugzilla/Migrate.pm
+++ b/Bugzilla/Migrate.pm
@@ -701,6 +701,7 @@ sub insert_bugs {
my $comments = delete $bug->{comments};
my $history = delete $bug->{history};
my $attachments = delete $bug->{attachments};
+ my $dup_id = delete $bug->{dup_id};
$self->debug($bug, 3);
@@ -761,6 +762,9 @@ sub insert_bugs {
$reporter->{groups} = $super_user->groups;
Bugzilla->set_user($reporter);
my $created = Bugzilla::Bug->create($bug);
+ if (defined $dup_id) {
+ $dbh->do("INSERT INTO duplicates (dupe_of, dupe) VALUES (?, ?)", undef, $dup_id, $created->id);
+ }
$self->debug('Created bug ' . $created->id);
Bugzilla->set_user($super_user);
diff --git a/Bugzilla/Migrate/Flyspray.pm b/Bugzilla/Migrate/Flyspray.pm
index 9d8949919..024b99b4b 100644
--- a/Bugzilla/Migrate/Flyspray.pm
+++ b/Bugzilla/Migrate/Flyspray.pm
@@ -382,6 +382,11 @@ sub _read_bugs {
removed => "",
added => $history->{resolution_name},
};
+ if ($self->translate_value('resolution', $history->{resolution_name}) eq "DUPLICATE") {
+ if ($closure_comment =~ m/FS#(\d+)/) {
+ $bug->{dup_id} = int($1);
+ }
+ }
} elsif ($history->{event_type} == 3) {
# type 3 -> field changed
if ($history->{field_changed} eq "item_status") {