Skip to content

Commit 17d1113

Browse files
committed
Update 'osc rq show' command to include history comments in verbose mode
1 parent b2edaa8 commit 17d1113

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

osc/commandline.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3012,6 +3012,7 @@ def do_request(self, subcmd, opts, *args):
30123012
30133013
"show" will show the request itself, and generate a diff for review, if
30143014
used with the --diff option. The keyword show can be omitted if the ID is numeric.
3015+
The -v/--verbose options shows comments in the request's history.
30153016
30163017
"decline" will change the request state to "declined"
30173018
@@ -3052,7 +3053,7 @@ def do_request(self, subcmd, opts, *args):
30523053
usage:
30533054
osc request list [-M] [-U USER] [-s state] [-D DAYS] [-t type] [-B] [PRJ [PKG]]
30543055
osc request log ID
3055-
osc request [show] [-d] [-b] ID
3056+
osc request [show] [-d] [-b] [-v/--verbose] ID
30563057
30573058
osc request accept [-m TEXT] ID
30583059
osc request approve [-m TEXT] ID

osc/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,8 @@ def __str__(self):
990990
lines += ["", "History:"]
991991
for hist in reversed(self.statehistory):
992992
lines += [f" {hist.when:10} {hist.who:30} {hist.description}"]
993+
if conf.config["verbose"] and hist.comment.strip():
994+
lines += [textwrap.indent(hist.comment.strip(), prefix=" | ", predicate=lambda line: True)]
993995

994996
return '\n'.join(lines)
995997

0 commit comments

Comments
 (0)