summaryrefslogtreecommitdiffstats
path: root/extensions/InlineHistory/Extension.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2011-10-13 09:53:31 +0200
committerByron Jones <bjones@mozilla.com>2011-10-13 09:53:31 +0200
commitb6b00b8804b1e0a0defb5b687013190dfda42b57 (patch)
tree049bd7a896df16bb93402c3c6932967fc424631e /extensions/InlineHistory/Extension.pm
parent940466b73185d7ef483aa83d9cde50168d836bd4 (diff)
downloadbugzilla-b6b00b8804b1e0a0defb5b687013190dfda42b57.tar.gz
bugzilla-b6b00b8804b1e0a0defb5b687013190dfda42b57.tar.xz
bug 693913: set up upper limit on the number of changes to show inline
Diffstat (limited to 'extensions/InlineHistory/Extension.pm')
-rw-r--r--extensions/InlineHistory/Extension.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/extensions/InlineHistory/Extension.pm b/extensions/InlineHistory/Extension.pm
index d8d5161cc..61bc232da 100644
--- a/extensions/InlineHistory/Extension.pm
+++ b/extensions/InlineHistory/Extension.pm
@@ -33,6 +33,9 @@ use Bugzilla::Attachment;
our $VERSION = '1.4';
+# don't show inline history for bugs with lots of changes
+use constant MAXIMUM_ACTIVITY_COUNT => 500;
+
sub template_before_process {
my ($self, $args) = @_;
my $file = $args->{'file'};
@@ -61,6 +64,13 @@ sub template_before_process {
my ($activity) = Bugzilla::Bug::GetBugActivity($bug_id);
$activity = _add_duplicates($bug_id, $activity);
+ if (scalar @$activity > MAXIMUM_ACTIVITY_COUNT) {
+ $activity = [];
+ $vars->{'ih_activity'} = 0;
+ $vars->{'ih_activity_max'} = 1;
+ return;
+ }
+
# augment and tweak
foreach my $operation (@$activity) {
# make operation.who an object