diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2021-05-10 14:36:52 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2021-05-10 14:37:15 +0200 |
commit | c1d381f0079a8594957be0513a00627caa219b73 (patch) | |
tree | b46b54cd3601b1d819d0b3e9af200dcae79bf87c /contrib/gcc-changelog/git_commit.py | |
parent | 1f94ed3b4c308c9da7baf59ecbc0f953e994f9c4 (diff) | |
download | gcc-c1d381f0079a8594957be0513a00627caa219b73.zip gcc-c1d381f0079a8594957be0513a00627caa219b73.tar.gz gcc-c1d381f0079a8594957be0513a00627caa219b73.tar.bz2 |
contrib/gcc-changelog: Detect if same file appears twice
contrib/ChangeLog:
* gcc-changelog/git_commit.py (Error.__repr__): Add space after the colon.
(GitCommit.check_mentioned_files): Check whether the same file has been
specified multiple times.
* gcc-changelog/test_email.py (TestGccChangelog.test_multi_same_file): New.
* gcc-changelog/test_patches.txt (0001-OpenMP-Fix-SIMT): New test.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
-rwxr-xr-x | contrib/gcc-changelog/git_commit.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index b28f7de..d9332cb 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -200,7 +200,7 @@ class Error: def __repr__(self): s = self.message if self.line: - s += ':"%s"' % self.line + s += ': "%s"' % self.line return s @@ -629,7 +629,12 @@ class GitCommit: assert not entry.folder.endswith('/') for file in entry.files: if not self.is_changelog_filename(file): - mentioned_files.add(os.path.join(entry.folder, file)) + item = os.path.join(entry.folder, file) + if item in mentioned_files: + msg = 'same file specified multiple times' + self.errors.append(Error(msg, file)) + else: + mentioned_files.add(item) for pattern in entry.file_patterns: mentioned_patterns.append(os.path.join(entry.folder, pattern)) |