Bug 116219 - Fix Analyze ChangeLog's entry processing
Summary: Fix Analyze ChangeLog's entry processing
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-16 05:17 PDT by Peter Gal
Modified: 2013-05-16 20:17 PDT (History)
5 users (show)

See Also:


Attachments
proposed patch (1.41 KB, patch)
2013-05-16 05:19 PDT, Peter Gal
no flags Details | Formatted Diff | Diff

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