mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
allow --force branch, even when target already exists
This commit is contained in:
parent
b397b354fe
commit
c1de76cc84
@ -1664,10 +1664,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
@cmdln.option('-c', '--checkout', action='store_true',
|
@cmdln.option('-c', '--checkout', action='store_true',
|
||||||
help='Checkout branched package afterwards ' \
|
help='Checkout branched package afterwards ' \
|
||||||
'(\'osc bco\' is a shorthand for this option)' )
|
'(\'osc bco\' is a shorthand for this option)' )
|
||||||
@cmdln.option('-r', '--revision', metavar='rev',
|
@cmdln.option('-f', '--force', default=False, action="store_true",
|
||||||
help='branch against a specific revision')
|
help='force commit - do not tests a file list')
|
||||||
@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',
|
||||||
|
help='branch against a specific revision')
|
||||||
def do_branch(self, subcmd, opts, *args):
|
def do_branch(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Branch a package
|
"""${cmd_name}: Branch a package
|
||||||
|
|
||||||
@ -1725,7 +1727,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
branch_pkg(conf.config['apiurl'], args[0], args[1],
|
branch_pkg(conf.config['apiurl'], args[0], args[1],
|
||||||
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)
|
||||||
if exists:
|
if exists:
|
||||||
print >>sys.stderr, 'Using existing branch project: %s' % targetprj
|
print >>sys.stderr, 'Using existing branch project: %s' % targetprj
|
||||||
|
|
||||||
|
@ -3386,7 +3386,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):
|
def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute, package, targetproject, return_existing=False, force=False):
|
||||||
"""
|
"""
|
||||||
Branch packages defined via attributes (via API call)
|
Branch packages defined via attributes (via API call)
|
||||||
"""
|
"""
|
||||||
@ -3394,6 +3394,8 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute,
|
|||||||
query['attribute'] = attribute
|
query['attribute'] = attribute
|
||||||
if targetproject:
|
if targetproject:
|
||||||
query['target_project'] = targetproject
|
query['target_project'] = targetproject
|
||||||
|
if force:
|
||||||
|
query['force'] = "1"
|
||||||
if package:
|
if package:
|
||||||
query['package'] = package
|
query['package'] = package
|
||||||
if maintained_update_project_attribute:
|
if maintained_update_project_attribute:
|
||||||
|
Loading…
Reference in New Issue
Block a user