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

login
register
mail settings
Submitter Pierre-Yves David
Date April 16, 2019, 1:26 p.m.
Message ID <32be9488a4f86228802c.1555421165@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39631/
State Accepted
Headers show

Comments

Pierre-Yves David - April 16, 2019, 1:26 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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