1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-06 15:43:39 +02:00

Merge branch 'fix_#637_osc_vc_escape_chars' of https://github.com/lethliel/osc

Pass the filename to the vc script instead of passing its content via
the "-m" parameter. If "osc vc --file <fname>" is issued, it might be
possible that $EDITOR is still opened (if the "vc" script is too old),
which contradicts the --file option's help text. This "break" is acceptable
(just update osc in tandem with the vc script).
This commit is contained in:
Marcus Huewe
2019-09-27 22:35:25 +02:00

View File

@@ -8920,10 +8920,14 @@ Please submit there instead, or use --nodevelproject to force direct submission.
cmd_list.append("-m")
cmd_list.append(opts.message)
if opts.file:
if not os.path.isfile(opts.file):
if len(args) > 1:
raise oscerr.WrongOptions('--file and file_with_comment are mutually exclusive')
elif not os.path.isfile(opts.file):
raise oscerr.WrongOptions('\'%s\': is no file' % opts.file)
cmd_list.append("-m")
cmd_list.append(open(opts.file).read().strip())
args = list(args)
if not args:
cmd_list.append('')
cmd_list.append(opts.file)
if opts.just_edit:
cmd_list.append("-e")