mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 07:06:13 +01:00
- only allow --diff for submit requests
This commit is contained in:
parent
ea3e5d20bf
commit
6b10a47fbc
@ -1236,7 +1236,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
else:
|
||||
print r
|
||||
# fixme: will inevitably fail if the given target doesn't exist
|
||||
if opts.diff:
|
||||
if opts.diff and r.actions[0].type != 'submit':
|
||||
raise oscerr.WrongOptions('\'--diff\' is not possible for request type: \'%s\'' % r.actions[0].type)
|
||||
elif opts.diff:
|
||||
try:
|
||||
print server_diff(conf.config['apiurl'],
|
||||
r.actions[0].dst_project, r.actions[0].dst_package, None,
|
||||
|
@ -4636,6 +4636,9 @@ def request_interactive_review(apiurl, request):
|
||||
while True:
|
||||
repl = raw_input('d(i)ff/(a)ccept/(d)ecline/(r)evoke/(c)ancel > ')
|
||||
if repl == 'i':
|
||||
if request.actions[0].type != 'submit':
|
||||
print >>sys.stderr, 'diff is not possible for request type: \'%s\'' % request.actions[0].type
|
||||
continue
|
||||
if tmpfile is None:
|
||||
tmpfile = tempfile.NamedTemporaryFile()
|
||||
tmpfile.write(server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
|
||||
|
Loading…
Reference in New Issue
Block a user