1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

add -d option to sr to only show a diff

Much more convenient than having to assemble the rdiff command line
manually.
This commit is contained in:
Ludwig Nussel 2009-07-13 09:36:19 +00:00
parent 97697b00bc
commit 8fcd6e3371

View File

@ -473,6 +473,8 @@ class Osc(cmdln.Cmdln):
@cmdln.option('--nodevelproject', action='store_true',
help='do not follow a defined devel project ' \
'(primary project where a package is developed)')
@cmdln.option('-d', '--diff', action='store_true',
help='show diff only instead of creating the actual request')
@cmdln.alias("sr")
@cmdln.alias("submitreq")
def do_submitrequest(self, subcmd, opts, *args):
@ -484,9 +486,9 @@ class Osc(cmdln.Cmdln):
See the "request" command for showing and modifing existing requests.
usage:
osc submitreq [-m TEXT]
osc submitreq [-m TEXT] DESTPRJ [DESTPKG]
osc submitreq [-m TEXT] SOURCEPRJ SOURCEPKG DESTPRJ [DESTPKG]
osc submitreq [OPTIONS]
osc submitreq [OPTIONS] DESTPRJ [DESTPKG]
osc submitreq [OPTIONS] SOURCEPRJ SOURCEPKG DESTPRJ [DESTPKG]
${cmd_option_list}
"""
@ -565,6 +567,13 @@ of the package %s primarily takes place.
Please submit there instead, or use --nodevelproject to force direct submission.""" \
% (devloc, dst_package)
sys.exit(1)
if opts.diff:
print 'old: %s/%s\nnew: %s/%s' %(dst_project, dst_package, src_project, src_package)
rdiff = server_diff(apiurl,
dst_project, dst_package, None,
src_project, src_package, None, True)
print rdiff
else:
reqs = get_request_list(apiurl, dst_project, dst_package, 'submit')
user = conf.get_apiurl_usr(apiurl)
myreqs = [ i for i in reqs if i.state.who == user ]