~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/generate_release_notes.py

  • Committer: Vincent Ladeuil
  • Date: 2010-05-05 17:04:30 UTC
  • mto: (5355.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5356.
  • Revision ID: v.ladeuil+lp@free.fr-20100505170430-q4tk3abru8jjp84l
Fix bug in release notes generation.

* tools/generate_release_notes.py:
(split_into_topics): Fix broken match ('bzr-0' is 5 chars, it
can't match with line[:4]).
(open_topic_file): Reference the right document.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    """
31
31
    topic_file = None
32
32
    for index, line in enumerate(lines):
33
 
        maybe_new_topic = line[:4] in ['bzr ', 'bzr-0',]
 
33
        maybe_new_topic = line[:4] in ('bzr ', 'bzr-',)
34
34
        if maybe_new_topic and lines[index + 1].startswith('####'):
35
35
            release = line.strip()
36
36
            if topic_file is None:
51
51
                    continue
52
52
            # Still in the header - dump content straight to output
53
53
            out_file.write(line)
 
54
    if topic_file is not None:
 
55
        # Close the last topic_file opened
 
56
        topic_file.close()
54
57
 
55
58
 
56
59
def open_topic_file(out_file, out_dir, release):
57
60
    topic_name = release.replace(' ', '-')
58
 
    out_file.write("   %s\n" % (topic_name,))
 
61
    out_file.write("   %s <%s>\n" % (release, topic_name,))
59
62
    topic_path = os.path.join(out_dir, "%s.txt" % (topic_name,))
60
63
    result = open(topic_path, 'w')
61
64
    result.write("%s\n" % (release,))