diff --git a/scripts/check-changelog.py b/scripts/check-changelog.py index 5a80c68079..08669502ca 100644 --- a/scripts/check-changelog.py +++ b/scripts/check-changelog.py @@ -61,3 +61,11 @@ if all_versions != sorted(all_versions): print('You edited old release notes and changed the ordering!') sys.exit(1) + + v_nums = [v.split(' - ')[0] for v in all_versions] + duplicates = sorted(set(v for v in v_nums if v_nums.count(v) > 1)) + if duplicates: + plural = 's have' if len(duplicates) > 1 else ' has' + print('The following version%s multiple entries in the ' + 'changelog: %s' % (plural, ', '.join(map(repr, duplicates)))) + sys.exit(1)