@@ -76,9 +76,11 @@ def get_symbols(change_type, diff_lines_getter, prefix):
76
76
def a_diff_lines_getter (diff_lines ):
77
77
return diff_lines .b_blob .data_stream .read ().decode ("utf-8" ).split ("\n " )
78
78
79
+
79
80
def d_diff_lines_getter (diff_lines ):
80
81
return diff_lines .a_blob .data_stream .read ().decode ("utf-8" ).split ("\n " )
81
82
83
+
82
84
def m_diff_lines_getter (diff_lines ):
83
85
return unified_diff (
84
86
diff_lines .a_blob .data_stream .read ().decode ("utf-8" ).split ("\n " ),
@@ -91,6 +93,7 @@ def m_diff_lines_getter(diff_lines):
91
93
get_symbols ("M" , m_diff_lines_getter , r"\+" )
92
94
get_symbols ("M" , m_diff_lines_getter , r"\-" )
93
95
96
+
94
97
def remove_common_symbols ():
95
98
# For each file, we remove the symbols that are added and removed in the
96
99
# same commit.
@@ -115,17 +118,18 @@ def remove_common_symbols():
115
118
if not removed_symbols [file_path ]:
116
119
del removed_symbols [file_path ]
117
120
121
+
118
122
if added_symbols or removed_symbols :
119
123
120
124
# If a symbol is added and removed in the same commit, we consider it
121
125
# as not added or removed.
122
126
remove_common_symbols ()
123
127
print ("The code in this branch adds the following public symbols:" )
124
128
print ()
125
- for file_path , symbols in added_symbols .items ():
126
- print (f"- { file_path } " )
127
- for symbol in symbols :
128
- print (f"\t { symbol } " )
129
+ for file_path_ , symbols_ in added_symbols .items ():
130
+ print (f"- { file_path_ } " )
131
+ for symbol_ in symbols_ :
132
+ print (f"\t { symbol_ } " )
129
133
print ()
130
134
131
135
print (
@@ -137,10 +141,10 @@ def remove_common_symbols():
137
141
print ()
138
142
print ("The code in this branch removes the following public symbols:" )
139
143
print ()
140
- for file_path , symbols in removed_symbols .items ():
141
- print (f"- { file_path } " )
142
- for symbol in symbols :
143
- print (f"\t { symbol } " )
144
+ for file_path_ , symbols_ in removed_symbols .items ():
145
+ print (f"- { file_path_ } " )
146
+ for symbol_ in symbols_ :
147
+ print (f"\t { symbol_ } " )
144
148
print ()
145
149
146
150
print (
0 commit comments