diff --git a/osc/commandline.py b/osc/commandline.py index e953d51181..9b73464289 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2980,8 +2980,14 @@ def do_aggregatepac(self, subcmd, opts, *args): help='URL of destination api server. Default is the source api server.') @cmdln.option('-m', '--message', metavar='TEXT', help='specify message TEXT') + @cmdln.option('-M', '--make-origin-older', action='store_true', + help='Make origin older, the source vrev is extended and target is guaranteed to be newer') @cmdln.option('-e', '--expand', action='store_true', help='if the source package is a link then copy the expanded version of the link') + @cmdln.option('-w', '--with-history', action='store_true', + help='copies sources with history on copy command') + @cmdln.option('-W', '--with-binaries', action='store_true', + help='copies also binaries on copy command') def do_copypac(self, subcmd, opts, *args): """ Copy a package @@ -3038,6 +3044,12 @@ def do_copypac(self, subcmd, opts, *args): comment += ", using expand" if opts.client_side_copy: comment += ", using client side copy" + if opts.make_origin_older: + comment += ", making the origin older" + if opts.with_history: + comment += ", including history" + if opts.with_binaries: + comment += ", including binaries" if src_project == dst_project and \ src_package == dst_package and \ @@ -3053,7 +3065,10 @@ def do_copypac(self, subcmd, opts, *args): expand=opts.expand, revision=rev, comment=comment, - keep_link=opts.keep_link) + keep_link=opts.keep_link, + make_origin_older=opts.make_origin_older, + with_history=opts.with_history, + with_binaries=opts.with_binaries) print(decode_it(r)) diff --git a/osc/core.py b/osc/core.py index 3716281e84..9357047eab 100644 --- a/osc/core.py +++ b/osc/core.py @@ -5463,7 +5463,10 @@ def copy_pac(src_apiurl, src_project, src_package, revision = None, comment = None, force_meta_update = None, - keep_link = None): + keep_link=None, + make_origin_older=False, + with_history=False, + with_binaries=False): """ Create a copy of a package. @@ -5501,6 +5504,12 @@ def copy_pac(src_apiurl, src_project, src_package, query['orev'] = revision if comment: query['comment'] = comment + if make_origin_older: + query['makeoriginolder'] = '1' + if with_history: + query['withhistory'] = '1' + if with_binaries: + query['withbinaries'] = '1' u = makeurl(dst_apiurl, ['source', dst_project, dst_package], query=query) f = http_POST(u) return f.read()