1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

- core.edit_message: check if the user modified the log template

If the user didn't change the default template it either means that
he wants to use the default message or that he wants to abort the process.
So if the template wasn't modified osc will prompt:

Commit template was not changed
a)bort, c)ontinue, e)dit:
This commit is contained in:
Marcus Huewe 2013-02-13 11:42:34 +01:00
parent c3e37d8ba3
commit c8bfad3661

View File

@ -3481,12 +3481,13 @@ def edit_message(footer='', template='', templatelen=30):
while 1:
run_editor(filename)
msg = open(filename).read().split(delim)[0].rstrip()
if len(msg):
if msg and template != msg:
break
else:
ri = raw_input('Log message not specified\n'
'a)bort, c)ontinue, e)dit: ')
reason = 'Log message not specified'
if template and template == msg:
reason = 'Log template was not changed'
ri = raw_input('%s\na)bort, c)ontinue, e)dit: ' % reason)
if ri in 'aA':
raise oscerr.UserAbort()
elif ri in 'cC':