Skip to content

Commit

Permalink
Merge pull request #1633 from adrianschroeter/crea
Browse files Browse the repository at this point in the history
creq: Allow to specify source and target repository
  • Loading branch information
dmach authored Sep 26, 2024
2 parents 0cab457 + 575f2c2 commit 372a6f5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2633,16 +2633,21 @@ def _changedevel_request(self, args, opts):
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 = """ <action type="release"> <source project="%s" package="%s" /> <target project="%s" repository="%s" /> </action> """ % \
(project, package, target_project, target_repository)
actionxml = """ <action type="release"> <source project="%s" package="%s" %s/> <target project="%s" %s/> </action> """ % \
(project, package, source_repository, target_project, target_repository)

return actionxml

Expand Down Expand Up @@ -2779,7 +2784,7 @@ def do_createrequest(self, subcmd, opts, *args):
-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.
Expand Down

0 comments on commit 372a6f5

Please sign in to comment.