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

Merge pull request #1007 from glaubitz/submitreq

Add -F option to osc submitreq
This commit is contained in:
Daniel Mach 2022-02-28 16:28:17 +01:00 committed by GitHub
commit 345d0c8d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1177,6 +1177,8 @@ class Osc(cmdln.Cmdln):
@cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT')
@cmdln.option('-F', '--file', metavar='FILE',
help='read log message from FILE, \'-\' denotes standard input.')
@cmdln.option('-r', '--revision', metavar='REV',
help='specify a certain source revision ID (the md5 sum) for the source package')
@cmdln.option('-s', '--supersede', metavar='REQUEST_ID',
@ -1257,6 +1259,14 @@ class Osc(cmdln.Cmdln):
if opts.message:
opts.message = str(opts.message.encode().decode('unicode_escape'))
elif opts.file:
if opts.file == '-':
opts.message = sys.stdin.read()
else:
try:
opts.message = open(opts.file).read()
except:
sys.exit('could not open file \'%s\'.' % opts.file)
myreqs = []
if opts.supersede: