Merge "Don't use GitPython for authors check"

This commit is contained in:
Jenkins 2011-09-23 17:38:21 +00:00 committed by Gerrit Code Review
commit a3dd74bb66
1 changed files with 5 additions and 10 deletions

View File

@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import commands
import errno
import os
import select
@ -67,19 +68,13 @@ class ProjectTestCase(test.TestCase):
tree.unlock()
elif os.path.exists(os.path.join(topdir, '.git')):
import git
repo = git.Repo(topdir)
for commit in repo.head.commit.iter_parents():
email = commit.author.email
if email is None:
email = commit.author.name
if 'nova-core' in email:
for email in commands.getoutput('git log --format=%ae').split():
if not email:
continue
if "jenkins@review.openstack.org" in email:
continue
if email.split(' ')[-1] == '<>':
email = email.split(' ')[-2]
email = '<' + email + '>'
contributors.add(str_dict_replace(email, mailmap))
else:
return