diff --git a/osc/commandline.py b/osc/commandline.py index f8fd660d..8bcbb2dd 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1620,6 +1620,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. '(\'osc bco\' is a shorthand for this option)' ) @cmdln.option('-r', '--revision', metavar='rev', help='branch against a specific revision') + @cmdln.option('-m', '--message', metavar='TEXT', + help='specify message TEXT') def do_branch(self, subcmd, opts, *args): """${cmd_name}: Branch a package @@ -1667,7 +1669,7 @@ 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) + return_existing=opts.checkout, msg=opts.message or '') if exists: print >>sys.stderr, 'Using existing branch project: %s' % targetprj diff --git a/osc/core.py b/osc/core.py index 0bab580c..1e9e01d7 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3273,7 +3273,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): +def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None, target_project=None, target_package=None, return_existing=False, msg=''): """ Branch a package (via API call) """ @@ -3286,6 +3286,8 @@ def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None, query['target_project'] = target_project if target_package: query['target_package'] = target_package + if msg: + query['comment'] = msg u = makeurl(apiurl, ['source', src_project, src_package], query=query) try: f = http_POST(u)