Fix the changed file detection

The merge commits created by zuul do not always list all of the files
being modified, so use git diff instead of git show.

Also force python to use unbuffered I/O so the output comes out in a
useful order instead of mixed up with the subprocess commands.

Change-Id: I5e0e4602e463c05e488537192be8ba59c08644dc
This commit is contained in:
Doug Hellmann 2015-07-27 20:22:11 +00:00
parent 228f79fe88
commit fd5ff7c20a
2 changed files with 3 additions and 1 deletions

View File

@ -26,7 +26,7 @@ CGIT_TEMPLATE = 'http://git.openstack.org/cgit/%s/commit/?id=%s'
def find_modified_deliverable_files():
"Return a list of files modified by the most recent commit."
results = subprocess.check_output(
['git', 'show', '--name-only', '--pretty=format:']
['git', 'diff', '--name-only', '--pretty=format:', 'HEAD^']
)
filenames = [
l.strip()

View File

@ -16,6 +16,8 @@ deps = -r{toxinidir}/requirements.txt
commands = validate-request {posargs}
[testenv:list-changes]
setenv =
PYTHONUNBUFFERED=1
commands = list-changes {posargs}
[testenv:pep8]