# HG changeset patch # User Kyle Lippincott # Date 1592435471 25200 # Node ID 1a4b9b602e54788ead2ad15b843ed7f3b90b706a # Parent 9e5f598fd29b0bc336d9d1b00d6888cb8a694be6 py3: fix broken man page generation, it was generating `(default: NUL*)` `bytes(default)` was producing things like `(default: \x00)` when handed non-bytes values such as `1`, `10`, or `True`. The man page generation would apparently ignore these bytes and produce man pages that had the string `(default: )`. Test Plan: - Ran `cd doc; python3 gendoc.py "hg.1.gendoc"` and grepped for bad output - Ran `make deb`, extracted the deb, manually inspected `hg.1` file. Differential Revision: https://phab.mercurial-scm.org/D8639 diff -r 9e5f598fd29b -r 1a4b9b602e54 doc/gendoc.py --- a/doc/gendoc.py Tue Jun 16 14:38:50 2020 +0200 +++ b/doc/gendoc.py Wed Jun 17 16:11:11 2020 -0700 @@ -40,6 +40,7 @@ gettext, _, ) +from mercurial.utils import stringutil table = commands.table globalopts = commands.globalopts @@ -85,7 +86,9 @@ if b'\n' in desc: # only remove line breaks and indentation desc = b' '.join(l.lstrip() for l in desc.split(b'\n')) - desc += default and _(b" (default: %s)") % bytes(default) or b"" + if default: + default = stringutil.forcebytestr(default) + desc += _(b" (default: %s)") % default yield (b", ".join(allopts), desc)