mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-22 21:16:16 +01:00
- set_link_rev: minor cleanup; baserev always implies expand=True
also renamed "xsrcmd5" keyword argument to "expand"
This commit is contained in:
parent
e247cf358c
commit
02726a6a07
@ -2050,10 +2050,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
args = slash_split(args)
|
||||
apiurl = self.get_api_url()
|
||||
package = None
|
||||
xsrcmd5 = True
|
||||
expand = True
|
||||
baserev = False
|
||||
if opts.use_plain_revision:
|
||||
xsrcmd5 = False
|
||||
expand = False
|
||||
if opts.use_baserev:
|
||||
baserev = True
|
||||
|
||||
@ -2084,7 +2084,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
|
||||
for p in packages:
|
||||
print 'setting revision for package %s' % p
|
||||
set_link_rev(apiurl, project, p, revision=rev, xsrcmd5=xsrcmd5, baserev=baserev)
|
||||
set_link_rev(apiurl, project, p, revision=rev, expand=expand, baserev=baserev)
|
||||
|
||||
|
||||
def do_linktobranch(self, subcmd, opts, *args):
|
||||
|
14
osc/core.py
14
osc/core.py
@ -5453,7 +5453,7 @@ def search(apiurl, **kwargs):
|
||||
res[urlpath] = ET.parse(f).getroot()
|
||||
return res
|
||||
|
||||
def set_link_rev(apiurl, project, package, revision='', xsrcmd5=False, baserev=False):
|
||||
def set_link_rev(apiurl, project, package, revision='', expand=False, baserev=False):
|
||||
"""
|
||||
updates the rev attribute of the _link xml. If revision is set to None
|
||||
the rev attribute is removed from the _link xml. If revision is set to ''
|
||||
@ -5469,22 +5469,16 @@ def set_link_rev(apiurl, project, package, revision='', xsrcmd5=False, baserev=F
|
||||
|
||||
# set revision element
|
||||
src_project = root.get('project', project)
|
||||
src_package = root.get('package')
|
||||
if src_project == None:
|
||||
src_project = project
|
||||
if src_package == None:
|
||||
src_package = package
|
||||
src_package = root.get('package', package)
|
||||
linkrev=None
|
||||
if baserev:
|
||||
linkrev = 'base'
|
||||
expand = True
|
||||
if revision is None:
|
||||
if 'rev' in root.keys():
|
||||
del root.attrib['rev']
|
||||
elif xsrcmd5:
|
||||
# don't use xsrcmd5 sum, because packages with links on remote instance do not have a linkinfo
|
||||
revision = show_upstream_rev(apiurl, src_project, src_package, expand=True, linkrev=linkrev)
|
||||
elif revision == '':
|
||||
revision = show_upstream_rev(apiurl, src_project, src_package, linkrev=linkrev)
|
||||
revision = show_upstream_rev(apiurl, src_project, src_package, linkrev=linkrev, expand=expand)
|
||||
|
||||
if revision:
|
||||
root.set('rev', revision)
|
||||
|
Loading…
Reference in New Issue
Block a user