1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Marko Lemmetty <marko.lemmetty@jollamobile.com>
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 6efe9bf32d4278d1a56a1c6af0bf87d5e8427c1f..93dd9238198301c15772c4e5a20ca0092b6cd17a 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -1866,6 +1866,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',
@@ -1884,6 +1886,8 @@ class Osc(cmdln.Cmdln):
The user must be able to create DESTPRJ
+ Normally the copy is done asynchronously
+
usage:
osc copyprj SOURCEPRJ DESTPRJ
"""
@@ -1912,6 +1916,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 f4ea0181ed4c36f792d444d28a47d3e9753389c7..c2c87fe4a423a75e2e7f4ab3d51f494da90a8fc0 100644
--- a/osc/core.py
+++ b/osc/core.py
@@ -3838,6 +3838,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)
|