1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-05 10:58:07 +01:00

move changes file diff parser to separate function

This commit is contained in:
Ludwig Nussel 2010-02-02 14:12:22 +01:00
parent 048c479a3e
commit f29ffcdaef

View File

@ -4498,7 +4498,6 @@ def get_commit_message_template(pac):
"""
diff = ""
template = []
date_re = re.compile(r'\+(Mon|Tue|Wed|Thu|Fri|Sat|Sun) ([A-Z][a-z]{2}) ( ?[0-9]|[0-3][0-9]) .*')
if pac.todo:
files = filter(lambda file: '.changes' in file and pac.status(file) in ('A', 'M'), pac.todo)
if not files:
@ -4514,6 +4513,12 @@ def get_commit_message_template(pac):
f.close()
if diff:
template = parse_diff_for_commit_message(diff)
return template
def parse_diff_for_commit_message(diff, template = []):
date_re = re.compile(r'\+(Mon|Tue|Wed|Thu|Fri|Sat|Sun) ([A-Z][a-z]{2}) ( ?[0-9]|[0-3][0-9]) .*')
index = 0
diff = diff.split('\n')