debugformat: fix formatting for compression level stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 21 Feb 2024 02:12:58 +0100
branchstable
changeset 51392 e0fc40b95f05
parent 51389 db5d7aee641e
child 51394 3a7ef1398385
child 51399 46fed351e451
debugformat: fix formatting for compression level `bytes(<int>)` gives a very different result as `str(<int>)` and the display of `hg debugformat` have been broken for a while as a result.
mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py	Thu Feb 15 18:10:41 2024 +0000
+++ b/mercurial/upgrade_utils/actions.py	Wed Feb 21 02:12:58 2024 +0100
@@ -489,7 +489,7 @@
             level = repo.ui.configint(b'storage', b'revlog.zstd.level')
         if level is None:
             return b'default'
-        return bytes(level)
+        return b"%d" % level
 
     @classmethod
     def fromconfig(cls, repo):
@@ -501,7 +501,7 @@
             level = repo.ui.configint(b'storage', b'revlog.zstd.level')
         if level is None:
             return b'default'
-        return bytes(level)
+        return b"%d" % level
 
 
 def find_format_upgrades(repo):