Skip to content

Commit 8913a64

Browse files
authored
Revert "Include subheaders in script output (#10212)" (#10652)
This reverts commit 11313da.
1 parent 114306b commit 8913a64

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

scripts/make_release_notes.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -256,29 +256,22 @@ def read_changelog_section(filename, single_version=None):
256256
# Discard all lines until we see a heading that either has the version the
257257
# user asked for or any version.
258258
if single_version:
259-
initial_heading = re.compile(
260-
r'^(#{1,6}) .*%s' % re.escape(single_version))
259+
initial_heading = re.compile(r'^#{1,6} .*%s' % re.escape(single_version))
261260
else:
262-
initial_heading = re.compile(r'^#({1,6}) ([^\d]*)\d')
261+
initial_heading = re.compile(r'^#{1,6} ([^\d]*)\d')
263262

264-
heading = re.compile(r'^(#{1,6}) ')
263+
heading = re.compile(r'^#{1,6} ')
265264

266265
initial = True
267-
heading_level = 6
268266
result = []
269267
for line in fd:
270268
if initial:
271-
match = initial_heading.match(line)
272-
if match:
269+
if initial_heading.match(line):
273270
initial = False
274-
heading_level = len(match.group(1))
275271
result.append(line)
276272

277273
else:
278-
match = heading.match(line)
279-
# We only break if we find a new header at the same, or higher,
280-
# level.
281-
if match and len(match.group(1)) <= heading_level:
274+
if heading.match(line):
282275
break
283276

284277
result.append(line)

0 commit comments

Comments
 (0)