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:
parent
7fe43cb486
commit
c859fc5430
1
NEWS
1
NEWS
@ -25,6 +25,7 @@
|
||||
- add force option to accept requests in review state.
|
||||
- add "maintenancerequest" command to request a maintenance incident from maintenance team
|
||||
- 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
|
||||
- new "revert" command to restore the original working copy file (without
|
||||
|
@ -492,6 +492,8 @@ class Osc(cmdln.Cmdln):
|
||||
help='include defined attribute defaults')
|
||||
@cmdln.option('--attribute-project', action='store_true',
|
||||
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',
|
||||
help='read metadata from FILE, instead of opening an editor. '
|
||||
'\'-\' denotes standard input. ')
|
||||
@ -645,6 +647,7 @@ class Osc(cmdln.Cmdln):
|
||||
if cmd == 'prj':
|
||||
edit_meta(metatype='prj',
|
||||
edit=True,
|
||||
force=opts.force,
|
||||
path_args=quote_plus(project),
|
||||
apiurl=apiurl,
|
||||
template_args=({
|
||||
@ -707,6 +710,7 @@ class Osc(cmdln.Cmdln):
|
||||
edit_meta(metatype='prj',
|
||||
data=f,
|
||||
edit=opts.edit,
|
||||
force=opts.force,
|
||||
apiurl=apiurl,
|
||||
path_args=quote_plus(project))
|
||||
elif cmd == 'pkg':
|
||||
|
11
osc/core.py
11
osc/core.py
@ -3214,7 +3214,7 @@ def meta_exists(metatype,
|
||||
raise e
|
||||
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
|
||||
|
||||
if not apiurl:
|
||||
@ -3226,7 +3226,11 @@ def make_meta_url(metatype, path_args=None, apiurl=None):
|
||||
if 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,
|
||||
@ -3234,6 +3238,7 @@ def edit_meta(metatype,
|
||||
data=None,
|
||||
template_args=None,
|
||||
edit=False,
|
||||
force=False,
|
||||
change_is_required=False,
|
||||
apiurl=None):
|
||||
|
||||
@ -3251,7 +3256,7 @@ def edit_meta(metatype,
|
||||
if edit:
|
||||
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'])
|
||||
|
||||
if edit:
|
||||
|
Loading…
Reference in New Issue
Block a user