mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-12 02:04:04 +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:
@@ -3481,12 +3481,13 @@ def edit_message(footer='', template='', templatelen=30):
|
|||||||
while 1:
|
while 1:
|
||||||
run_editor(filename)
|
run_editor(filename)
|
||||||
msg = open(filename).read().split(delim)[0].rstrip()
|
msg = open(filename).read().split(delim)[0].rstrip()
|
||||||
|
if msg and template != msg:
|
||||||
if len(msg):
|
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
ri = raw_input('Log message not specified\n'
|
reason = 'Log message not specified'
|
||||||
'a)bort, c)ontinue, e)dit: ')
|
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':
|
if ri in 'aA':
|
||||||
raise oscerr.UserAbort()
|
raise oscerr.UserAbort()
|
||||||
elif ri in 'cC':
|
elif ri in 'cC':
|
||||||
|
Reference in New Issue
Block a user