1
0
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:
Adrian Schröter 2010-05-17 20:14:49 +02:00
parent b397b354fe
commit c1de76cc84
2 changed files with 9 additions and 4 deletions

View File

@ -1664,10 +1664,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('-c', '--checkout', action='store_true',
help='Checkout branched package afterwards ' \
'(\'osc bco\' is a shorthand for this option)' )
@cmdln.option('-r', '--revision', metavar='rev',
help='branch against a specific revision')
@cmdln.option('-f', '--force', default=False, action="store_true",
help='force commit - do not tests a file list')
@cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT')
@cmdln.option('-r', '--revision', metavar='rev',
help='branch against a specific revision')
def do_branch(self, subcmd, opts, *args):
"""${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],
nodevelproject=opts.nodevelproject, rev=opts.revision,
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:
print >>sys.stderr, 'Using existing branch project: %s' % targetprj

View File

@ -3386,7 +3386,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):
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)
"""
@ -3394,6 +3394,8 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute,
query['attribute'] = attribute
if targetproject:
query['target_project'] = targetproject
if force:
query['force'] = "1"
if package:
query['package'] = package
if maintained_update_project_attribute: