mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-22 21:16:16 +01:00
- add unlock command for osc 0.134.1
This commit is contained in:
parent
434879dc4b
commit
ce9f504105
1
NEWS
1
NEWS
@ -14,6 +14,7 @@
|
||||
- "osc my patchinfos" is showing patchinfos where any open bug is assigned to user
|
||||
- "osc my" or "osc my work" is including assigned patchinfos
|
||||
- "osc branch --maintenance" is creating setups for maintenance
|
||||
- "osc unlock" command to unlock packages or projects
|
||||
|
||||
0.133
|
||||
- add --meta option also to "list", "cat" and "less" commands
|
||||
|
@ -3016,6 +3016,49 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
else:
|
||||
delete_project(apiurl, prj, opts.force, msg)
|
||||
|
||||
|
||||
@cmdln.option('-m', '--message', metavar='TEXT',
|
||||
help='specify log message TEXT')
|
||||
def do_unlock(self, subcmd, opts, *args):
|
||||
"""${cmd_name}: Unlocks a project or package
|
||||
|
||||
Unlocks a locked project or package. A comment is required.
|
||||
|
||||
usage:
|
||||
osc unlock PROJECT [PACKAGE]
|
||||
|
||||
${cmd_option_list}
|
||||
"""
|
||||
|
||||
args = slash_split(args)
|
||||
if len(args) < 1 or len(args) > 2:
|
||||
raise oscerr.WrongArgs('Wrong number of arguments')
|
||||
|
||||
apiurl = self.get_api_url()
|
||||
prj = args[0]
|
||||
|
||||
msg = ''
|
||||
if opts.message:
|
||||
msg = opts.message
|
||||
else:
|
||||
msg = edit_message()
|
||||
|
||||
# empty arguments result in recursive project delete ...
|
||||
if not len(prj):
|
||||
raise oscerr.WrongArgs('Project argument is empty')
|
||||
|
||||
if len(args) > 1:
|
||||
pkg = args[1]
|
||||
|
||||
if not len(pkg):
|
||||
raise oscerr.WrongArgs('Package argument is empty')
|
||||
|
||||
unlock_package(apiurl, prj, pkg, msg)
|
||||
|
||||
else:
|
||||
unlock_project(apiurl, prj, msg)
|
||||
|
||||
|
||||
@cmdln.hide(1)
|
||||
def do_deletepac(self, subcmd, opts, *args):
|
||||
print """${cmd_name} is obsolete !
|
||||
|
11
osc/core.py
11
osc/core.py
@ -4549,6 +4549,17 @@ def copy_pac(src_apiurl, src_project, src_package,
|
||||
return 'Done.'
|
||||
|
||||
|
||||
def unlock_package(apiurl, prj, pac, msg):
|
||||
query={'cmd': 'unlock', 'comment': msg}
|
||||
u = makeurl(apiurl, ['source', prj, pac], query)
|
||||
http_POST(u)
|
||||
|
||||
def unlock_project(apiurl, prj, msg=None):
|
||||
query={'cmd': 'unlock', 'comment': msg}
|
||||
u = makeurl(apiurl, ['source', prj], query)
|
||||
http_POST(u)
|
||||
|
||||
|
||||
def undelete_package(apiurl, prj, pac, msg=None):
|
||||
query={'cmd': 'undelete'}
|
||||
if msg:
|
||||
|
Loading…
Reference in New Issue
Block a user