summarylogtreecommitdiffstats
path: root/0003-Support-synchronous-copyproj.patch
blob: 4fa6e2460dcaaaa80f69c843c48f91ee9d473334 (plain)
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 7dd55009165be14b4ae5f361de0ba9e56e313e6b..5060757028f1144bcafda4c60507af4af090be8f 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -3205,6 +3205,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
 
     @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',
@@ -3222,6 +3224,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
 
         The user must be able to create DESTPRJ
 
+        Normally the copy is done asynchronously
+
         usage:
             osc copyprj SOURCEPRJ DESTPRJ
         ${cmd_option_list}
@@ -3252,6 +3256,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
                      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 f929c0510aa54992e867655c412f8b51b62a4993..0625e7517b965ca2e52f19f1a78df78012f5f2e5 100644
--- a/osc/core.py
+++ b/osc/core.py
@@ -5691,6 +5691,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 >>sys.stderr, "copyprj ", u
     f = http_POST(u)