Move AppendComment out of globals.pl

RESOLVED FIXED in Bugzilla 2.20

Status

()

Bugzilla
Creating/Changing Bugs
P2
enhancement
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: Max Kanat-Alexander, Assigned: Max Kanat-Alexander)

Tracking

2.19.2
Bugzilla 2.20
Dependency tree / graph
Bug Flags:
approval +

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

13 years ago
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.
(Assignee)

Updated

13 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.20
(Assignee)

Comment 1

13 years ago
Created attachment 175525 [details] [diff] [review]
Move AppendComment to Bugzilla::Bug

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)
(Assignee)

Comment 2

13 years ago
Created attachment 175526 [details] [diff] [review]
v1.1

Oops, I'd left a debugging warn in there.
Attachment #175525 - Attachment is obsolete: true
Attachment #175526 - Flags: review?(jouni)
(Assignee)

Updated

13 years ago
Attachment #175525 - Flags: review?(jouni)
(Assignee)

Updated

13 years ago
Blocks: 283926
(Assignee)

Updated

13 years ago
Attachment #175526 - Flags: review?(jouni) → review?(LpSolit)
(Assignee)

Updated

13 years ago
Priority: -- → P2

Comment 3

13 years ago
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-
(Assignee)

Comment 4

13 years ago
Created attachment 176888 [details] [diff] [review]
v2 (Fix Bitrot)
Attachment #175526 - Attachment is obsolete: true
Attachment #176888 - Flags: review?(LpSolit)

Comment 5

13 years ago
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+

Comment 6

13 years ago
Arguably windows and mac could be capitalized.
Flags: approval?
(Assignee)

Comment 7

13 years ago
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+
(Assignee)

Comment 8

13 years ago
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
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.