[PATCH 7 of 8] hghave: add check for zstd support

Gregory Szorc gregory.szorc at gmail.com
Fri Nov 11 04:23:39 EST 2016


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1478849921 28800
#      Thu Nov 10 23:38:41 2016 -0800
# Node ID 2628b96b3884024e3c0552303d71bdd9fbd99a71
# Parent  45801e65f33949e6663ebfff651cb78d01afcc3e
hghave: add check for zstd support

Not all configurations will support zstd. Add a check so we can
conditionalize tests.

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -610,3 +610,12 @@ def has_hypothesis():
 @check("unziplinks", "unzip(1) understands and extracts symlinks")
 def unzip_understands_symlinks():
     return matchoutput('unzip --help', br'Info-ZIP')
+
+ at check("zstd", "zstd Python module available")
+def has_zstd():
+    try:
+        import mercurial.zstd
+        mercurial.zstd.__version__
+        return True
+    except ImportError:
+        return False


More information about the Mercurial-devel mailing list