From 9722b1399a555e697538aa9b0daec77127596dea Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 21 May 2020 10:23:50 +0200 Subject: 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. --- contrib/gcc-changelog/git_commit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'contrib/gcc-changelog/git_commit.py') diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 8c347d1..e22d3a2 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -145,6 +145,7 @@ author_line_regex = \ additional_author_regex = re.compile(r'^\t(?P\ *)?(?P.* <.*>)') changelog_regex = re.compile(r'^([a-z0-9+-/]*)/ChangeLog:?') pr_regex = re.compile(r'\tPR (?P[a-z+-]+\/)?([0-9]+)$') +dr_regex = re.compile(r'\tDR ([0-9]+)$') star_prefix_regex = re.compile(r'\t\*(?P\ *)(?P.*)') LINE_LIMIT = 100 @@ -297,7 +298,7 @@ class GitCommit: continue if (changelog_regex.match(b) or self.find_changelog_location(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:] return self.errors.append(Error('cannot find a ChangeLog location in ' @@ -350,6 +351,8 @@ class GitCommit: continue else: pr_line = line.lstrip() + elif dr_regex.match(line): + pr_line = line.lstrip() lowered_line = line.lower() if lowered_line.startswith(CO_AUTHORED_BY_PREFIX): -- cgit v1.1