mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 02:26:16 +01:00
* bump version to 0.119.90 to show that this is a pre version
* support setlinkrev for entire projects (request from Moblin team) * support setlinkrev -u for removing rev elements
This commit is contained in:
parent
5275bdac01
commit
626aa36925
4
NEWS
4
NEWS
@ -1,3 +1,7 @@
|
||||
0.120:
|
||||
- support "setlinkrev" for whole projects
|
||||
- support "setlinkrev -u" for removing revision references
|
||||
|
||||
0.119:
|
||||
- Support new request types
|
||||
- "submitreq" command has a new syntax (incompatible !)
|
||||
|
@ -836,6 +836,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
|
||||
@cmdln.option('-r', '--revision', metavar='rev',
|
||||
help='use the specified revision.')
|
||||
@cmdln.option('-u', '--unset', action='store_true',
|
||||
help='remove revision in link, it will point always to latest revision')
|
||||
def do_setlinkrev(self, subcmd, opts, *args):
|
||||
"""${cmd_name}: Updates a revision number in a source link.
|
||||
|
||||
@ -844,12 +846,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
|
||||
usage:
|
||||
osc setlinkrev
|
||||
osc setlinkrev PROJECT PACKAGE
|
||||
osc setlinkrev PROJECT [PACKAGE]
|
||||
${cmd_option_list}
|
||||
"""
|
||||
|
||||
args = slash_split(args)
|
||||
apiurl = conf.config['apiurl']
|
||||
package = None
|
||||
if not args or len(args) == 0:
|
||||
p = findpacs(os.curdir)[0]
|
||||
project = p.prjname
|
||||
@ -860,18 +863,30 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
elif len(args) == 2:
|
||||
project = args[0]
|
||||
package = args[1]
|
||||
elif len(args) == 1:
|
||||
project = args[0]
|
||||
else:
|
||||
raise oscerr.WrongArgs('Incorrect number of arguments.\n\n' \
|
||||
+ self.get_cmd_help('setlinkrev'))
|
||||
|
||||
rev, dummy = parseRevisionOption(opts.revision)
|
||||
set_link_rev(apiurl, project, package, rev)
|
||||
if package:
|
||||
packages = [ package ]
|
||||
else:
|
||||
packages = meta_get_packagelist(apiurl, project)
|
||||
|
||||
for p in packages:
|
||||
print "setting revision for package", p
|
||||
if opts.unset:
|
||||
rev=-1
|
||||
else:
|
||||
rev, dummy = parseRevisionOption(opts.revision)
|
||||
set_link_rev(apiurl, project, p, rev)
|
||||
|
||||
|
||||
@cmdln.option('-c', '--current', action='store_true',
|
||||
help='link fixed against current revision.')
|
||||
@cmdln.option('-C', '--cicount', choices=['add', 'copy', 'local'],
|
||||
help='cicount attribute in the link, known values are add, copy, and local, default in buildservice is currently add.')
|
||||
@cmdln.option('-c', '--current', action='store_true',
|
||||
help='link fixed against current revision.')
|
||||
@cmdln.option('-r', '--revision', metavar='rev',
|
||||
help='link the specified revision.')
|
||||
@cmdln.option('-f', '--force', action='store_true',
|
||||
|
11
osc/core.py
11
osc/core.py
@ -5,7 +5,7 @@
|
||||
# and distributed under the terms of the GNU General Public Licence,
|
||||
# either version 2, or (at your option) any later version.
|
||||
|
||||
__version__ = '0.119'
|
||||
__version__ = '0.119.90'
|
||||
# __store_version__ is to be incremented when the format of the working copy
|
||||
# "store" changes in an incompatible way. Please add any needed migration
|
||||
# functionality to check_store_version().
|
||||
@ -3475,13 +3475,16 @@ def set_link_rev(apiurl, project, package, revision = None):
|
||||
e.osc_msg = 'Unable to get _link file in package \'%s\' for project \'%s\'' % (package, project)
|
||||
raise
|
||||
|
||||
# set revision element
|
||||
if not revision:
|
||||
src_project = root.attrib['project']
|
||||
src_package = root.attrib['package']
|
||||
revision = show_upstream_rev(apiurl, src_project, src_package);
|
||||
root.attrib['rev'] = show_upstream_rev(apiurl, src_project, src_package);
|
||||
elif revision == -1:
|
||||
del root.attrib['rev']
|
||||
else:
|
||||
root.attrib['rev'] = revision
|
||||
|
||||
# set revision element
|
||||
root.attrib['rev'] = revision
|
||||
l = ET.tostring(root)
|
||||
# upload _link file again
|
||||
http_PUT(url, data=l)
|
||||
|
Loading…
Reference in New Issue
Block a user