1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-23 05:26:16 +01:00

add createrequest "add_me" shortcut

This commit is contained in:
Adrian Schröter 2011-01-10 13:12:09 +01:00
parent 8bad2ed16b
commit 06e285130b
2 changed files with 30 additions and 0 deletions

1
NEWS
View File

@ -2,6 +2,7 @@
- add blt and rblt commands, aka "buildlogtail" and "remotebuildlogtail" to show - add blt and rblt commands, aka "buildlogtail" and "remotebuildlogtail" to show
just the end of a build log (for getting the fail reason faster). just the end of a build log (for getting the fail reason faster).
CHANGE: the --start parameter is now called --offset CHANGE: the --start parameter is now called --offset
- add "createrequest -a add_me" shortcut
0.130 0.130
- new "revert" command to restore the original working copy file (without - new "revert" command to restore the original working copy file (without

View File

@ -1240,6 +1240,30 @@ Please submit there instead, or use --nodevelproject to force direct submission.
return actionxml return actionxml
def _add_me(self, args, opts):
if len(args) > 3:
raise oscerr.WrongArgs('Too many arguments.')
if len(args) < 2:
raise oscerr.WrongArgs('Too few arguments.')
apiurl = self.get_api_url()
user = conf.get_apiurl_usr(apiurl)
role = args[1]
project = args[2]
actionxml = """ <action type="add_role"> <target project="%s" /> <person name="%s" role="%s" /> </action> """ % \
(project, user, role)
if len(args) > 2:
package = args[2]
actionxml = """ <action type="add_role"> <target project="%s" package="%s" /> <person name="%s" role="%s" /> </action> """ % \
(project, package, user, role)
if get_user_meta(apiurl, user) == None:
raise oscerr.WrongArgs('osc: an error occured.')
return actionxml
def _add_role(self, args, opts): def _add_role(self, args, opts):
if len(args) > 4: if len(args) > 4:
raise oscerr.WrongArgs('Too many arguments.') raise oscerr.WrongArgs('Too many arguments.')
@ -1315,6 +1339,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
-a submit SOURCEPRJ SOURCEPKG DESTPRJ [DESTPKG] -a submit SOURCEPRJ SOURCEPKG DESTPRJ [DESTPKG]
-a delete PROJECT [PACKAGE] -a delete PROJECT [PACKAGE]
-a change_devel PROJECT PACKAGE DEVEL_PROJECT [DEVEL_PACKAGE] -a change_devel PROJECT PACKAGE DEVEL_PROJECT [DEVEL_PACKAGE]
-a add_me ROLE PROJECT [PACKAGE]
-a add_role USER ROLE PROJECT [PACKAGE] -a add_role USER ROLE PROJECT [PACKAGE]
-a set_bugowner USER PROJECT [PACKAGE] -a set_bugowner USER PROJECT [PACKAGE]
] ]
@ -1358,6 +1383,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
args = opts.actiondata[i] args = opts.actiondata[i]
actionsxml += self._changedevel_request(args,opts) actionsxml += self._changedevel_request(args,opts)
i = i+1 i = i+1
elif ai == 'add_me':
args = opts.actiondata[i]
actionsxml += self._add_me(args,opts)
i = i+1
elif ai == 'add_role': elif ai == 'add_role':
args = opts.actiondata[i] args = opts.actiondata[i]
actionsxml += self._add_role(args,opts) actionsxml += self._add_role(args,opts)