From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marko Lemmetty Date: Fri, 15 May 2020 14:33:17 +0300 Subject: [PATCH] Support synchronous copyproj --- osc/commandline.py | 5 +++++ osc/core.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/osc/commandline.py b/osc/commandline.py index d65eb6417d8aa219c1d2a0ac1ca6a9bbad6508da..3e44189b69155f645b063d93362f652df849b826 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2114,6 +2114,8 @@ class Osc(cmdln.Cmdln): @cmdln.option('-b', '--with-binaries', action='store_true', help='copy the built binaries over to avoid a rebuild') + @cmdln.option('-n', '--now', action='store_true', + help='copy synchronously (may take some time to complete)') @cmdln.option('-H', '--with-history', action='store_true', help='replicate the history of each package.') @cmdln.option('-o', '--make-older', action='store_true', @@ -2132,6 +2134,8 @@ class Osc(cmdln.Cmdln): The user must be able to create DESTPRJ + Normally the copy is done asynchronously + usage: osc copyprj SOURCEPRJ DESTPRJ """ @@ -2160,6 +2164,7 @@ class Osc(cmdln.Cmdln): withhistory = opts.with_history, makeolder = opts.make_older, resign = opts.re_sign, + now = opts.now, comment = comment) print("done cp") print(r) diff --git a/osc/core.py b/osc/core.py index a5c7236f875b8816b375b9d5976b8a4bb8d5b6d8..a20886bfe0c3705bed233368ac06f07392f33f5a 100644 --- a/osc/core.py +++ b/osc/core.py @@ -6337,6 +6337,8 @@ def copy_prj(src_apiurl, src_project, dst_project, query['resign'] = '1' if comment: query['comment'] = comment + if now: + query['nodelay'] = '1' u = makeurl(src_apiurl, ['source', dst_project], query=query) print("copyprj ", u, file=sys.stderr) f = http_POST(u)