mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-09 12:35:48 +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:
|
0.119:
|
||||||
- Support new request types
|
- Support new request types
|
||||||
- "submitreq" command has a new syntax (incompatible !)
|
- "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',
|
@cmdln.option('-r', '--revision', metavar='rev',
|
||||||
help='use the specified revision.')
|
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):
|
def do_setlinkrev(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Updates a revision number in a source link.
|
"""${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:
|
usage:
|
||||||
osc setlinkrev
|
osc setlinkrev
|
||||||
osc setlinkrev PROJECT PACKAGE
|
osc setlinkrev PROJECT [PACKAGE]
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
apiurl = conf.config['apiurl']
|
apiurl = conf.config['apiurl']
|
||||||
|
package = None
|
||||||
if not args or len(args) == 0:
|
if not args or len(args) == 0:
|
||||||
p = findpacs(os.curdir)[0]
|
p = findpacs(os.curdir)[0]
|
||||||
project = p.prjname
|
project = p.prjname
|
||||||
@ -860,18 +863,30 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
elif len(args) == 2:
|
elif len(args) == 2:
|
||||||
project = args[0]
|
project = args[0]
|
||||||
package = args[1]
|
package = args[1]
|
||||||
|
elif len(args) == 1:
|
||||||
|
project = args[0]
|
||||||
else:
|
else:
|
||||||
raise oscerr.WrongArgs('Incorrect number of arguments.\n\n' \
|
raise oscerr.WrongArgs('Incorrect number of arguments.\n\n' \
|
||||||
+ self.get_cmd_help('setlinkrev'))
|
+ self.get_cmd_help('setlinkrev'))
|
||||||
|
|
||||||
rev, dummy = parseRevisionOption(opts.revision)
|
if package:
|
||||||
set_link_rev(apiurl, project, package, rev)
|
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'],
|
@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.')
|
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',
|
@cmdln.option('-r', '--revision', metavar='rev',
|
||||||
help='link the specified revision.')
|
help='link the specified revision.')
|
||||||
@cmdln.option('-f', '--force', action='store_true',
|
@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,
|
# and distributed under the terms of the GNU General Public Licence,
|
||||||
# either version 2, or (at your option) any later version.
|
# 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_version__ is to be incremented when the format of the working copy
|
||||||
# "store" changes in an incompatible way. Please add any needed migration
|
# "store" changes in an incompatible way. Please add any needed migration
|
||||||
# functionality to check_store_version().
|
# 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)
|
e.osc_msg = 'Unable to get _link file in package \'%s\' for project \'%s\'' % (package, project)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
# set revision element
|
||||||
if not revision:
|
if not revision:
|
||||||
src_project = root.attrib['project']
|
src_project = root.attrib['project']
|
||||||
src_package = root.attrib['package']
|
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)
|
l = ET.tostring(root)
|
||||||
# upload _link file again
|
# upload _link file again
|
||||||
http_PUT(url, data=l)
|
http_PUT(url, data=l)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user