[PATCH 1 of 3 "V4] compression: only declare revlog support for available engine

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Apr 16 09:26:05 EDT 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1555420216 -7200
#      Tue Apr 16 15:10:16 2019 +0200
# Node ID 32be9488a4f86228802c523512b29a17b420b3ea
# Parent  967c098eed3398d991cbd7f0d48636b575beb711
# EXP-Topic zstd-revlog
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 32be9488a4f8
compression: only declare revlog support for available engine

Even if we know that an engine support revlog compression, the Mercurial process
still won't support it if the compression engine is not available.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -643,7 +643,7 @@ def gathersupportedrequirements(ui):
     # Add derived requirements from registered compression engines.
     for name in util.compengines:
         engine = util.compengines[name]
-        if engine.revlogheader():
+        if engine.available() and engine.revlogheader():
             supported.add(b'exp-compression-%s' % name)
 
     return supported


More information about the Mercurial-devel mailing list