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.
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.
Created attachment 175526 [details] [diff] [review] v1.1 Oops, I'd left a debugging warn in there.
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.
Created attachment 176888 [details] [diff] [review] v2 (Fix Bitrot)
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.
Arguably windows and mac could be capitalized.
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. :-)
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