diff hgext/show.py @ 52113:31076a2301f1

py-3-13: stabilize the docstring output across all supported Python versions Python 3.13 now trims indents from docstrings at compilation time (to save space in .pyc), so all of our helptext is affected. The indentation has never served a user-facing purpose and was more here because nobody cared enough to remove it: we gain some screen space this way. Rather than undo the transformation (which isn't really possible since the transform also deletes leading/trailing whitespace), we align the behavior of older Python versions with that of 3.13. Unfortunately, this means breaking some of the translations. I've only touched the ones that need to work for some tooling tests to pass, but I do not have the time to fix the rest of them across all languages, since they cannot be done in an automated way. i18n updates have been basically abandonned for a good while now, hopefully someone cares enough to bring them back.
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 24 Oct 2024 15:23:52 +0200
parents f4733654f144
children 19ae7730636a
line wrap: on
line diff
--- a/hgext/show.py	Tue Oct 15 22:30:10 2024 -0400
+++ b/hgext/show.py	Thu Oct 24 15:23:52 2024 +0200
@@ -514,7 +514,7 @@
     entries = []
     for key in sorted(showview._table.keys()):
         entries.append(
-            r'    %s   %s'
+            r'%s   %s'
             % (
                 pycompat.sysstr(key.ljust(longest)),
                 showview._table[key]._origdoc,
@@ -522,7 +522,7 @@
         )
 
     cmdtable[b'show'][0].__doc__ = pycompat.sysstr(b'%s\n\n%s\n    ') % (
-        cmdtable[b'show'][0].__doc__.rstrip(),
+        pycompat.cleandoc(cmdtable[b'show'][0].__doc__),
         pycompat.sysstr(b'\n\n').join(entries),
     )