From 575f2c2abd1b33aed9574b81f4ebd712102cc2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 24 Sep 2024 15:31:57 +0200 Subject: [PATCH] creq: Allow to specify source and target repository and make repository definitions optional. --- osc/commandline.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index d2c66d04..b904f167 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2633,16 +2633,21 @@ Please submit there instead, or use --nodevelproject to force direct submission. return actionxml def _release_request(self, args, opts): - if len(args) != 4: + if len(args) < 3 or len(args) > 5: raise oscerr.WrongArgs('Wrong number of arguments for release' + str(len(args))) project = self._process_project_name(args[0]) package = args[1] target_project = args[2] - target_repository = args[3] + source_repository = target_repository = "" + if len(args) == 5: + source_repository = """ repository="%s" """ % args[3] + target_repository = """ repository="%s" """ % args[4] + elif len(args) == 4: + target_repository = """ repository="%s" """ % args[3] - actionxml = """ """ % \ - (project, package, target_project, target_repository) + actionxml = """ """ % \ + (project, package, source_repository, target_project, target_repository) return actionxml @@ -2779,7 +2784,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. -a add_group GROUP ROLE PROJECT [PACKAGE] -a add_role USER ROLE PROJECT [PACKAGE] -a set_bugowner USER PROJECT [PACKAGE] - -a release PROJECT PACKAGE TARGET_PROJECT TARGET_REPOSITORY + -a release PROJECT PACKAGE TARGET_PROJECT [[SOURCE_REPOSITORY] TARGET_REPOSITORY] ] Option -m works for all types of request actions, the rest work only for submit.