1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

- do_branch: added --revision option

This commit is contained in:
Marcus Hüwe 2009-02-10 15:49:34 +00:00
parent 7589a20da7
commit 2e4570ebab
2 changed files with 7 additions and 2 deletions

View File

@ -830,6 +830,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('--nodevelproject', action='store_true',
help='do not follow a defined devel project ' \
'(primary project where a package is developed)')
@cmdln.option('-r', '--revision', metavar='rev',
help='branch against a specific revision')
def do_branch(self, subcmd, opts, *args):
"""${cmd_name}: Branch a package
@ -851,7 +853,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if len(args) != 2:
raise oscerr.WrongArgs('Wrong number of arguments.')
r = branch_pkg(conf.config['apiurl'], args[0], args[1], nodevelproject=opts.nodevelproject)
r = branch_pkg(conf.config['apiurl'], args[0], args[1],
nodevelproject=opts.nodevelproject, rev=opts.revision)
expected = 'home:%s:branches:%s' % (conf.config['user'], args[0])
if r != expected:

View File

@ -2470,13 +2470,15 @@ def aggregate_pac(src_project, src_package, dst_project, dst_package):
http_PUT(u, data=aggregate_template)
print 'Done.'
def branch_pkg(apiurl, src_project, src_package, nodevelproject=False):
def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None):
"""
Branch a package (via API call)
"""
query = { 'cmd': 'branch' }
if nodevelproject:
query['nodevelproject'] = '1'
if rev:
query['rev'] = rev
u = makeurl(conf.config['apiurl'],
['source', src_project, src_package],
query=query)