Added 'Co-Author' to co-author's regex

Co-Author: Sergey Nikitin <snikitin@mirantis.com>

Change-Id: I256e3a84dd022f7692305b482d7000dfbf47a0c7
This commit is contained in:
Pavel Kholkin 2015-05-12 15:02:08 +03:00
parent a11ec895f0
commit 1238ae6bd2
2 changed files with 42 additions and 2 deletions

View File

@ -74,7 +74,7 @@ MESSAGE_PATTERNS = {
'blueprint_id': re.compile(r'\b(?:blueprint|bp)\b[ \t]*[#:]?[ \t]*'
r'(?P<id>[a-z0-9-]+)', re.IGNORECASE),
'change_id': re.compile('Change-Id: (?P<id>I[0-9a-f]{40})', re.IGNORECASE),
'coauthor': re.compile(r'(?:Co-Authored|Also)-By:'
'coauthor': re.compile(r'(?:Co-Authored-By|Also-By|Co-Author):'
r'\s*(?P<id>%s)\s' % CO_AUTHOR_PATTERN_RAW,
re.IGNORECASE)
}

View File

@ -122,13 +122,28 @@ Also-By: Bob Dylan <bob.dylan@openstack.com>
Also-By: Anonymous <wrong@email>
Also-By: Winnie the Pooh winnie222@openstack.org
diff_stat:
0 files changed, 0 insertions(+), 0 deletions(-)
commit_id:d1af9cbe0187e1a65cf1eb46fb1650cf619a7b3a
date:1369831300
author_name:Vasya Pupkin
author_email:vpupkinx@openstack.com
subject:adds new support of co-authors
message:Change-Id: I577dfdf7f65a0c883ddbcfda62daf8c5f9c746c1
Co-Authored-By: Tupac Shakur <tupac.shakur@openstack.com>
Also: Bob Dylan <bob.dylan@openstack.com>
Co-Authored: Anonymous <correct@email.com>
Co-Author-By: Anonymous2 <correct@email2.com>
Co-Author: Winnie the Pooh winnie222@openstack.org
diff_stat:
0 files changed, 0 insertions(+), 0 deletions(-)
'''
commits = list(self.git.log('dummy', 'dummy'))
commits_expected = 7
commits_expected = 8
self.assertEqual(commits_expected, len(commits))
self.assertEqual(21, commits[0]['files_changed'])
@ -177,3 +192,28 @@ diff_stat:
{'author_name': 'Winnie the Pooh',
'author_email': 'winnie222@openstack.org'},
commits[6]['coauthor'])
self.assertIn(
{'author_name': 'Tupac Shakur',
'author_email': 'tupac.shakur@openstack.com'},
commits[7]['coauthor'])
self.assertNotIn(
{'author_name': 'Bob Dylan',
'author_email': 'bob.dylan@openstack.com'},
commits[7]['coauthor'])
self.assertNotIn(
{'author_name': 'Anonymous',
'author_email': 'correct@email.com'},
commits[7]['coauthor'])
self.assertNotIn(
{'author_name': 'Anonymous2',
'author_email': 'correct@email2.com'},
commits[7]['coauthor'])
self.assertIn(
{'author_name': 'Winnie the Pooh',
'author_email': 'winnie222@openstack.org'},
commits[7]['coauthor'])