MCPcopy Create free account
hub / github.com/apache/solr / _parse_version_section

Method _parse_version_section

dev-tools/scripts/changes2logchange.py:481–512  ·  view source on GitHub ↗

Parse all entries within a single version section.

(self, version: str, content: str)

Source from the content-addressed store, hash-verified

479 self.versions.append(version_section)
480
481 def _parse_version_section(self, version: str, content: str) -> VersionSection:
482 """Parse all entries within a single version section."""
483 version_section = VersionSection(version)
484
485 # Split into subsections (New Features, Bug Fixes, etc.)
486 section_matches = list(self.SECTION_HEADER_PATTERN.finditer(content))
487
488 for i, section_match in enumerate(section_matches):
489 section_name = section_match.group(1)
490
491 # Skip sections that should not be migrated
492 if section_name in ChangeType.SKIP_SECTIONS:
493 continue
494
495 section_type = ChangeType.get_type(section_name)
496
497 start_pos = section_match.end()
498
499 # Find the end of this section (start of next section or EOF)
500 if i + 1 < len(section_matches):
501 end_pos = section_matches[i + 1].start()
502 else:
503 end_pos = len(content)
504
505 section_content = content[start_pos:end_pos]
506
507 # Parse entries in this section
508 entries = self._parse_entries(section_content, section_type)
509 for entry in entries:
510 version_section.add_entry(entry)
511
512 return version_section
513
514 def _parse_entries(self, section_content: str, change_type: str) -> List[ChangeEntry]:
515 """Parse individual entries within a section.

Callers 1

parseMethod · 0.95

Calls 6

_parse_entriesMethod · 0.95
add_entryMethod · 0.95
VersionSectionClass · 0.85
get_typeMethod · 0.80
endMethod · 0.65
startMethod · 0.65

Tested by

no test coverage detected