diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -3470,7 +3470,9 @@ compengines = ui.configlist(b'format', b'revlog-compression') for compengine in compengines: if compengine in util.compengines: - break + engine = util.compengines[compengine] + if engine.available() and engine.revlogheader(): + break else: raise error.Abort( _( diff --git a/mercurial/upgrade_utils/actions.py b/mercurial/upgrade_utils/actions.py --- a/mercurial/upgrade_utils/actions.py +++ b/mercurial/upgrade_utils/actions.py @@ -428,7 +428,9 @@ # return the first valid value as the selection code would do for comp in compengines: if comp in util.compengines: - return comp + e = util.compengines[comp] + if e.available() and e.revlogheader(): + return comp # no valide compression found lets display it all for clarity return b','.join(compengines)