summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authortravis%sedsystems.ca <>2005-02-10 02:30:17 +0100
committertravis%sedsystems.ca <>2005-02-10 02:30:17 +0100
commit6db4590f9bc598179bbed35b66a3e583a04984c0 (patch)
tree59be5eafc7bb24cc931fcdf3b960c7d7830db935 /checksetup.pl
parent6a20f783538986e8caf60b31a659248dd552f63f (diff)
downloadbugzilla-6db4590f9bc598179bbed35b66a3e583a04984c0.tar.gz
bugzilla-6db4590f9bc598179bbed35b66a3e583a04984c0.tar.xz
Bug 11901 : Change Bugzilla comments line-wrapping policy
Patch by Max Kanat-Alexander <mkanat@kerio.com> r=gerv,justdave a=justdave
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl24
1 files changed, 21 insertions, 3 deletions
diff --git a/checksetup.pl b/checksetup.pl
index e79598029..3655087dd 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -300,9 +300,9 @@ my $modules = [
version => '2.08'
},
{
- name => 'Text::Wrap',
- version => '2001.0131'
- },
+ name => 'Text::Autoformat',
+ version => '0'
+ },
{
name => 'Mail::Mailer',
version => '1.65'
@@ -1262,6 +1262,7 @@ END
csv => sub { return $_; },
unitconvert => sub { return $_; },
time => sub { return $_; },
+ wrap_comment => sub { return $_; },
none => sub { return $_; } ,
},
}) || die ("Could not create Template Provider: "
@@ -1836,6 +1837,7 @@ $table{longdescs} =
work_time decimal(5,2) not null default 0,
thetext mediumtext,
isprivate tinyint not null default 0,
+ already_wrapped tinyint not null default 0,
index(bug_id),
index(who),
index(bug_when),
@@ -4238,6 +4240,22 @@ AddField("profiles", "extern_id", "varchar(64)");
AddField('flagtypes', 'grant_group_id', 'mediumint null');
AddField('flagtypes', 'request_group_id', 'mediumint null');
+# 2005-01-29 - mkanat@kerio.com
+if (!GetFieldDef('longdescs', 'already_wrapped')) {
+ AddField('longdescs', 'already_wrapped', 'tinyint not null default 0');
+ # Old, pre-wrapped comments should not be auto-wrapped
+ $dbh->do('UPDATE longdescs SET already_wrapped = 1');
+ # If an old comment doesn't have a newline in the first 80 characters,
+ # (or doesn't contain a newline at all) and it contains a space,
+ # then it's probably a mis-wrapped comment and we should wrap it
+ # at display-time.
+ print "Fixing old, mis-wrapped comments...\n";
+ $dbh->do(q{UPDATE longdescs SET already_wrapped = 0
+ WHERE ( POSITION('\n' IN thetext ) > 80
+ OR POSITION('\n' IN thetext ) = 0 )
+ AND SUBSTRING(thetext FROM 1 FOR 80) LIKE '% %'});
+}
+
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
#