summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-12-27 15:43:12 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-12-06 11:05:42 +0100
commitbcc998174abf8a95905dc41c22eb5b238895d976 (patch)
treea169d01ec828d28c819fd674d7db7de3fb963435
parent60d8b93c0017253f11bbea0108e0a25e371e4a9b (diff)
downloadbugzilla-bcc998174abf8a95905dc41c22eb5b238895d976.tar.gz
bugzilla-bcc998174abf8a95905dc41c22eb5b238895d976.tar.xz
WIP: Migrate duplicate ID
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--Bugzilla/Migrate.pm5
-rw-r--r--Bugzilla/Migrate/Flyspray.pm7
2 files changed, 12 insertions, 0 deletions
diff --git a/Bugzilla/Migrate.pm b/Bugzilla/Migrate.pm
index e52e1ea87..f4ae078f9 100644
--- a/Bugzilla/Migrate.pm
+++ b/Bugzilla/Migrate.pm
@@ -716,6 +716,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);
@@ -780,6 +781,10 @@ 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 38a450b36..6da7f9752 100644
--- a/Bugzilla/Migrate/Flyspray.pm
+++ b/Bugzilla/Migrate/Flyspray.pm
@@ -410,6 +410,13 @@ 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) {