[PATCH 2 of 6 V2] test-pattern: substitute common compression list

Boris Feld boris.feld at octobus.net
Mon Nov 13 06:11:16 EST 2017


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1509860498 -3600
#      Sun Nov 05 06:41:38 2017 +0100
# Node ID 15aa75b64e1dff38fcce4a8f283daf0ce37a1261
# Parent  a7d1303d69b73deac107d78ed37506f662ec661b
# EXP-Topic better-substitute
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 15aa75b64e1d
test-pattern: substitute common compression list

The compression list as to be matched with a glob because zstd might not be part
of the option. By using a substitution for these, we won't have to re-glob them
over and over.

diff --git a/tests/common-pattern.py b/tests/common-pattern.py
new file mode 100644
--- /dev/null
+++ b/tests/common-pattern.py
@@ -0,0 +1,9 @@
+# common patterns in test at can safely be replaced
+from __future__ import absolute_import
+
+substitutions = [
+    # list of possible compressions
+    (br'zstd,zlib,none,bzip2',
+     br'$USUAL_COMPRESSIONS$'
+    ),
+]


More information about the Mercurial-devel mailing list