--- a/mercurial/upgrade_utils/actions.py Wed Apr 07 13:31:15 2021 +0200
+++ b/mercurial/upgrade_utils/actions.py Tue Apr 06 18:55:19 2021 +0200
@@ -395,10 +395,21 @@
return True
+_has_zstd = (
+ b'zstd' in util.compengines
+ and util.compengines[b'zstd'].available()
+ and util.compengines[b'zstd'].revlogheader()
+)
+
+
@registerformatvariant
class compressionengine(formatvariant):
name = b'compression'
- default = b'zlib'
+
+ if _has_zstd:
+ default = b'zstd'
+ else:
+ default = b'zlib'
description = _(
b'Compresion algorithm used to compress data. '