( )⚙ D12167 rhg: Add support for colored output

This is an archive of the discontinued Mercurial Phabricator instance.

rhg: Add support for colored output
ClosedPublic

Authored by SimonSapin on Feb 10 2022, 2:18 PM.

Details

Summary

The same "label" system is used as in Python code

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

SimonSapin created this revision.Feb 10 2022, 2:18 PM

This will likely still need minor changes to make a test pass: https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/340039
This produces output that looks correct when rendered by a terminal, but escape sequences are not exactly where the test expects them.

SimonSapin updated this revision to Diff 32145.Feb 11 2022, 6:42 AM
SimonSapin retitled this revision from [WIP] rhg: Add support for colored output to rhg: Add support for colored output.Feb 11 2022, 11:35 AM
SimonSapin updated this revision to Diff 32148.
Alphare requested changes to this revision.Feb 12 2022, 7:02 PM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/rhg/src/ui.rs
61

Note to self: looks like this is removed in a later patch in the series

81

Needs a docstring

256

Those pyramids of scope would indeed fit in ancient Egypt. I think we should flatten the code somewhat for readability. :)

This revision now requires changes to proceed.Feb 12 2022, 7:02 PM
SimonSapin added inline comments.Feb 13 2022, 5:30 AM
rust/rhg/src/ui.rs
256

Haha that’s fair :) I’ll move some things around

SimonSapin updated this revision to Diff 32153.Feb 13 2022, 6:06 AM
Alphare accepted this revision.Feb 14 2022, 5:04 AM
This revision is now accepted and ready to land.Feb 14 2022, 5:04 AM
This revision was automatically updated to reflect the committed changes.