Changeset 150939 in webkit


Ignore:
Timestamp:
May 29, 2013 6:07:22 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

prepare-Changelog should not be generating namespace-only or class-name-only lines like "(WebCore):"
https://bugs.webkit.org/show_bug.cgi?id=113221

Patch by Ruth Fong <ruth_fong@apple.com> on 2013-05-29
Reviewed by Ryosuke Niwa.

Teach prepare-Changelog to not list the names of modified namespaces,
classes, or structs in C++ files. Thus, if a change is made
within a namespace/class/struct yet outside a function, it will
not be reflected in the ChangeLog entry.
See https://bugs.webkit.org/show_bug.cgi?id=113221#c8
for more details on how ChangeLog entries are affected.

  • Scripts/prepare-ChangeLog:

(get_function_line_ranges_for_cpp):
(delete_namespaces_from_ranges_for_cpp): Added.
(is_function_in_namespace): Added.

  • Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt: Updated

to reflect revised definition of a function (i.e. excludes namespaces, classes, structs)

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r150924 r150939  
     12013-05-29  Ruth Fong  <ruth_fong@apple.com>
     2
     3        prepare-Changelog should not be generating namespace-only or class-name-only lines like "(WebCore):"
     4        https://bugs.webkit.org/show_bug.cgi?id=113221
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Teach prepare-Changelog to not list the names of modified namespaces,
     9        classes, or structs in C++ files. Thus, if a change is made
     10        within a namespace/class/struct yet outside a function, it will
     11        not be reflected in the ChangeLog entry.
     12        See https://bugs.webkit.org/show_bug.cgi?id=113221#c8
     13        for more details on how ChangeLog entries are affected.
     14
     15        * Scripts/prepare-ChangeLog:
     16        (get_function_line_ranges_for_cpp):
     17        (delete_namespaces_from_ranges_for_cpp): Added.
     18        (is_function_in_namespace): Added.
     19        * Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt: Updated
     20        to reflect revised definition of a function (i.e. excludes namespaces, classes, structs)
     21
    1222013-05-29  Praveen R Jadhav  <praveen.j@samsung.com>
    223
  • trunk/Tools/Scripts/prepare-ChangeLog

    r138259 r150939  
    8484sub get_function_line_ranges($$);
    8585sub get_function_line_ranges_for_cpp($$);
     86sub delete_namespaces_from_ranges_for_cpp(\@\@);
     87sub is_function_in_namespace($$);
    8688sub get_function_line_ranges_for_java($$);
    8789sub get_function_line_ranges_for_javascript($$);
     
    649651    my $potential_namespace = "";
    650652    my @namespaces;
     653    my @all_namespaces;
    651654
    652655    while (<$file_handle>) {
     
    812815                    if ($potential_namespace) {
    813816                        push @namespaces, $potential_namespace;
     817                        push @all_namespaces, $potential_namespace;
    814818                        $potential_namespace = "";
    815819                        $name = $namespaces[-1];
     
    927931    warn "mismatched parentheses in $file_name\n" if $in_parentheses;
    928932
    929     return @ranges;
    930 }
    931 
     933    return delete_namespaces_from_ranges_for_cpp(@ranges, @all_namespaces);
     934}
     935
     936
     937# Take in references to an array of line ranges for C functions in a given file
     938# and an array of namespaces declared in that file and return an updated
     939# list of line ranges with the namespaces removed.
     940
     941sub delete_namespaces_from_ranges_for_cpp(\@\@)
     942{
     943    my ($ranges, $namespaces) = @_;
     944    return grep {!is_function_in_namespace($namespaces, $$_[2])} @$ranges;
     945}
     946
     947
     948sub is_function_in_namespace($$)
     949{
     950    my ($namespaces, $function_name) = @_;
     951    return grep {$_ eq $function_name} @$namespaces;
     952}
    932953
    933954
  • trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt

    r106315 r150939  
    139139    ],
    140140    [
    141       '158',
    142       '159',
    143       'Class1'
    144     ],
    145     [
    146141      '162',
    147142      '164',
     
    184179    ],
    185180    [
    186       '204',
    187       '205',
    188       'Struct1'
    189     ],
    190     [
    191181      '208',
    192182      '210',
     
    199189    ],
    200190    [
    201       '219',
    202       '219',
    203       'NameSpace1'
    204     ],
    205     [
    206191      '220',
    207192      '222',
     
    209194    ],
    210195    [
    211       '223',
    212       '223',
    213       'NameSpace1'
    214     ],
    215     [
    216       '228',
    217       '228',
    218       'NameSpace2'
    219     ],
    220     [
    221196      '229',
    222197      '231',
     
    224199    ],
    225200    [
    226       '232',
    227       '232',
    228       'NameSpace2'
    229     ],
    230     [
    231       '237',
    232       '240',
    233       'Class104'
    234     ],
    235     [
    236       '244',
    237       '249',
    238       'Class105'
    239     ],
    240     [
    241       '253',
    242       '254',
    243       'Class106'
    244     ],
    245     [
    246201      '255',
    247202      '259',
     
    249204    ],
    250205    [
    251       '260',
    252       '261',
    253       'Class106'
    254     ],
    255     [
    256206      '262',
    257207      '266',
     
    259209    ],
    260210    [
    261       '267',
    262       '268',
    263       'Class106'
    264     ],
    265     [
    266       '272',
    267       '273',
    268       'NameSpace3'
    269     ],
    270     [
    271       '275',
    272       '276',
    273       'NameSpace4'
    274     ],
    275     [
    276       '278',
    277       '279',
    278       'NameSpace3'
    279     ],
    280     [
    281       '283',
    282       '284',
    283       'NameSpace5'
    284     ],
    285     [
    286       '286',
    287       '287',
    288       'NameSpace6'
    289     ],
    290     [
    291       '289',
    292       '290',
    293       'Class107'
    294     ],
    295     [
    296211      '291',
    297212      '295',
     
    299214    ],
    300215    [
    301       '296',
    302       '297',
    303       'Class107'
    304     ],
    305     [
    306       '299',
    307       '300',
    308       'NameSpace6'
    309     ],
    310     [
    311       '302',
    312       '303',
    313       'NameSpace5'
    314     ],
    315     [
    316       '307',
    317       '307',
    318       'Class108'
    319     ],
    320     [
    321216      '308',
    322217      '320',
    323218      'Class108::func35'
    324219    ],
    325     [
    326       '321',
    327       '321',
    328       'Class108'
    329     ],
    330     [
    331       '340',
    332       '354',
    333       'NameSpace7'
    334     ],
    335     [
    336       '356',
    337       '369',
    338       'NameSpace8'
    339     ],
    340     [
    341       '371',
    342       '371',
    343       'NameSpace7'
    344     ],
    345     [
    346       '373',
    347       '386',
    348       'Class109'
    349     ],
    350     [
    351       '388',
    352       '388',
    353       'NameSpace7'
    354     ]
    355220  ]
    356221}
Note: See TracChangeset for help on using the changeset viewer.