mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-22 21:16:16 +01:00
- use merged srcmd5sum as default revision on submit request creation, if link target is not submit target.
This allows to create multiple submit requests from same source, if one of them is to the link target. Otherwise merge conflicts will occur
This commit is contained in:
parent
24cf2a607b
commit
3408f57078
@ -1035,13 +1035,29 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if not opts.diff:
|
||||
sys.exit(1)
|
||||
|
||||
rev=opts.revision
|
||||
if not rev:
|
||||
# get _link info from server, that knows about the local state ...
|
||||
u = makeurl(apiurl, ['source', src_project, src_package])
|
||||
f = http_GET(u)
|
||||
root = ET.parse(f).getroot()
|
||||
linkinfo = root.find('linkinfo')
|
||||
if linkinfo != None:
|
||||
if linkinfo.get('error'):
|
||||
print "Package source is a broken source link."
|
||||
sys.exit("Please fix this first")
|
||||
if linkinfo.get('project') != dst_project or linkinfo.get('package') != dst_package:
|
||||
# the submit target is not link target. use merged md5sum references to avoid not mergable
|
||||
# sources when multiple request from same source get created.
|
||||
rev=linkinfo.get('xsrcmd5')
|
||||
|
||||
rdiff = None
|
||||
if opts.diff or not opts.message:
|
||||
try:
|
||||
rdiff = 'old: %s/%s\nnew: %s/%s' %(dst_project, dst_package, src_project, src_package)
|
||||
rdiff = 'old: %s/%s\nnew: %s/%s rev %s' %(dst_project, dst_package, src_project, src_package, rev)
|
||||
rdiff += server_diff(apiurl,
|
||||
dst_project, dst_package, opts.revision,
|
||||
src_project, src_package, None, True)
|
||||
dst_project, dst_package, None,
|
||||
src_project, src_package, rev, True)
|
||||
except:
|
||||
rdiff = ''
|
||||
|
||||
@ -1080,7 +1096,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
result = create_submit_request(apiurl,
|
||||
src_project, src_package,
|
||||
dst_project, dst_package,
|
||||
opts.message, orev=opts.revision, src_update=src_update)
|
||||
opts.message, orev=rev, src_update=src_update)
|
||||
if repl.lower() == 'y':
|
||||
for req in myreqs:
|
||||
change_request_state(apiurl, req.reqid, 'superseded',
|
||||
@ -2139,7 +2155,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
packages = meta_get_packagelist(apiurl, project)
|
||||
|
||||
for p in packages:
|
||||
print 'setting revision for package %s' % p
|
||||
print 'setting revision to %s for package %s' % (rev, p)
|
||||
set_link_rev(apiurl, project, p, revision=rev, expand=expand, baserev=baserev)
|
||||
|
||||
|
||||
@ -2434,6 +2450,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
|
||||
usage:
|
||||
osc releaserequest [ SOURCEPROJECT ]
|
||||
|
||||
${cmd_option_list}
|
||||
"""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user