mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-30 01:44:11 +02:00
fix usage of linkrev in show_xsrcmd5 function.
make usage of linkrev=base options in setlinkrev.
This commit is contained in:
17
osc/core.py
17
osc/core.py
@@ -4854,7 +4854,7 @@ def search(apiurl, **kwargs):
|
||||
res[urlpath] = ET.parse(f).getroot()
|
||||
return res
|
||||
|
||||
def set_link_rev(apiurl, project, package, revision = None, use_baserev = None):
|
||||
def set_link_rev(apiurl, project, package, revision = None, use_xsrcmd5 = None, use_baserev = None):
|
||||
url = makeurl(apiurl, ['source', project, package, '_link'])
|
||||
try:
|
||||
f = http_GET(url)
|
||||
@@ -4873,8 +4873,19 @@ def set_link_rev(apiurl, project, package, revision = None, use_baserev = None):
|
||||
else:
|
||||
root.attrib['rev'] = revision
|
||||
|
||||
if use_baserev:
|
||||
root.attrib['rev'] = show_upstream_xsrcmd5(apiurl, src_project, src_package, revision=root.attrib['rev'], linkrev='base' )
|
||||
if use_xsrcmd5:
|
||||
if use_baserev:
|
||||
try:
|
||||
root.attrib['rev'] = show_upstream_xsrcmd5(apiurl, src_project, src_package, revision=root.attrib['rev'], linkrev='base' )
|
||||
except oscerr.LinkExpandError, e:
|
||||
e.osc_msg = 'Unable to merge packages via links from package \'%s\' for project \'%s\'. These revisions have never worked!' % (package, project)
|
||||
raise
|
||||
else:
|
||||
try:
|
||||
root.attrib['rev'] = show_upstream_xsrcmd5(apiurl, src_project, src_package, revision=root.attrib['rev'] )
|
||||
except oscerr.LinkExpandError, e:
|
||||
e.osc_msg = 'Unable to merge packages via links from package \'%s\' for project \'%s\'. Please try again using baserev to use source revisions when created the commits.' % (package, project)
|
||||
raise
|
||||
|
||||
l = ET.tostring(root)
|
||||
# upload _link file again
|
||||
|
Reference in New Issue
Block a user