mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 22:56:15 +01: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:
parent
55fd77650d
commit
be2c33d86f
20
behave/features/undelete.feature
Normal file
20
behave/features/undelete.feature
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
Feature: `osc undelete` command
|
||||||
|
|
||||||
|
|
||||||
|
# common steps for all scenarios
|
||||||
|
Background:
|
||||||
|
Given I set working directory to "{context.osc.temp}"
|
||||||
|
|
||||||
|
|
||||||
|
@destructive
|
||||||
|
Scenario: Run `osc undelete <project>/<package>`
|
||||||
|
Given I execute osc with args "rdelete test:factory/test-pkgA -m 'why:delete'"
|
||||||
|
When I execute osc with args "undelete test:factory/test-pkgA -m 'why:undelete'"
|
||||||
|
Then the exit code is 0
|
||||||
|
|
||||||
|
|
||||||
|
@destructive
|
||||||
|
Scenario: Run `osc undelete <project>`
|
||||||
|
Given I execute osc with args "rdelete test:factory --recursive -m 'why:delete'"
|
||||||
|
When I execute osc with args "undelete test:factory -m 'why:undelete'"
|
||||||
|
Then the exit code is 0
|
@ -3775,28 +3775,22 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
usage:
|
usage:
|
||||||
osc undelete PROJECT
|
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()
|
apiurl = self.get_api_url()
|
||||||
prj = self._process_project_name(args[0])
|
|
||||||
pkgs = args[1:]
|
|
||||||
|
|
||||||
if pkgs:
|
args = list(args)
|
||||||
for pkg in pkgs:
|
project, package = pop_project_package_from_args(
|
||||||
undelete_package(apiurl, prj, pkg, msg)
|
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:
|
else:
|
||||||
undelete_project(apiurl, prj, msg)
|
undelete_project(apiurl, project, msg)
|
||||||
|
|
||||||
@cmdln.option('-r', '--recursive', action='store_true',
|
@cmdln.option('-r', '--recursive', action='store_true',
|
||||||
help='deletes a project with packages inside')
|
help='deletes a project with packages inside')
|
||||||
|
Loading…
Reference in New Issue
Block a user