| from __future__ import print_function |
| from scriptCommon import catchPath |
| from scriptCommon import runAndCapture |
| issueNumberRe = re.compile( r'(.*?)#([0-9]*)([^0-9]?.*)' ) |
| rootPath = os.path.join( catchPath, 'include/' ) |
| versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) |
| hashes = runAndCapture( ['git', 'log', '-2', '--format="%H"', versionPath] ) |
| lines = runAndCapture( ['git', 'log', hashes[1] + ".." + hashes[0], catchPath] ) |
| def getIssueTitle( issueNumber ): |
| s = urllib2.urlopen("https://api.github.com/repos/philsquared/catch/issues/" + issueNumber ).read() |
| if line.startswith( "commit"): |
| elif line.startswith( "Author:"): |
| elif line.startswith( "Date:"): |
| dates.append( line[5:].lstrip() ) |
| elif line == "" and prevLine == "": |
| match = issueNumberRe.match( line ) |
| issueNumber = match.group(2) |
| issue = '#{0} ("{1}")'.format( issueNumber, getIssueTitle( issueNumber ) ) |
| line2 = line2 + match.group(1) + issue |
| match = issueNumberRe.match( match.group(3) ) |
| print("All changes between {0} and {1}:\n".format( dates[-1], dates[0] )) |