1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

- fixed attribute names for Request() instances (changed "dst_" prefix to "tgt_")

This commit is contained in:
Marcus Huewe 2010-12-30 03:04:10 +01:00
parent b2838dd88d
commit 6cd837fcb3
2 changed files with 9 additions and 7 deletions

View File

@ -1843,7 +1843,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
# for OBS 2.0 and before
try:
rdiff = server_diff(apiurl,
r.actions[0].dst_project, r.actions[0].dst_package, None,
r.actions[0].tgt_project, r.actions[0].tgt_package, None,
r.actions[0].src_project, r.actions[0].src_package, r.actions[0].src_rev, opts.unified, True)
except urllib2.HTTPError, e:
if e.code != 400:
@ -1852,7 +1852,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
# backward compatiblity: only a recent api/backend supports the missingok parameter
try:
rdiff = server_diff(apiurl,
r.actions[0].dst_project, r.actions[0].dst_package, None,
r.actions[0].tgt_project, r.actions[0].tgt_package, None,
r.actions[0].src_project, r.actions[0].src_package, r.actions[0].src_rev, opts.unified, False)
except urllib2.HTTPError, e:
e.osc_msg = 'Diff not possible'

View File

@ -3520,10 +3520,11 @@ def change_request_state_template(req, newstate):
tmpl = conf.config.get(tmpl_name, '')
tmpl = tmpl.replace('\\t', '\t').replace('\\n', '\n')
data = {'reqid': req.reqid, 'type': action.type, 'who': req.get_creator()}
# XXX: change also mapping key to tgt_ prefix
if req.actions[0].type == 'submit':
data.update({'src_project': action.src_project,
'src_package': action.src_package, 'src_rev': action.src_rev,
'dst_project': action.dst_project, 'dst_package': action.dst_package})
'dst_project': action.tgt_project, 'dst_package': action.tgt_package})
try:
return tmpl % data
except KeyError, e:
@ -3640,12 +3641,13 @@ def get_request_log(apiurl, reqid):
r = get_request(apiurl, reqid)
data = []
frmt = '-' * 76 + '\n%s | %s | %s\n\n%s'
r.statehistory.reverse()
# the description of the request is used for the initial log entry
# otherwise its comment attribute would contain None
if len(r.statehistory) >= 1:
r.statehistory[-1].comment = r.descr
r.statehistory[-1].comment = r.description
else:
r.state.comment = r.descr
r.state.comment = r.description
for state in [ r.state ] + r.statehistory:
s = frmt % (state.name, state.who, state.when, str(state.comment))
data.append(s)
@ -5814,12 +5816,12 @@ def request_interactive_review(apiurl, request):
tmpfile = tempfile.NamedTemporaryFile()
# backward compatiblity: only a recent api/backend supports the missingok parameter
try:
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
diff = server_diff(apiurl, request.actions[0].tgt_project, request.actions[0].tgt_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:
try:
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
diff = server_diff(apiurl, request.actions[0].tgt_project, request.actions[0].tgt_package, None,
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, False)
except urllib2.HTTPError, e:
tmpfile.close()