Skip to content

Commit

Permalink
Merge pull request #75 from varac/add_commit_info_authortime
Browse files Browse the repository at this point in the history
Add commit_info.author_time
  • Loading branch information
ionelmc committed Apr 10, 2017
2 parents bbb9406 + a99d9e9 commit 77106eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pytest_benchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def get_commit_info(project_name=None):
dirty = False
commit = 'unversioned'
commit_time = None
author_time = None
project_name = project_name or get_project_name()
branch = get_branch_info()
try:
Expand All @@ -190,6 +191,8 @@ def get_commit_info(project_name=None):
commit = desc[-1].strip('g')
commit_time = check_output('git show -s --pretty=format:"%cI"'.split(),
universal_newlines=True).strip().strip('"')
author_time = check_output('git show -s --pretty=format:"%aI"'.split(),
universal_newlines=True).strip().strip('"')
elif in_any_parent('.hg'):
desc = check_output('hg id --id --debug'.split(), universal_newlines=True).strip()
if desc[-1] == '+':
Expand All @@ -200,6 +203,7 @@ def get_commit_info(project_name=None):
return {
'id': commit,
'time': commit_time,
'author_time': author_time,
'dirty': dirty,
'project': project_name,
'branch': branch,
Expand All @@ -208,6 +212,7 @@ def get_commit_info(project_name=None):
return {
'id': 'unknown',
'time': None,
'author_time': None,
'dirty': dirty,
'error': repr(exc),
'project': project_name,
Expand Down

0 comments on commit 77106eb

Please sign in to comment.