Skip to content

Commit f4695e9

Browse files
authored
[meta] Fix enum initializers list for ancestry check (#2157)
When enums values are added in the middle there of enum it can cause ancestry check fail since initializers sorting was missing
1 parent 1f2bca1 commit f4695e9

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

meta/ancestry.1f2bca1.history

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

meta/ancestry.5f75d99.history

Lines changed: 0 additions & 1 deletion
This file was deleted.

meta/checkancestry.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function create_commit_list()
106106

107107
function check_enum_history()
108108
{
109-
perl ancestry.pl -H "ancestry.5f75d99.history" $LIST
109+
perl ancestry.pl -H "ancestry.1f2bca1.history" $LIST
110110
}
111111

112112
#
@@ -122,7 +122,7 @@ function check_enum_history()
122122
# the processing time will increase too much
123123

124124
BEGIN_COMMIT=3132018 # from this commit we are backward compatible
125-
BEGIN_COMMIT=5f75d99 # to this commit we have history file
125+
BEGIN_COMMIT=1f2bca1 # to this commit we have history file
126126
END_COMMIT=HEAD
127127

128128
clean_temp_dir

meta/utils.pm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,10 @@ sub ProcessEnumInitializers
601601

602602
my @sorted = sort { substr($a, 0, 10) cmp substr($b, 0, 10) } @joined;
603603

604+
my @sorted_ini = (@sorted);
605+
604606
s/^0x[0-9a-f]{8}SAI/SAI/i for @sorted;
607+
s/SAI.*//i for @sorted_ini;
605608

606609
my $after = "@sorted";
607610

@@ -612,8 +615,13 @@ sub ProcessEnumInitializers
612615
@$arr_ref = ();
613616

614617
push @$arr_ref, @sorted;
615-
}
616618

619+
# initializers must be sorted as well
620+
621+
@$ini_ref = ();
622+
623+
push @$ini_ref, @sorted_ini;
624+
}
617625

618626
BEGIN
619627
{

0 commit comments

Comments
 (0)