def extract_headings_from_history(history_lines):
pattern = re.compile(r"""<STR_LIT>""", re.VERBOSE)<EOL>alt_pattern = re.compile(r"""<STR_LIT>""", re.VERBOSE)<EOL>headings = []<EOL>line_number = <NUM_LIT:0><EOL>for line in history_lines:<EOL><INDENT>match = pattern.search(line)<EOL>alt_match = alt_pattern.search(line)<EOL>if match:<EOL><INDENT>result = {'<STR_LIT>': line_number,<EOL>'<STR_LIT:version>': match.group('<STR_LIT:version>').strip(),<EOL>'<STR_LIT:date>': match.group('<STR_LIT:date>'.strip())}<EOL>headings.append(result)<EOL>logger.debug("<STR_LIT>", result)<EOL><DEDENT>if alt_match:<EOL><INDENT>result = {'<STR_LIT>': line_number,<EOL>'<STR_LIT:version>': alt_match.group('<STR_LIT:version>').strip(),<EOL>'<STR_LIT:date>': alt_match.group('<STR_LIT:date>'.strip())}<EOL>headings.append(result)<EOL>logger.debug("<STR_LIT>", result)<EOL><DEDENT>line_number += <NUM_LIT:1><EOL><DEDENT>return headings<EOL>
Return list of dicts with version-like headers.

    We check for patterns like '2.10 (unreleased)', so with either
    'unreleased' or a date between parenthesis as that's the format we're
    using. Just fix up your first heading and you should be set.

    As an alternative, we support an alternative format used by some
    zope/plone paster templates: '2.10 - unreleased' or '2.10 ~ unreleased'

    Note that new headers that zest.releaser sets are in our preferred
    form (so 'version (date)').