mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-02 17:56:15 +01:00
- support to create hidden project on "branch" and "createincident" commands
This commit is contained in:
parent
e120cd6b39
commit
704199f279
2
NEWS
2
NEWS
@ -4,6 +4,8 @@
|
|||||||
# Features which requires OBS 2.3
|
# Features which requires OBS 2.3
|
||||||
#
|
#
|
||||||
- new command "createincident" to create maintenance incidents without a request
|
- 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
|
0.131
|
||||||
- new command 'develproject' to print the devel project from the package meta.
|
- new command 'develproject' to print the devel project from the package meta.
|
||||||
|
@ -2464,6 +2464,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
@cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',
|
@cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',
|
||||||
help='Use this attribute to find default maintenance project (default is OBS:MaintenanceProject)')
|
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',
|
@cmdln.option('-m', '--message', metavar='TEXT',
|
||||||
help='specify message TEXT')
|
help='specify message TEXT')
|
||||||
def do_createincident(self, subcmd, opts, *args):
|
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
|
print 'Using target project \'%s\'' % target_project
|
||||||
|
|
||||||
query = { 'cmd': 'createmaintenanceincident' }
|
query = { 'cmd': 'createmaintenanceincident' }
|
||||||
|
if opts.noaccess:
|
||||||
|
query["noaccess"] = 1
|
||||||
url = makeurl(apiurl, ['source', target_project], query=query)
|
url = makeurl(apiurl, ['source', target_project], query=query)
|
||||||
r = http_POST(url, data=opts.message)
|
r = http_POST(url, data=opts.message)
|
||||||
print ET.parse(r).getroot().get('code')
|
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)' )
|
'(\'osc bco\' is a shorthand for this option)' )
|
||||||
@cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',
|
@cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',
|
||||||
help='Use this attribute to find affected packages (default is OBS:Maintained)')
|
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',
|
@cmdln.option('-u', '--update-project-attribute', metavar='UPDATE_ATTRIBUTE',
|
||||||
help='Use this attribute to find update projects (default is OBS:UpdateProject) ')
|
help='Use this attribute to find update projects (default is OBS:UpdateProject) ')
|
||||||
def do_mbranch(self, subcmd, opts, *args):
|
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]
|
tproject = args[1]
|
||||||
|
|
||||||
r = attribute_branch_pkg(apiurl, maintained_attribute, maintained_update_project_attribute, \
|
r = attribute_branch_pkg(apiurl, maintained_attribute, maintained_update_project_attribute, \
|
||||||
package, tproject)
|
package, tproject, noaccess = opts.noaccess)
|
||||||
|
|
||||||
if r is None:
|
if r is None:
|
||||||
print >>sys.stderr, 'ERROR: Attribute branch call came not back with a project.'
|
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)' )
|
'(\'osc bco\' is a shorthand for this option)' )
|
||||||
@cmdln.option('-f', '--force', default=False, action="store_true",
|
@cmdln.option('-f', '--force', default=False, action="store_true",
|
||||||
help='force branch, overwrite target')
|
help='force branch, overwrite target')
|
||||||
|
@cmdln.option('--noaccess', action='store_true',
|
||||||
|
help='Create a hidden project')
|
||||||
@cmdln.option('-m', '--message', metavar='TEXT',
|
@cmdln.option('-m', '--message', metavar='TEXT',
|
||||||
help='specify message TEXT')
|
help='specify message TEXT')
|
||||||
@cmdln.option('-r', '--revision', metavar='rev',
|
@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,
|
nodevelproject=opts.nodevelproject, rev=opts.revision,
|
||||||
target_project=tproject, target_package=tpackage,
|
target_project=tproject, target_package=tpackage,
|
||||||
return_existing=opts.checkout, msg=opts.message or '',
|
return_existing=opts.checkout, msg=opts.message or '',
|
||||||
force=opts.force)
|
force=opts.force, noaccess=opts.noaccess)
|
||||||
if exists:
|
if exists:
|
||||||
print >>sys.stderr, 'Using existing branch project: %s' % targetprj
|
print >>sys.stderr, 'Using existing branch project: %s' % targetprj
|
||||||
|
|
||||||
|
@ -4353,7 +4353,7 @@ def aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map =
|
|||||||
print 'Done.'
|
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)
|
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
|
query['target_project'] = targetproject
|
||||||
if force:
|
if force:
|
||||||
query['force'] = "1"
|
query['force'] = "1"
|
||||||
|
if noaccess:
|
||||||
|
query['noaccess'] = "1"
|
||||||
if package:
|
if package:
|
||||||
query['package'] = package
|
query['package'] = package
|
||||||
if maintained_update_project_attribute:
|
if maintained_update_project_attribute:
|
||||||
@ -4384,7 +4386,7 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute,
|
|||||||
return r
|
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)
|
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'
|
query['ignoredevel'] = '1'
|
||||||
if force:
|
if force:
|
||||||
query['force'] = '1'
|
query['force'] = '1'
|
||||||
|
if noaccess:
|
||||||
|
query['noaccess'] = '1'
|
||||||
if rev:
|
if rev:
|
||||||
query['rev'] = rev
|
query['rev'] = rev
|
||||||
if target_project:
|
if target_project:
|
||||||
|
Loading…
Reference in New Issue
Block a user