From b659ad52859efaf91dc07d4e19cf670dd1fd6bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 25 Nov 2011 10:12:16 +0100 Subject: [PATCH] - support new branch add_repositories api call --- NEWS | 1 + osc/commandline.py | 4 +++- osc/core.py | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index c0e2dade..2740a3a4 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ # Features which requires OBS 2.3 # - support source services using OBS project or package name + - branch --add-repositories can be used to add repos from source project to target project 0.132 - rdelete and undelete command requesting now a comment diff --git a/osc/commandline.py b/osc/commandline.py index d38b5399..c561dbda 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2710,6 +2710,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. '(\'osc bco\' is a shorthand for this option)' ) @cmdln.option('-f', '--force', default=False, action="store_true", help='force branch, overwrite target') + @cmdln.option('--add-repositories', default=False, action="store_true", + help='Add repositories to target project (happens by default when project is new)') @cmdln.option('--noaccess', action='store_true', help='Create a hidden project') @cmdln.option('-m', '--message', metavar='TEXT', @@ -2773,7 +2775,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. nodevelproject=opts.nodevelproject, rev=opts.revision, target_project=tproject, target_package=tpackage, return_existing=opts.checkout, msg=opts.message or '', - force=opts.force, noaccess=opts.noaccess) + force=opts.force, noaccess=opts.noaccess, add_repositories=opts.add_repositories) if exists: print >>sys.stderr, 'Using existing branch project: %s' % targetprj diff --git a/osc/core.py b/osc/core.py index 88a693f6..1870380a 100644 --- a/osc/core.py +++ b/osc/core.py @@ -4287,7 +4287,7 @@ def aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map = print 'Done.' -def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute, package, targetproject, return_existing=False, force=False, noaccess=False): +def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute, package, targetproject, return_existing=False, force=False, noaccess=False, add_repositories=False): """ Branch packages defined via attributes (via API call) """ @@ -4299,6 +4299,8 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute, query['force'] = "1" if noaccess: query['noaccess'] = "1" + if add_repositories: + query['add_repositories'] = "1" if package: query['package'] = package if maintained_update_project_attribute: