1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-26 12:12:11 +01:00

support of added .changes in commit message template

This commit is contained in:
Michal Vyskocil 2009-04-27 08:54:59 +00:00
parent 004ca3cafe
commit af5259b387
2 changed files with 11 additions and 2 deletions

3
NEWS
View File

@ -1,3 +1,6 @@
0.118:
- support of added .changes in commit message template
0.117: 0.117:
- support checkout of single package via "osc co PACKAGE" when local dir is project - support checkout of single package via "osc co PACKAGE" when local dir is project
- allow to specify target project and package on osc branch (requires server version 1.6) - allow to specify target project and package on osc branch (requires server version 1.6)

View File

@ -3695,14 +3695,20 @@ def get_commit_message_template(pac):
return template return template
for file in files: for file in files:
if pac.status(file) == 'M':
diff += get_source_file_diff(pac.absdir, file, pac.rev) diff += get_source_file_diff(pac.absdir, file, pac.rev)
elif pac.status(file) == 'A':
f = open(file, 'r')
for line in f:
diff += '+' + line
f.close()
if diff: if diff:
index = 0 index = 0
diff = diff.split('\n') diff = diff.split('\n')
# The first four lines contains a header of diff # The first four lines contains a header of diff
for line in diff[4:]: for line in diff[3:]:
# this condition is magical, but it removes all unwanted lines from commit message # this condition is magical, but it removes all unwanted lines from commit message
if not(line) or (line and line[0] != '+') or \ if not(line) or (line and line[0] != '+') or \
date_re.match(line) or \ date_re.match(line) or \