Closed Bug 283561 Opened 19 years ago Closed 19 years ago

Move AppendComment out of globals.pl

Categories

(Bugzilla :: Creating/Changing Bugs, enhancement, P2)

2.19.2
enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 2 obsolete files)

It will become a subroutine in Bugzilla::Bug, most likely.

One day we should refactor it to actually be a method of a Bug object, once more
callers are using Bug objects.
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.20
This is a pretty simple patch. We just move this stuff out of globals.pl and
move it into Bugzilla::Bug. And we change it to use $dbh, too.

I tested all the code paths where this is called, and it works fine, as far as
I can see.
Attachment #175525 - Flags: review?(jouni)
Attached patch v1.1 (obsolete) — Splinter Review
Oops, I'd left a debugging warn in there.
Attachment #175525 - Attachment is obsolete: true
Attachment #175526 - Flags: review?(jouni)
Attachment #175525 - Flags: review?(jouni)
Blocks: 283926
Attachment #175526 - Flags: review?(jouni) → review?(LpSolit)
Priority: -- → P2
Comment on attachment 175526 [details] [diff] [review]
v1.1

bitrotten. You must have a really old version of bugzilla!! ;)

use Bugzilla::bug is already used in CGI.pl and attachment.cgi and the EXPORT
part of Bug.pm already exists.
Attachment #175526 - Flags: review?(LpSolit) → review-
Attached patch v2 (Fix Bitrot)Splinter Review
Attachment #175526 - Attachment is obsolete: true
Attachment #176888 - Flags: review?(LpSolit)
Comment on attachment 176888 [details] [diff] [review]
v2 (Fix Bitrot)

+    $comment =~ s/\r\n/\n/g;	  # Get rid of windows-style line endings.
+    $comment =~ s/\r/\n/g;	  # Get rid of mac-style line endings.

I know it's simply copy-pasted, so it's a nit:

There are 3 different line endings:

\r\n on windows
\r on mac
\n on Linux

We aren't getting rid of the first two, we simply transform them into the third
one (Linux-style).

If you could on check in to update the comment in order to reflect that, it
would be great. Uploading a new patch and carrying over r+ also works.
Attachment #176888 - Flags: review+
Arguably windows and mac could be capitalized.
Flags: approval?
Comment on attachment 176888 [details] [diff] [review]
v2 (Fix Bitrot)

Oh, vladd! :-) I haven't heard from you in a while; I didn't know that you were
available for reviews. :-)
Attachment #176888 - Flags: review?(LpSolit)
Flags: approval? → approval+
I addressed vladd's comments by just changing the comment wording a bit, on checkin.

Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.315; previous revision: 1.314
done
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.66; previous revision: 1.65
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: