1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-22 21:16:16 +01:00

- support to create hidden project on "branch" and "createincident" commands

This commit is contained in:
Adrian Schröter 2011-05-04 12:11:24 +02:00
parent e120cd6b39
commit 704199f279
3 changed files with 18 additions and 4 deletions

2
NEWS
View File

@ -4,6 +4,8 @@
# Features which requires OBS 2.3
#
- new command "createincident" to create maintenance incidents without a request
- support to create hidden project on "branch" and "createincident" commands
- osc waits and updates package after checkin when a source service is used
0.131
- new command 'develproject' to print the devel project from the package meta.

View File

@ -2464,6 +2464,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',
help='Use this attribute to find default maintenance project (default is OBS:MaintenanceProject)')
@cmdln.option('--noaccess', action='store_true',
help='Create a hidden project')
@cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT')
def do_createincident(self, subcmd, opts, *args):
@ -2506,6 +2508,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print 'Using target project \'%s\'' % target_project
query = { 'cmd': 'createmaintenanceincident' }
if opts.noaccess:
query["noaccess"] = 1
url = makeurl(apiurl, ['source', target_project], query=query)
r = http_POST(url, data=opts.message)
print ET.parse(r).getroot().get('code')
@ -2572,6 +2576,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
'(\'osc bco\' is a shorthand for this option)' )
@cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',
help='Use this attribute to find affected packages (default is OBS:Maintained)')
@cmdln.option('--noaccess', action='store_true',
help='Create a hidden project')
@cmdln.option('-u', '--update-project-attribute', metavar='UPDATE_ATTRIBUTE',
help='Use this attribute to find update projects (default is OBS:UpdateProject) ')
def do_mbranch(self, subcmd, opts, *args):
@ -2606,7 +2612,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
tproject = args[1]
r = attribute_branch_pkg(apiurl, maintained_attribute, maintained_update_project_attribute, \
package, tproject)
package, tproject, noaccess = opts.noaccess)
if r is None:
print >>sys.stderr, 'ERROR: Attribute branch call came not back with a project.'
@ -2640,6 +2646,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('--noaccess', action='store_true',
help='Create a hidden project')
@cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT')
@cmdln.option('-r', '--revision', metavar='rev',
@ -2701,7 +2709,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)
force=opts.force, noaccess=opts.noaccess)
if exists:
print >>sys.stderr, 'Using existing branch project: %s' % targetprj

View File

@ -4353,7 +4353,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):
def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute, package, targetproject, return_existing=False, force=False, noaccess=False):
"""
Branch packages defined via attributes (via API call)
"""
@ -4363,6 +4363,8 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute,
query['target_project'] = targetproject
if force:
query['force'] = "1"
if noaccess:
query['noaccess'] = "1"
if package:
query['package'] = package
if maintained_update_project_attribute:
@ -4384,7 +4386,7 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute,
return r
def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None, target_project=None, target_package=None, return_existing=False, msg='', force=False):
def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None, target_project=None, target_package=None, return_existing=False, msg='', force=False, noaccess=False):
"""
Branch a package (via API call)
"""
@ -4393,6 +4395,8 @@ def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None,
query['ignoredevel'] = '1'
if force:
query['force'] = '1'
if noaccess:
query['noaccess'] = '1'
if rev:
query['rev'] = rev
if target_project: