Skip to content

Commit

Permalink
- core.edit_message: check if the user modified the log template
Browse files Browse the repository at this point in the history
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:
  • Loading branch information
marcus-h committed Feb 13, 2013
1 parent c3e37d8 commit c8bfad3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit c8bfad3

Please sign in to comment.