summaryrefslogtreecommitdiffstats
path: root/extensions/InlineHistory
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-10-22 09:16:43 +0200
committerByron Jones <bjones@mozilla.com>2013-10-22 09:16:43 +0200
commitf427f277bf5d4e5f54948ef9a89634961d74298c (patch)
tree1a5a598b72668af20a569bc9896b87ca9570da02 /extensions/InlineHistory
parentd27748a8cead8918d91f53eded6f30c158fbe5e3 (diff)
downloadbugzilla-f427f277bf5d4e5f54948ef9a89634961d74298c.tar.gz
bugzilla-f427f277bf5d4e5f54948ef9a89634961d74298c.tar.xz
Bug 928387: InlineHistory "marked as a duplicate" detection too eager
Diffstat (limited to 'extensions/InlineHistory')
-rw-r--r--extensions/InlineHistory/Extension.pm21
1 files changed, 9 insertions, 12 deletions
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,