make use of RequestFinder in move too. This allows
osc staging move A C KDE:Qt to move all requests in A that match KDE:Qt to C
This commit is contained in:
parent
248a013254
commit
7347ec5baf
@ -266,8 +266,8 @@ def do_staging(self, subcmd, opts, *args):
|
|||||||
elif cmd in ['move']:
|
elif cmd in ['move']:
|
||||||
sprj = api.prj_from_letter(args[1])
|
sprj = api.prj_from_letter(args[1])
|
||||||
tprj = api.prj_from_letter(args[2])
|
tprj = api.prj_from_letter(args[2])
|
||||||
for i in range(3, len(args)):
|
for rq in RequestFinder.find_sr(args[3:], opts.apiurl):
|
||||||
api.move_between_project(sprj, args[i], tprj)
|
api.move_between_project(sprj, rq, tprj)
|
||||||
elif cmd in ['cleanup_rings']:
|
elif cmd in ['cleanup_rings']:
|
||||||
import osclib.cleanup_rings
|
import osclib.cleanup_rings
|
||||||
osclib.cleanup_rings.CleanupRings(opts.apiurl).perform()
|
osclib.cleanup_rings.CleanupRings(opts.apiurl).perform()
|
||||||
|
@ -76,22 +76,16 @@ class StagingAPI(object):
|
|||||||
return package_info
|
return package_info
|
||||||
|
|
||||||
|
|
||||||
def move_between_project(self, source_project, package, destination_project):
|
def move_between_project(self, source_project, req_id, destination_project):
|
||||||
"""
|
"""
|
||||||
Move selected package from one staging to another
|
Move selected package from one staging to another
|
||||||
:param source_project: Source project
|
:param source_project: Source project
|
||||||
:param package: Source package
|
:param request: request to move
|
||||||
:param destination_project: Destination project
|
:param destination_project: Destination project
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Get the relevant information about source
|
# Get the relevant information about source
|
||||||
meta = self.get_prj_pseudometa(source_project)
|
meta = self.get_prj_pseudometa(source_project)
|
||||||
req_id = -1
|
|
||||||
for req in meta['requests']:
|
|
||||||
if req['package'] == package:
|
|
||||||
req_id = req['id']
|
|
||||||
if req_id == -1:
|
|
||||||
raise oscerr.WrongArgs("Couldn't find request for package {0} in project {1}".format(package,source_project))
|
|
||||||
|
|
||||||
# Copy the package
|
# Copy the package
|
||||||
self.rq_to_prj(req_id, destination_project)
|
self.rq_to_prj(req_id, destination_project)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user