diff options
-rw-r--r-- | extensions/InlineHistory/Extension.pm | 10 | ||||
-rw-r--r-- | extensions/InlineHistory/template/en/default/hook/bug/comments-comment_banner.html.tmpl | 31 |
2 files changed, 41 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 diff --git a/extensions/InlineHistory/template/en/default/hook/bug/comments-comment_banner.html.tmpl b/extensions/InlineHistory/template/en/default/hook/bug/comments-comment_banner.html.tmpl new file mode 100644 index 000000000..73f428508 --- /dev/null +++ b/extensions/InlineHistory/template/en/default/hook/bug/comments-comment_banner.html.tmpl @@ -0,0 +1,31 @@ +[%# ***** BEGIN LICENSE BLOCK ***** + # Version: MPL 1.1 + # + # The contents of this file are subject to the Mozilla Public License Version + # 1.1 (the "License"); you may not use this file except in compliance with + # the License. You may obtain a copy of the License at + # http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS IS" basis, + # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + # for the specific language governing rights and limitations under the + # License. + # + # The Original Code is the InlineHistory Bugzilla Extension; + # Derived from the Bugzilla Tweaks Addon. + # + # The Initial Developer of the Original Code is the Mozilla Foundation. + # Portions created by the Initial Developer are Copyright (C) 2011 the + # Initial Developer. All Rights Reserved. + # + # Contributor(s): + # Byron Jones <glob@mozilla.com> + # + # ***** END LICENSE BLOCK ***** + #%] + +[% IF ih_activity_max %] +<p> + <i>This [% terms.bug %] contains too many changes to be displayed inline.</i> +</p> +[% END %] |