Skip to content
Snippets Groups Projects
Commit 0f549da5 authored by Gregory Szorc's avatar Gregory Szorc
Browse files

stringutil: teach pprint() to indent

This will make data structure dumping in various places a bit
easier to read and diff. Since I wanted this for `hg debugwireproto`
output, I added indentation to it.

A more advanced pretty printer implementation would conditionally
add newlines if output is too long. But it is vastly simpler to
be consistent and always add newlines when indenting.

Again, I'm not crazy about the verbosity of the code and there is
room to consolidate logic for "print a collection." But this isn't
the most complicated code in the world and I'm not convinced it is
worth doing.

Differential Revision: https://phab.mercurial-scm.org/D4399
parent b4e7e1f0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment