From f427f277bf5d4e5f54948ef9a89634961d74298c Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 22 Oct 2013 15:16:43 +0800 Subject: Bug 928387: InlineHistory "marked as a duplicate" detection too eager --- extensions/InlineHistory/Extension.pm | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'extensions/InlineHistory') diff --git a/extensions/InlineHistory/Extension.pm b/extensions/InlineHistory/Extension.pm index df7ae9f62..cb83fcf1d 100644 --- a/extensions/InlineHistory/Extension.pm +++ b/extensions/InlineHistory/Extension.pm @@ -170,28 +170,25 @@ sub _add_duplicates { my ($bug_id, $activity) = @_; + # we're ignoring pre-bugzilla 3.0 ".. has been marked as a duplicate .." + # comments because searching each comment's text is expensive. these + # legacy comments will not be visible at all in the bug's comment/activity + # stream. bug 928786 deals with migrating those comments to be stored as + # CMT_HAS_DUPE instead. + my $dbh = Bugzilla->dbh; my $sth = $dbh->prepare(" SELECT profiles.login_name, " . $dbh->sql_date_format('bug_when', '%Y.%m.%d %H:%i:%s') . ", - extra_data, - thetext + extra_data FROM longdescs INNER JOIN profiles ON profiles.userid = longdescs.who - WHERE bug_id = ? - AND ( - type = ? - OR thetext LIKE '%has been marked as a duplicate of this%' - ) + WHERE bug_id = ? AND type = ? ORDER BY bug_when "); $sth->execute($bug_id, CMT_HAS_DUPE); - while (my($who, $when, $dupe_id, $the_text) = $sth->fetchrow_array) { - if (!$dupe_id) { - next unless $the_text =~ / (\d+) has been marked as a duplicate of this/; - $dupe_id = $1; - } + while (my($who, $when, $dupe_id) = $sth->fetchrow_array) { my $entry = { 'when' => $when, 'who' => $who, -- cgit v1.2.3-24-g4f1b