1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-08 05:58:43 +02:00

undelete: Migrate to pop_project_package_from_args()

INCOMPATIBLE CHANGE:
It is no longer possible to specify multiple packages at once,
because it was inconsistent with the rest of osc.
Call osc in a cycle to undelete multiple packages instead.
This commit is contained in:
2023-01-02 15:49:58 +01:00
parent 55fd77650d
commit be2c33d86f
2 changed files with 32 additions and 18 deletions

View File

@@ -3775,28 +3775,22 @@ Please submit there instead, or use --nodevelproject to force direct submission.
usage:
osc undelete PROJECT
osc undelete PROJECT PACKAGE [PACKAGE ...]
osc undelete PROJECT PACKAGE
"""
args = slash_split(args)
if len(args) < 1:
raise oscerr.WrongArgs('Missing argument.')
msg = ''
if opts.message:
msg = opts.message
else:
msg = edit_message()
apiurl = self.get_api_url()
prj = self._process_project_name(args[0])
pkgs = args[1:]
if pkgs:
for pkg in pkgs:
undelete_package(apiurl, prj, pkg, msg)
args = list(args)
project, package = pop_project_package_from_args(
args, package_is_optional=True
)
ensure_no_remaining_args(args)
msg = opts.message or edit_message()
if package:
undelete_package(apiurl, project, package, msg)
else:
undelete_project(apiurl, prj, msg)
undelete_project(apiurl, project, msg)
@cmdln.option('-r', '--recursive', action='store_true',
help='deletes a project with packages inside')