diff --git a/docs/changelog.txt b/docs/changelog.txt index c87ab4cbb..6f50f70c5 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -26,6 +26,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: are not of interest to users of stable builds only. - Three ``[`` characters indicate the start of a block (possibly a comment) that spans multiple lines. Three ``]`` characters indicate the end of such a block. +- ``!`` immediately before a blacklisted phrase (see gen_changelog.py) allows that occurrence only. ===end ]]] @@ -38,7 +39,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Fixes - `liquids`: fixed "range" command to default to 1 for dimensions consistently -- `search`: fixed 4/6 keys in unit screen search +- `search-plugin`: fixed 4/6 keys in unit screen search ================================================================================ # 0.44.09-r1 diff --git a/docs/gen_changelog.py b/docs/gen_changelog.py index f5746dbf2..521219dcd 100644 --- a/docs/gen_changelog.py +++ b/docs/gen_changelog.py @@ -19,6 +19,19 @@ CHANGELOG_SECTIONS = [ 'Ruby', ] +BLACKLIST = [ + '`search`', +] + +def find_all_indices(string, substr): + start = 0 + while True: + i = string.find(substr, start) + if i == -1: + return + yield i + start = i + 1 + class ChangelogEntry(object): def __init__(self, text, section, stable_version, dev_version): text = text.lstrip('- ') @@ -57,6 +70,14 @@ def parse_changelog(): for line_id, line in enumerate(f.readlines()): line_id += 1 + for phrase in BLACKLIST: + for i in find_all_indices(line, phrase): + if i == 0 or line[i - 1] != '!': + raise ValueError( + 'changelog.txt:%i: blacklisted phrase: %r' % + (line_id, phrase)) + line = line.replace('!' + phrase, phrase) + if multiline: multiline += line elif '[[[' in line: