mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 01:46:13 +01: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:
parent
c3e37d8ba3
commit
c8bfad3661
@ -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':
|
||||||
|
Loading…
Reference in New Issue
Block a user