Support DR entries for gcc-changelog.

* gcc-changelog/git_commit.py: Support DR entries/
	* gcc-changelog/test_email.py: New test for it.
	* gcc-changelog/test_patches.txt: New patch for it.
This commit is contained in:
Martin Liska 2020-05-21 10:23:50 +02:00
parent e7c7cdc5f4
commit 9722b1399a
No known key found for this signature in database
GPG Key ID: 4DC182DC0FA73785
4 changed files with 41 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2020-05-21 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Support DR entries/
* gcc-changelog/test_email.py: New test for it.
* gcc-changelog/test_patches.txt: New patch for it.
2020-05-21 Martin Liska <mliska@suse.cz> 2020-05-21 Martin Liska <mliska@suse.cz>
* mklog.py: Support DR parsing. * mklog.py: Support DR parsing.

View File

@ -145,6 +145,7 @@ author_line_regex = \
additional_author_regex = re.compile(r'^\t(?P<spaces>\ *)?(?P<name>.* <.*>)') additional_author_regex = re.compile(r'^\t(?P<spaces>\ *)?(?P<name>.* <.*>)')
changelog_regex = re.compile(r'^([a-z0-9+-/]*)/ChangeLog:?') changelog_regex = re.compile(r'^([a-z0-9+-/]*)/ChangeLog:?')
pr_regex = re.compile(r'\tPR (?P<component>[a-z+-]+\/)?([0-9]+)$') pr_regex = re.compile(r'\tPR (?P<component>[a-z+-]+\/)?([0-9]+)$')
dr_regex = re.compile(r'\tDR ([0-9]+)$')
star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)') star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
LINE_LIMIT = 100 LINE_LIMIT = 100
@ -297,7 +298,7 @@ class GitCommit:
continue continue
if (changelog_regex.match(b) or self.find_changelog_location(b) if (changelog_regex.match(b) or self.find_changelog_location(b)
or star_prefix_regex.match(b) or pr_regex.match(b) or star_prefix_regex.match(b) or pr_regex.match(b)
or author_line_regex.match(b)): or dr_regex.match(b) or author_line_regex.match(b)):
self.changes = body[i:] self.changes = body[i:]
return return
self.errors.append(Error('cannot find a ChangeLog location in ' self.errors.append(Error('cannot find a ChangeLog location in '
@ -350,6 +351,8 @@ class GitCommit:
continue continue
else: else:
pr_line = line.lstrip() pr_line = line.lstrip()
elif dr_regex.match(line):
pr_line = line.lstrip()
lowered_line = line.lower() lowered_line = line.lower()
if lowered_line.startswith(CO_AUTHORED_BY_PREFIX): if lowered_line.startswith(CO_AUTHORED_BY_PREFIX):

View File

@ -272,3 +272,7 @@ class TestGccChangelog(unittest.TestCase):
email = self.from_patch_glob('0001-Fortran-ProcPtr-function.patch') email = self.from_patch_glob('0001-Fortran-ProcPtr-function.patch')
assert not email.errors assert not email.errors
assert len(email.changelog_entries[0].author_lines) == 1 assert len(email.changelog_entries[0].author_lines) == 1
def test_dr_entry(self):
email = self.from_patch_glob('0001-c-C-20-DR-2237.patch')
assert email.changelog_entries[0].prs == ['DR 2237']

View File

@ -2541,3 +2541,30 @@ index 00000000000..ecb0a43929f
-- --
2.26.2 2.26.2
=== 0001-c-C-20-DR-2237.patch ===
From 4b38d56dbac6742b038551a36ec80200313123a1 Mon Sep 17 00:00:00 2001
From: Marek Polacek <polacek@redhat.com>
Date: Sat, 4 Apr 2020 18:09:53 -0400
Subject: [PATCH] c++: C++20 DR 2237, disallow simple-template-id in cdtor.
This patch implements DR 2237 which says that a simple-template-id is
no longer valid as the declarator-id of a constructor or destructor;
see [diff.cpp17.class]#2. It is not explicitly stated but out-of-line
destructors with a simple-template-id are also meant to be ill-formed
now. (Out-of-line constructors like that are invalid since DR1435 I
think.) This change only applies to C++20; it is not a DR against C++17.
I'm not crazy about the diagnostic in constructors but ISTM that
cp_parser_constructor_declarator_p shouldn't print errors.
DR 2237
* parser.c (cp_parser_unqualified_id): Reject simple-template-id as
the declarator-id of a destructor.
---
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index a6a5d975af3..a8082d39aca 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -1 +1,2 @@
+