Skip to content

Commit

Permalink
Merge pull request #2248 from minrk/master_sha
Browse files Browse the repository at this point in the history
track sha of master in test_pr messages
  • Loading branch information
takluyver committed Aug 4, 2012
2 parents ecae5d1 + a311548 commit b32ac6d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/test_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def setup(self):
check_call(['git', 'pull', 'origin', 'master'])
except CalledProcessError :
check_call(['git', 'pull', ipy_http_repository, 'master'])
self.master_sha = check_output(['git', 'log', '-1', '--format=%h']).decode('ascii').strip()
os.chdir(basedir)

def get_branch(self):
Expand Down Expand Up @@ -125,7 +126,7 @@ def format_result(result):
return s

if self.pr['mergeable']:
com = self.pr['head']['sha'][:7] + " merged into master"
com = self.pr['head']['sha'][:7] + " merged into master (%s)" % self.master_sha
else:
com = self.pr['head']['sha'][:7] + " (can't merge cleanly)"
lines = ["**Test results for commit %s**" % com,
Expand All @@ -146,10 +147,12 @@ def print_results(self):
pr = self.pr

print("\n")
msg = "**Test results for commit %s" % pr['head']['sha'][:7]
if pr['mergeable']:
print("**Test results for commit %s merged into master**" % pr['head']['sha'][:7])
msg += " merged into master (%s)**" % self.master_sha
else:
print("**Test results for commit %s (can't merge cleanly)**" % pr['head']['sha'][:7])
msg += " (can't merge cleanly)**"
print(msg)
print("Platform:", sys.platform)
for result in self.results:
if result.passed:
Expand Down

0 comments on commit b32ac6d

Please sign in to comment.