mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- request_interactive_review: use request_diff
(old diff method is kept for backward compatibility)
This commit is contained in:
parent
f707e9a22e
commit
7927b83c1c
19
osc/core.py
19
osc/core.py
@ -6067,13 +6067,20 @@ def request_interactive_review(apiurl, request, initial_cmd=''):
|
|||||||
tmpfile = None
|
tmpfile = None
|
||||||
if tmpfile is None:
|
if tmpfile is None:
|
||||||
tmpfile = tempfile.NamedTemporaryFile(suffix='.diff')
|
tmpfile = tempfile.NamedTemporaryFile(suffix='.diff')
|
||||||
for action in sr_actions:
|
try:
|
||||||
diff = 'old: %s/%s\nnew: %s/%s\n' % (action.src_project, action.src_package,
|
diff = request_diff(apiurl, request.reqid)
|
||||||
action.tgt_project, action.tgt_package)
|
|
||||||
diff += submit_action_diff(apiurl, action)
|
|
||||||
diff += '\n\n'
|
|
||||||
tmpfile.write(diff)
|
tmpfile.write(diff)
|
||||||
tmpfile.flush()
|
except urllib2.HTTPError as e:
|
||||||
|
if e.code != 400:
|
||||||
|
raise
|
||||||
|
# backward compatible diff for old apis
|
||||||
|
for action in sr_actions:
|
||||||
|
diff = 'old: %s/%s\nnew: %s/%s\n' % (action.src_project, action.src_package,
|
||||||
|
action.tgt_project, action.tgt_package)
|
||||||
|
diff += submit_action_diff(apiurl, action)
|
||||||
|
diff += '\n\n'
|
||||||
|
tmpfile.write(diff)
|
||||||
|
tmpfile.flush()
|
||||||
run_editor(tmpfile.name)
|
run_editor(tmpfile.name)
|
||||||
print_request(request)
|
print_request(request)
|
||||||
elif repl == 's':
|
elif repl == 's':
|
||||||
|
Loading…
Reference in New Issue
Block a user