Bug 116219

Summary: Fix Analyze ChangeLog's entry processing
Product: WebKit Reporter: Peter Gal <galpeter>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dpranke, glenn, ossy, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch none

Description Peter Gal 2013-05-16 05:17:29 PDT
If someone wants to run the analyze-changelog command for the Source/WebCore/ then there will be a runtime failure, due to the fact that there is a variable which is not initialized if no entries found.
Comment 1 Peter Gal 2013-05-16 05:19:40 PDT
Created attachment 201944 [details]
proposed patch

This'll initialize the 'i' variable to 0. Also it'll remove the unneeded i+=1 line (the i is incremented automatically by the for loop's enumerate).
Comment 2 Ryosuke Niwa 2013-05-16 08:59:19 PDT
Comment on attachment 201944 [details]
proposed patch

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

> Tools/Scripts/webkitpy/tool/commands/analyzechangelog.py:183
> +        i = 0

Instead of doing that, exit early when "not entries".
Comment 3 Peter Gal 2013-05-16 09:16:55 PDT
(In reply to comment #2)
> (From update of attachment 201944 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=201944&action=review
> 
> > Tools/Scripts/webkitpy/tool/commands/analyzechangelog.py:183
> > +        i = 0
> 
> Instead of doing that, exit early when "not entries".

That was my first try, but the 'entries' is a generator. So to do the early exit first we need to ask for one element then check if there is any and do some magic with it.
Comment 4 Ryosuke Niwa 2013-05-16 09:58:53 PDT
Comment on attachment 201944 [details]
proposed patch

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

>>> Tools/Scripts/webkitpy/tool/commands/analyzechangelog.py:183
>>> +        i = 0
>> 
>> Instead of doing that, exit early when "not entries".
> 
> That was my first try, but the 'entries' is a generator. So to do the early exit first we need to ask for one element then check if there is any and do some magic with it.

I see. Makes sense.
Comment 5 WebKit Commit Bot 2013-05-16 20:17:39 PDT
Comment on attachment 201944 [details]
proposed patch

Clearing flags on attachment: 201944

Committed r150237: <http://trac.webkit.org/changeset/150237>
Comment 6 WebKit Commit Bot 2013-05-16 20:17:41 PDT
All reviewed patches have been landed.  Closing bug.