1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

Fix 'request show' command to print superseded_by information

This commit is contained in:
Daniel Mach 2023-09-14 14:05:19 +02:00
parent 0894724219
commit 9361d78012

View File

@ -2855,6 +2855,7 @@ class RequestState(AbstractState):
self.who = state_node.get('who') self.who = state_node.get('who')
self.when = state_node.get('when') self.when = state_node.get('when')
self.approver = state_node.get('approver') self.approver = state_node.get('approver')
self.superseded_by = state_node.get("superseded_by", None)
if state_node.find('description') is None: if state_node.find('description') is None:
# OBS 2.6 has it always, before it did not exist # OBS 2.6 has it always, before it did not exist
self.description = state_node.get('description') self.description = state_node.get('description')
@ -3345,7 +3346,10 @@ class Request:
lines += ["", "Message:", textwrap.indent(self.description or "<no message>", prefix=" ")] lines += ["", "Message:", textwrap.indent(self.description or "<no message>", prefix=" ")]
if self.state: if self.state:
lines += ["", "State:", f" {self.state.name:61} {self.state.when:12} {self.state.who}"] state_name = self.state.name
if self.state.superseded_by:
state_name += f" by {self.state.superseded_by}"
lines += ["", "State:", f" {state_name:61} {self.state.when:12} {self.state.who}"]
if self.state.comment: if self.state.comment:
lines += [textwrap.indent(self.state.comment, prefix=" | ", predicate=lambda line: True)] lines += [textwrap.indent(self.state.comment, prefix=" | ", predicate=lambda line: True)]