Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commit_info.author_time #75

Merged
merged 1 commit into from
Apr 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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