mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-11 17:54:06 +02:00
- only allow --diff for submit requests
This commit is contained in:
@@ -1236,7 +1236,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
else:
|
else:
|
||||||
print r
|
print r
|
||||||
# fixme: will inevitably fail if the given target doesn't exist
|
# 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:
|
try:
|
||||||
print server_diff(conf.config['apiurl'],
|
print server_diff(conf.config['apiurl'],
|
||||||
r.actions[0].dst_project, r.actions[0].dst_package, None,
|
r.actions[0].dst_project, r.actions[0].dst_package, None,
|
||||||
|
@@ -4636,6 +4636,9 @@ def request_interactive_review(apiurl, request):
|
|||||||
while True:
|
while True:
|
||||||
repl = raw_input('d(i)ff/(a)ccept/(d)ecline/(r)evoke/(c)ancel > ')
|
repl = raw_input('d(i)ff/(a)ccept/(d)ecline/(r)evoke/(c)ancel > ')
|
||||||
if repl == 'i':
|
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:
|
if tmpfile is None:
|
||||||
tmpfile = tempfile.NamedTemporaryFile()
|
tmpfile = tempfile.NamedTemporaryFile()
|
||||||
tmpfile.write(server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
|
tmpfile.write(server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
|
||||||
|
Reference in New Issue
Block a user