1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-22 21:16:16 +01:00

- allow to force the storage of project meta data (to ignore depending repositories for example)

This commit is contained in:
Adrian Schröter 2011-03-16 10:20:38 +01:00
parent 7fe43cb486
commit c859fc5430
3 changed files with 13 additions and 3 deletions

1
NEWS
View File

@ -25,6 +25,7 @@
- add force option to accept requests in review state. - add force option to accept requests in review state.
- add "maintenancerequest" command to request a maintenance incident from maintenance team - add "maintenancerequest" command to request a maintenance incident from maintenance team
- add "releaserequest" command run a maintenance update release process (for maintenance team only) - add "releaserequest" command run a maintenance update release process (for maintenance team only)
- allow to force the storage of project meta data (to ignore depending repositories for example)
0.130 0.130
- new "revert" command to restore the original working copy file (without - new "revert" command to restore the original working copy file (without

View File

@ -492,6 +492,8 @@ class Osc(cmdln.Cmdln):
help='include defined attribute defaults') help='include defined attribute defaults')
@cmdln.option('--attribute-project', action='store_true', @cmdln.option('--attribute-project', action='store_true',
help='include project values, if missing in packages ') help='include project values, if missing in packages ')
@cmdln.option('-f', '--force', action='store_true',
help='force the save operation, allows to ignores some errors like depending repositories. For prj meta only.')
@cmdln.option('-F', '--file', metavar='FILE', @cmdln.option('-F', '--file', metavar='FILE',
help='read metadata from FILE, instead of opening an editor. ' help='read metadata from FILE, instead of opening an editor. '
'\'-\' denotes standard input. ') '\'-\' denotes standard input. ')
@ -645,6 +647,7 @@ class Osc(cmdln.Cmdln):
if cmd == 'prj': if cmd == 'prj':
edit_meta(metatype='prj', edit_meta(metatype='prj',
edit=True, edit=True,
force=opts.force,
path_args=quote_plus(project), path_args=quote_plus(project),
apiurl=apiurl, apiurl=apiurl,
template_args=({ template_args=({
@ -707,6 +710,7 @@ class Osc(cmdln.Cmdln):
edit_meta(metatype='prj', edit_meta(metatype='prj',
data=f, data=f,
edit=opts.edit, edit=opts.edit,
force=opts.force,
apiurl=apiurl, apiurl=apiurl,
path_args=quote_plus(project)) path_args=quote_plus(project))
elif cmd == 'pkg': elif cmd == 'pkg':

View File

@ -3214,7 +3214,7 @@ def meta_exists(metatype,
raise e raise e
return data return data
def make_meta_url(metatype, path_args=None, apiurl=None): def make_meta_url(metatype, path_args=None, apiurl=None, force=False):
global metatypes global metatypes
if not apiurl: if not apiurl:
@ -3226,7 +3226,11 @@ def make_meta_url(metatype, path_args=None, apiurl=None):
if path_args: if path_args:
path = path % path_args path = path % path_args
return makeurl(apiurl, [path]) query = {}
if force:
query = { 'force': '1' }
return makeurl(apiurl, [path], query)
def edit_meta(metatype, def edit_meta(metatype,
@ -3234,6 +3238,7 @@ def edit_meta(metatype,
data=None, data=None,
template_args=None, template_args=None,
edit=False, edit=False,
force=False,
change_is_required=False, change_is_required=False,
apiurl=None): apiurl=None):
@ -3251,7 +3256,7 @@ def edit_meta(metatype,
if edit: if edit:
change_is_required = True change_is_required = True
url = make_meta_url(metatype, path_args, apiurl) url = make_meta_url(metatype, path_args, apiurl, force)
f=metafile(url, data, change_is_required, metatypes[metatype]['file_ext']) f=metafile(url, data, change_is_required, metatypes[metatype]['file_ext'])
if edit: if edit: