Bug 74389 - [Refactoring] Remove several global variables from prepare-ChangeLog
Summary: [Refactoring] Remove several global variables from prepare-ChangeLog
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 73531
  Show dependency treegraph
 
Reported: 2011-12-13 01:01 PST by Kentaro Hara
Modified: 2011-12-13 21:13 PST (History)
4 users (show)

See Also:


Attachments
Patch (9.15 KB, patch)
2011-12-13 01:21 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.