cli: add replies to patch show output
If any replies to patches were made, it was not possible to see them in the output of `rad patch show`. Add the replies to show output, but only if the `--verbose` flag is set. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
parent
3a2e06e498
commit
96c65eb2b3
|
|
@ -435,6 +435,16 @@ pub fn show(
|
|||
for line in timeline::timeline(profile, patch) {
|
||||
widget.push(line);
|
||||
}
|
||||
|
||||
if verbose {
|
||||
for (id, comment) in revision.replies() {
|
||||
let hstack = term::comment::header(id, comment, profile);
|
||||
|
||||
widget = widget.divider();
|
||||
widget.push(hstack);
|
||||
widget.push(term::textarea(comment.body()).wrap(60));
|
||||
}
|
||||
}
|
||||
widget.print();
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
|
|
@ -1420,6 +1420,11 @@ impl Revision {
|
|||
&self.discussion
|
||||
}
|
||||
|
||||
/// Iterate over all top-level replies.
|
||||
pub fn replies(&self) -> impl Iterator<Item = (&CommentId, &thread::Comment<CodeLocation>)> {
|
||||
self.discussion.comments()
|
||||
}
|
||||
|
||||
/// Reviews of this revision's changes (one per actor).
|
||||
pub fn reviews(&self) -> impl DoubleEndedIterator<Item = (&PublicKey, &Review)> {
|
||||
self.reviews
|
||||
|
|
|
|||
Loading…
Reference in New Issue