Mercurial > hg
diff mercurial/upgrade_utils/actions.py @ 46851:3aa78f2aea48
revlog-compression: fix computation of engine availability
We don't just need the engine to be define, we need it to be available and able
to do be used for revlog compression. Without this change, `zstd` could be
selected as a viable option for repository creation on platform where it is not
available.
Differential Revision: https://phab.mercurial-scm.org/D10325
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 07 Apr 2021 12:15:28 +0200 |
parents | 7d9d9265d40f |
children | 84a93fa7ecfd |
line wrap: on
line diff
--- a/mercurial/upgrade_utils/actions.py Wed Apr 07 00:12:07 2021 +0200 +++ b/mercurial/upgrade_utils/actions.py Wed Apr 07 12:15:28 2021 +0200 @@ -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)