comparison mercurial/localrepo.py @ 44382:f0027a3dd7cb

revlog-compression: update the config to be a list format.revlog-compression is now a list of engine, the first supported one is to be used. Doing this have several benefits: 1) this is fully backward compatible, config using a single entry will be read as a single item list, not changing any behavior. 2) This open the way to use zstd by default without impacting platform were it is not available. This will be done in a later changesets. Using zstd provide a significant performance boost explained in : bb271ec2fbfb. However zstd is not available in some cases, A notable example is the `--pure` version of Mercurial which doesn't come with zstd support. Differential Revision: https://phab.mercurial-scm.org/D8148
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 19 Feb 2020 17:30:04 +0100
parents f7459da77f23
children f935b680860d
comparison
equal deleted inserted replaced
44381:454bc51f114c 44382:f0027a3dd7cb
3576 if ui.configbool(b'format', b'usefncache'): 3576 if ui.configbool(b'format', b'usefncache'):
3577 requirements.add(b'fncache') 3577 requirements.add(b'fncache')
3578 if ui.configbool(b'format', b'dotencode'): 3578 if ui.configbool(b'format', b'dotencode'):
3579 requirements.add(b'dotencode') 3579 requirements.add(b'dotencode')
3580 3580
3581 compengine = ui.config(b'format', b'revlog-compression') 3581 compengines = ui.configlist(b'format', b'revlog-compression')
3582 if compengine not in util.compengines: 3582 for compengine in compengines:
3583 if compengine in util.compengines:
3584 break
3585 else:
3583 raise error.Abort( 3586 raise error.Abort(
3584 _( 3587 _(
3585 b'compression engine %s defined by ' 3588 b'compression engines %s defined by '
3586 b'format.revlog-compression not available' 3589 b'format.revlog-compression not available'
3587 ) 3590 )
3588 % compengine, 3591 % b', '.join(b'"%s"' % e for e in compengines),
3589 hint=_( 3592 hint=_(
3590 b'run "hg debuginstall" to list available ' 3593 b'run "hg debuginstall" to list available '
3591 b'compression engines' 3594 b'compression engines'
3592 ), 3595 ),
3593 ) 3596 )
3594 3597
3595 # zlib is the historical default and doesn't need an explicit requirement. 3598 # zlib is the historical default and doesn't need an explicit requirement.
3596 elif compengine == b'zstd': 3599 if compengine == b'zstd':
3597 requirements.add(b'revlog-compression-zstd') 3600 requirements.add(b'revlog-compression-zstd')
3598 elif compengine != b'zlib': 3601 elif compengine != b'zlib':
3599 requirements.add(b'exp-compression-%s' % compengine) 3602 requirements.add(b'exp-compression-%s' % compengine)
3600 3603
3601 if scmutil.gdinitconfig(ui): 3604 if scmutil.gdinitconfig(ui):