doc/gendoc.py
branchstable
changeset 44975 1a4b9b602e54
parent 43673 f0bee3b1b847
child 45830 c102b704edb5
--- 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)