Skip to content

Commit

Permalink
Improve 'submitrequest' command to inherit description from supersede…
Browse files Browse the repository at this point in the history
…d request
  • Loading branch information
dmach committed Jun 18, 2024
1 parent 84524b5 commit 083fdf3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2418,6 +2418,12 @@ def _check_service(root):
dst_project, None,
not opts.yes)
if not opts.message:
msg = ""
if opts.supersede:
from .obs_api import Request
req = Request.from_api(apiurl, opts.supersede)
msg = req.description + "\n"

difflines = []
doappend = False
changes_re = re.compile(r'^--- .*\.changes ')
Expand All @@ -2429,7 +2435,9 @@ def _check_service(root):
doappend = False
if doappend:
difflines.append(line)
opts.message = edit_message(footer=rdiff, template='\n'.join(parse_diff_for_commit_message('\n'.join(difflines))))

diff = "\n".join(parse_diff_for_commit_message("\n".join(difflines)))
opts.message = edit_message(footer=rdiff, template=f"{msg}{diff}")

result = create_submit_request(apiurl,
src_project, src_package,
Expand Down

0 comments on commit 083fdf3

Please sign in to comment.