Skip to content

Commit

Permalink
Merge pull request #1582 from dmach/sr-supersede-message
Browse files Browse the repository at this point in the history
Improve 'submitrequest' command to inherit description from superseded request
  • Loading branch information
dmach authored Jun 25, 2024
2 parents 3ffda9e + 083fdf3 commit b972c1d
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 b972c1d

Please sign in to comment.