mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 15:06:15 +01:00
- core.request_interactive_review(): backward compatibility fix
This commit is contained in:
parent
4db40e23f5
commit
d0659fb0f4
@ -1246,7 +1246,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code != 400:
|
if e.code != 400:
|
||||||
e.osc_msg = 'Diff not possible'
|
e.osc_msg = 'Diff not possible'
|
||||||
raise
|
raise e
|
||||||
# backward compatiblity: only a recent api/backend supports the missingok parameter
|
# backward compatiblity: only a recent api/backend supports the missingok parameter
|
||||||
try:
|
try:
|
||||||
print server_diff(conf.config['apiurl'],
|
print server_diff(conf.config['apiurl'],
|
||||||
|
12
osc/core.py
12
osc/core.py
@ -4726,8 +4726,16 @@ def request_interactive_review(apiurl, request):
|
|||||||
if repl == 'i' and request.actions[0].type == 'submit':
|
if repl == 'i' and request.actions[0].type == 'submit':
|
||||||
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,
|
# backward compatiblity: only a recent api/backend supports the missingok parameter
|
||||||
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, True))
|
try:
|
||||||
|
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
|
||||||
|
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, True)
|
||||||
|
except urllib2.HTTPError, e:
|
||||||
|
if e.code != 400:
|
||||||
|
raise e
|
||||||
|
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
|
||||||
|
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, False)
|
||||||
|
tmpfile.write(diff)
|
||||||
tmpfile.flush()
|
tmpfile.flush()
|
||||||
pager = os.getenv('EDITOR', default='less')
|
pager = os.getenv('EDITOR', default='less')
|
||||||
subprocess.call('%s %s' % (pager, tmpfile.name), shell=True)
|
subprocess.call('%s %s' % (pager, tmpfile.name), shell=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user