summarylogtreecommitdiffstats
path: root/0004-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch
blob: 876d7bb6af89b64a694e2c4672b53bb8527bc935 (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
54
55
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Marko Lemmetty <marko.lemmetty@jollamobile.com>
Date: Fri, 15 May 2020 14:47:19 +0300
Subject: [PATCH] Add -p to copyprj to enable copying of prjconf

---
 osc/commandline.py | 4 +++-
 osc/core.py        | 5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/osc/commandline.py b/osc/commandline.py
index 76c9131fe498c8b03e2d8f739091c1930bfb09f4..c1a64f43c06bfdee5fbef369fab6b1b3860c2af0 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -3142,6 +3142,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
                         help='replicate the history of each package.')
     @cmdln.option('-o', '--make-older', action='store_true',
                         help='No idea')
+    @cmdln.option('-p', '--prjconf', action='store_true',
+                        help='copy the prjconf also')
     @cmdln.option('-r', '--re-sign', action='store_true',
                         help='re-sign the binaries')
     @cmdln.option('-m', '--message', metavar='TEXT',
@@ -3186,7 +3188,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,
+                     now = opts.now, prjconf = opts.prjconf,
                      comment = comment)
         print("done cp")
         print(r)
diff --git a/osc/core.py b/osc/core.py
index 60137a067ead1b040c516b88c102827cdefd1414..5a04d7a76e3bd9efa73886529738c5b5f0a67638 100644
--- a/osc/core.py
+++ b/osc/core.py
@@ -5554,6 +5554,8 @@ def copy_prj(src_apiurl, src_project, dst_project,
              withhistory = False,
              makeolder = False,
              resign = False,
+             now = False,
+             prjconf = False,
              comment = None):
     """
     Create a copy of a project.
@@ -5575,6 +5577,9 @@ def copy_prj(src_apiurl, src_project, dst_project,
         query['comment'] = comment
     if now:
         query['nodelay'] = '1'
+    if prjconf:
+        query['prjconf'] = '1'
+
     u = makeurl(src_apiurl, ['source', dst_project], query=query)
     print("copyprj ", u, file=sys.stderr)
     f = http_POST(u)