def get_changes(gitfrom=None): re_breaking = re.compile('BREAKING CHANGE: (.*)') for _hash, commit_message in get_commit_log(gitfrom): try: message = current_commit_parser()(commit_message) if message[1] not in changes: changes[message[1]] = [] print('Type {} is not supported?'.format(message[1])) changes[message[1]].append((_hash, message[2], message[3][0])) if message[3][1] and 'BREAKING CHANGE' in message[3][1]: parts = re_breaking.match(message[3][1]) if parts: changes['breaking'].append((_hash, parts.group(1))) if message[3][2] and 'BREAKING CHANGE' in message[3][2]: parts = re_breaking.match(message[3][2]) if parts: changes['breaking'].append((_hash, parts.group(1))) except UnknownCommitMessageStyleError: pass return changes
def test_first_commit_is_not_initial_commit(): assert next(get_commit_log()) != 'Initial commit'
def test_first_commit_is_not_initial_commit(self): self.assertNotEqual(next(get_commit_log()), 'Initial commit')