Bug 74389

Summary: [Refactoring] Remove several global variables from prepare-ChangeLog
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: Tools / TestsAssignee: Kentaro Hara <haraken>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, ddkilzer, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 73531    
Attachments:
Description Flags
Patch none

Description Kentaro Hara 2011-12-13 01:01:03 PST
We are planning to write unit-tests for prepare-ChangeLog in a run-leaks_unittest manner. This bug is one of the incremental refactorings to remove all top-level code and global variables from prepare-ChangeLog.

Global variables in prepare-ChangeLog can be categorized as follows:

[A: Constant variables]
$changeLogTimeZone
$SVN
$GIT
%supportedTestExtensions

[B: Arguments]
$bugDescription
$bugNumber
$name
$emailAddress
$mergeBase
$gitCommit
$gitIndex
$gitReviewer
$openChangeLogs
$writeChangeLogs
$showHelp
$spewDiff
$updateChangeLogs
$parseOptionsResult

[C: Global variables that are used many times here and there]
$isSVN
$isGit

[D: Global variables that are used only a few times]
%paths
$changedFiles
$conflictFiles
$functionLists
$addedRegressionTests
$bugURL
$filesInChangeLog
$prefixes
$changeLogs


In this bug, we remove all global variables in [D]. More accurately, we make all variables in [D] being used only through parameter passing.
Comment 1 Kentaro Hara 2011-12-13 01:21:51 PST
Created attachment 118974 [details]
Patch
Comment 2 David Kilzer (:ddkilzer) 2011-12-13 20:22:40 PST
Comment on attachment 118974 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=118974&action=review

r=me

> Tools/Scripts/prepare-ChangeLog:176
> -my $addedRegressionTests = generateFileList(@changedFiles, @conflictFiles, %functionLists);
> +my ($changedFiles, $conflictFiles, $functionLists, $addedRegressionTests) = generateFileList(%paths);

In the future, it seems like we should try to come up with a data structure to hold this data instead of passing a list of variables back.

This is okay for now, though.
Comment 3 WebKit Review Bot 2011-12-13 21:13:23 PST
Comment on attachment 118974 [details]
Patch

Clearing flags on attachment: 118974

Committed r102736: <http://trac.webkit.org/changeset/102736>
Comment 4 WebKit Review Bot 2011-12-13 21:13:27 PST
All reviewed patches have been landed.  Closing bug.