aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-03-17 12:19:01 -0700
committerIan Lance Taylor <iant@golang.org>2021-03-17 12:19:01 -0700
commitf10c7c4596dda99d2ee872c995ae4aeda65adbdf (patch)
treea3451277603bc8fbe2eddce5f4ad63f790129a01 /contrib
parentbc636c218f2b28da06cd1404d5b35d1f8cc43fd1 (diff)
parentf3e9c98a9f40fc24bb4ecef6aaa94ff799c8d587 (diff)
downloadgcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.zip
gcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.tar.gz
gcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.tar.bz2
Merge from trunk revision f3e9c98a9f40fc24bb4ecef6aaa94ff799c8d587.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog14
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py3
-rwxr-xr-xcontrib/gcc-changelog/git_email.py2
-rwxr-xr-xcontrib/gcc-changelog/git_update_version.py4
-rw-r--r--contrib/gcc-changelog/setup.cfg3
-rwxr-xr-xcontrib/gcc-changelog/test_email.py4
-rw-r--r--contrib/gcc-changelog/test_patches.txt30
7 files changed, 58 insertions, 2 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 0bc2fee..acf530e 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,17 @@
+2021-03-16 Martin Liska <mliska@suse.cz>
+
+ * gcc-changelog/git_update_version.py: Skip one problematic
+ commit.
+
+2021-03-12 Martin Liska <mliska@suse.cz>
+
+ * gcc-changelog/git_commit.py: Allow deletion of ChangeLog
+ files.
+ * gcc-changelog/setup.cfg: Set line limit to 120 characters.
+ * gcc-changelog/test_email.py: Add test.
+ * gcc-changelog/test_patches.txt: Likewise.
+ * gcc-changelog/git_email.py: Fix parsing of deleted files.
+
2021-02-08 Mike Frysinger <vapier@gentoo.org>
* mklog.py (generated_files): New set.
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index e9dae0a..43fa7f4 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -314,8 +314,9 @@ class GitCommit:
if self.revert_commit:
self.info = self.commit_to_info_hook(self.revert_commit)
+ # Allow complete deletion of ChangeLog files in a commit
project_files = [f for f in self.info.modified_files
- if self.is_changelog_filename(f[0], allow_suffix=True)
+ if (self.is_changelog_filename(f[0], allow_suffix=True) and f[1] != 'D')
or f[0] in misc_files]
ignored_files = [f for f in self.info.modified_files
if self.in_ignored_location(f[0])]
diff --git a/contrib/gcc-changelog/git_email.py b/contrib/gcc-changelog/git_email.py
index 00ad004..b0547b3 100755
--- a/contrib/gcc-changelog/git_email.py
+++ b/contrib/gcc-changelog/git_email.py
@@ -66,7 +66,7 @@ class GitEmail(GitCommit):
t = 'A'
else:
t = 'M'
- modified_files.append((target, t))
+ modified_files.append((target if t != 'D' else source, t))
git_info = GitInfo(None, date, author, body, modified_files)
super().__init__(git_info, strict=strict,
commit_to_info_hook=lambda x: None)
diff --git a/contrib/gcc-changelog/git_update_version.py b/contrib/gcc-changelog/git_update_version.py
index d2cadb8..1e2b22b 100755
--- a/contrib/gcc-changelog/git_update_version.py
+++ b/contrib/gcc-changelog/git_update_version.py
@@ -26,6 +26,9 @@ from git_repository import parse_git_revisions
current_timestamp = datetime.datetime.now().strftime('%Y%m%d\n')
+# Skip the following commits, they cannot be correctly processed
+IGNORED_COMMITS = ('c2be82058fb40f3ae891c68d185ff53e07f14f45')
+
def read_timestamp(path):
with open(path) as f:
@@ -98,6 +101,7 @@ def update_current_branch():
head = head.parents[1]
commits = parse_git_revisions(args.git_path, '%s..%s'
% (commit.hexsha, head.hexsha))
+ commits = [c for c in commits if c.info.hexsha not in IGNORED_COMMITS]
for git_commit in reversed(commits):
prepend_to_changelog_files(repo, args.git_path, git_commit,
not args.dry_mode)
diff --git a/contrib/gcc-changelog/setup.cfg b/contrib/gcc-changelog/setup.cfg
index 9e4a0f6..efc313f 100644
--- a/contrib/gcc-changelog/setup.cfg
+++ b/contrib/gcc-changelog/setup.cfg
@@ -1,2 +1,5 @@
+[flake8]
+max-line-length = 120
+
[tool:pytest]
addopts = -vv --flake8
diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py
index b81548f..9d052e0 100755
--- a/contrib/gcc-changelog/test_email.py
+++ b/contrib/gcc-changelog/test_email.py
@@ -416,3 +416,7 @@ class TestGccChangelog(unittest.TestCase):
def test_multiline_bad_parentheses(self):
email = self.from_patch_glob('0002-Wrong-macro-changelog.patch')
assert email.errors[0].message == 'bad parentheses wrapping'
+
+ def test_changelog_removal(self):
+ email = self.from_patch_glob('0001-ChangeLog-removal.patch', strict=True)
+ assert not email.errors
diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt
index 9de2897..012573b 100644
--- a/contrib/gcc-changelog/test_patches.txt
+++ b/contrib/gcc-changelog/test_patches.txt
@@ -3481,3 +3481,33 @@ index ac63591b33f..ff4d61764e7 100644
+
--
2.29.2
+
+=== 0001-ChangeLog-removal.patch ===
+From b39fadf9df1a9510afcab0a391182da7dc68de24 Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Fri, 12 Mar 2021 09:10:55 +0100
+Subject: [PATCH] Test ChangeLog removal.
+
+gcc/ChangeLog:
+
+ * ipa-icf.c (make_pass_ipa_icf): Add line.
+---
+diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
+deleted file mode 100644
+index 94e87f6bcde..00000000000
+--- a/gcc/analyzer/ChangeLog
++++ /dev/null
+@@ -1,1 +0,0 @@
+- foo
+diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
+index 5dd33a75c3a..c4ce432cb98 100644
+--- a/gcc/ipa-icf.c
++++ b/gcc/ipa-icf.c
+@@ -3655,3 +3655,4 @@ make_pass_ipa_icf (gcc::context *ctxt)
+ {
+ return new ipa_icf::pass_ipa_icf (ctxt);
+ }
++
+--
+2.30.1
+