diff --git a/release-scripts/create_log.py b/release-scripts/create_log.py index 83bb86391e..819cbedfc7 100755 --- a/release-scripts/create_log.py +++ b/release-scripts/create_log.py @@ -1,139 +1,149 @@ #!/usr/bin/env python3 # stolen from releaseme/plasma, which was stolen from release-tools Applications/15.04 branch # ported to Python 3 and fixed the worst issues + removed Plasma-related bits --Kevin from __future__ import print_function import argparse import os import subprocess import sys import cgi -def createLog(workingDir, fromVersion, toVersion, repositoryName=None): +def createLog(workingDir, fromVersion, toVersion, repositoryName=None, showInterestingChangesOnly=True): if not repositoryName: # use cwd name as repository name repositoryName = os.path.split(workingDir)[1] p = subprocess.Popen('git fetch', shell=True, cwd=workingDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) if p.wait() != 0: raise NameError('git fetch failed') p = subprocess.Popen('git rev-parse ' + fromVersion + ' ' + toVersion, shell=True, cwd=workingDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) if p.wait() != 0: raise NameError("git rev-parse failed -- correct to/from version?") p = subprocess.Popen('git log ' + fromVersion + '...' + toVersion, shell=True, cwd=workingDir, stdout=subprocess.PIPE, universal_newlines=True) commit = [] commits = [] for line in p.stdout: if line.startswith("commit"): if len(commit) > 1 and not ignoreCommit: commits.append(commit) commitHash = line[7:].strip() ignoreCommit = False commit = [commitHash] elif line.startswith("Author"): pass elif line.startswith("Date"): pass elif line.startswith("Merge"): pass else: line = line.strip() if line.startswith("Merge remote-tracking branch"): ignoreCommit = True elif line.startswith("SVN_SILENT"): ignoreCommit = True elif line.startswith("GIT_SILENT"): ignoreCommit = True elif line.startswith("Merge branch"): ignoreCommit = True elif line.startswith("Update version number for"): ignoreCommit = True elif line: commit.append(line) # Add the last commit if len(commit) > 1 and not ignoreCommit: commits.append(commit) - if len(commits): - print("

" + repositoryName + "

") - print("