The feature will be usable only within repository supported by version of
Mercurial with the support.
Since the support is not fully implemented yet, the requirement has a temporary,
experimental name.
( )
durin42 | |
indygreg |
hg-reviewers |
The feature will be usable only within repository supported by version of
Mercurial with the support.
Since the support is not fully implemented yet, the requirement has a temporary,
experimental name.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/configitems.py (4 lines) | |||
M | mercurial/localrepo.py (12 lines) | |||
M | mercurial/revlog.py (5 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
a1af28f006d2 | 2cc453284d5c | Pierre-Yves David | Sep 9 2019, 4:42 PM |
default=True, | default=True, | ||||
) | ) | ||||
coreconfigitem('format', 'usegeneraldelta', | coreconfigitem('format', 'usegeneraldelta', | ||||
default=True, | default=True, | ||||
) | ) | ||||
coreconfigitem('format', 'usestore', | coreconfigitem('format', 'usestore', | ||||
default=True, | default=True, | ||||
) | ) | ||||
coreconfigitem('format', 'use-side-data', | |||||
default=False, | |||||
experimental=True, | |||||
) | |||||
coreconfigitem('format', 'internal-phase', | coreconfigitem('format', 'internal-phase', | ||||
default=False, | default=False, | ||||
experimental=True, | experimental=True, | ||||
) | ) | ||||
coreconfigitem('fsmonitor', 'warn_when_unused', | coreconfigitem('fsmonitor', 'warn_when_unused', | ||||
default=True, | default=True, | ||||
) | ) | ||||
coreconfigitem('fsmonitor', 'warn_update_file_count', | coreconfigitem('fsmonitor', 'warn_update_file_count', |
# can spread over a larger span. Sparse reading cuts these large spans into | # can spread over a larger span. Sparse reading cuts these large spans into | ||||
# pieces, so that each piece isn't too big. | # pieces, so that each piece isn't too big. | ||||
# Without the sparserevlog capability, reading from the repository could use | # Without the sparserevlog capability, reading from the repository could use | ||||
# huge amounts of memory, because the whole span would be read at once, | # huge amounts of memory, because the whole span would be read at once, | ||||
# including all the intermediate revisions that aren't pertinent for the chain. | # including all the intermediate revisions that aren't pertinent for the chain. | ||||
# This is why once a repository has enabled sparse-read, it becomes required. | # This is why once a repository has enabled sparse-read, it becomes required. | ||||
SPARSEREVLOG_REQUIREMENT = 'sparserevlog' | SPARSEREVLOG_REQUIREMENT = 'sparserevlog' | ||||
# A repository with the sidedataflag requirement will allow to store extra | |||||
# information for revision without altering their original hashes. | |||||
SIDEDATA_REQUIREMENT = 'exp-sidedata-flag' | |||||
# Functions receiving (ui, features) that extensions can register to impact | # Functions receiving (ui, features) that extensions can register to impact | ||||
# the ability to load repositories with custom requirements. Only | # the ability to load repositories with custom requirements. Only | ||||
# functions defined in loaded extensions are called. | # functions defined in loaded extensions are called. | ||||
# | # | ||||
# The function receives a set of requirement strings that the repository | # The function receives a set of requirement strings that the repository | ||||
# is capable of opening. Functions will typically add elements to the | # is capable of opening. Functions will typically add elements to the | ||||
# set to reflect that the extension knows how to handle that requirements. | # set to reflect that the extension knows how to handle that requirements. | ||||
featuresetupfuncs = set() | featuresetupfuncs = set() | ||||
options[b'sparse-read-density-threshold'] = srdensitythres | options[b'sparse-read-density-threshold'] = srdensitythres | ||||
options[b'sparse-read-min-gap-size'] = srmingapsize | options[b'sparse-read-min-gap-size'] = srmingapsize | ||||
sparserevlog = SPARSEREVLOG_REQUIREMENT in requirements | sparserevlog = SPARSEREVLOG_REQUIREMENT in requirements | ||||
options[b'sparse-revlog'] = sparserevlog | options[b'sparse-revlog'] = sparserevlog | ||||
if sparserevlog: | if sparserevlog: | ||||
options[b'generaldelta'] = True | options[b'generaldelta'] = True | ||||
sidedata = SIDEDATA_REQUIREMENT in requirements | |||||
options[b'side-data'] = sidedata | |||||
maxchainlen = None | maxchainlen = None | ||||
if sparserevlog: | if sparserevlog: | ||||
maxchainlen = revlogconst.SPARSE_REVLOG_MAX_CHAIN_LENGTH | maxchainlen = revlogconst.SPARSE_REVLOG_MAX_CHAIN_LENGTH | ||||
# experimental config: format.maxchainlen | # experimental config: format.maxchainlen | ||||
maxchainlen = ui.configint(b'format', b'maxchainlen', maxchainlen) | maxchainlen = ui.configint(b'format', b'maxchainlen', maxchainlen) | ||||
if maxchainlen is not None: | if maxchainlen is not None: | ||||
options[b'maxchainlen'] = maxchainlen | options[b'maxchainlen'] = maxchainlen | ||||
# for stem compression of long paths. Experiment ended up not | # for stem compression of long paths. Experiment ended up not | ||||
# being successful (repository sizes went up due to worse delta | # being successful (repository sizes went up due to worse delta | ||||
# chains), and the code was deleted in 4.6. | # chains), and the code was deleted in 4.6. | ||||
supportedformats = { | supportedformats = { | ||||
'revlogv1', | 'revlogv1', | ||||
'generaldelta', | 'generaldelta', | ||||
'treemanifest', | 'treemanifest', | ||||
REVLOGV2_REQUIREMENT, | REVLOGV2_REQUIREMENT, | ||||
SIDEDATA_REQUIREMENT, | |||||
SPARSEREVLOG_REQUIREMENT, | SPARSEREVLOG_REQUIREMENT, | ||||
bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT, | bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT, | ||||
} | } | ||||
_basesupported = supportedformats | { | _basesupported = supportedformats | { | ||||
'store', | 'store', | ||||
'fncache', | 'fncache', | ||||
'shared', | 'shared', | ||||
'relshared', | 'relshared', | ||||
requirements.add('revlog-compression-zstd') | requirements.add('revlog-compression-zstd') | ||||
elif compengine != 'zlib': | elif compengine != 'zlib': | ||||
requirements.add('exp-compression-%s' % compengine) | requirements.add('exp-compression-%s' % compengine) | ||||
if scmutil.gdinitconfig(ui): | if scmutil.gdinitconfig(ui): | ||||
requirements.add('generaldelta') | requirements.add('generaldelta') | ||||
if ui.configbool('format', 'sparse-revlog'): | if ui.configbool('format', 'sparse-revlog'): | ||||
requirements.add(SPARSEREVLOG_REQUIREMENT) | requirements.add(SPARSEREVLOG_REQUIREMENT) | ||||
# experimental config: format.use-side-data | |||||
if ui.configbool('format', 'use-side-data'): | |||||
requirements.add(SIDEDATA_REQUIREMENT) | |||||
if ui.configbool('experimental', 'treemanifest'): | if ui.configbool('experimental', 'treemanifest'): | ||||
requirements.add('treemanifest') | requirements.add('treemanifest') | ||||
revlogv2 = ui.config('experimental', 'revlogv2') | revlogv2 = ui.config('experimental', 'revlogv2') | ||||
if revlogv2 == 'enable-unstable-format-and-corrupt-my-data': | if revlogv2 == 'enable-unstable-format-and-corrupt-my-data': | ||||
requirements.remove('revlogv1') | requirements.remove('revlogv1') | ||||
# generaldelta is implied by revlogv2. | # generaldelta is implied by revlogv2. | ||||
requirements.discard('generaldelta') | requirements.discard('generaldelta') |
if 'zlib.level' in opts: | if 'zlib.level' in opts: | ||||
self._compengineopts['zlib.level'] = opts['zlib.level'] | self._compengineopts['zlib.level'] = opts['zlib.level'] | ||||
if 'zstd.level' in opts: | if 'zstd.level' in opts: | ||||
self._compengineopts['zstd.level'] = opts['zstd.level'] | self._compengineopts['zstd.level'] = opts['zstd.level'] | ||||
if 'maxdeltachainspan' in opts: | if 'maxdeltachainspan' in opts: | ||||
self._maxdeltachainspan = opts['maxdeltachainspan'] | self._maxdeltachainspan = opts['maxdeltachainspan'] | ||||
if self._mmaplargeindex and 'mmapindexthreshold' in opts: | if self._mmaplargeindex and 'mmapindexthreshold' in opts: | ||||
mmapindexthreshold = opts['mmapindexthreshold'] | mmapindexthreshold = opts['mmapindexthreshold'] | ||||
self.hassidedata = bool(opts.get('side-data', False)) | |||||
self._sparserevlog = bool(opts.get('sparse-revlog', False)) | self._sparserevlog = bool(opts.get('sparse-revlog', False)) | ||||
withsparseread = bool(opts.get('with-sparse-read', False)) | withsparseread = bool(opts.get('with-sparse-read', False)) | ||||
# sparse-revlog forces sparse-read | # sparse-revlog forces sparse-read | ||||
self._withsparseread = self._sparserevlog or withsparseread | self._withsparseread = self._sparserevlog or withsparseread | ||||
if 'sparse-read-density-threshold' in opts: | if 'sparse-read-density-threshold' in opts: | ||||
self._srdensitythreshold = opts['sparse-read-density-threshold'] | self._srdensitythreshold = opts['sparse-read-density-threshold'] | ||||
if 'sparse-read-min-gap-size' in opts: | if 'sparse-read-min-gap-size' in opts: | ||||
self._srmingapsize = opts['sparse-read-min-gap-size'] | self._srmingapsize = opts['sparse-read-min-gap-size'] | ||||
multiple calls | multiple calls | ||||
""" | """ | ||||
if link == nullrev: | if link == nullrev: | ||||
raise error.RevlogError(_("attempted to add linkrev -1 to %s") | raise error.RevlogError(_("attempted to add linkrev -1 to %s") | ||||
% self.indexfile) | % self.indexfile) | ||||
if sidedata is None: | if sidedata is None: | ||||
sidedata = {} | sidedata = {} | ||||
elif not self.hassidedata: | |||||
raise error.ProgrammingError( | |||||
_("trying to add sidedata to a revlog who don't support them") | |||||
) | |||||
if flags: | if flags: | ||||
node = node or self.hash(text, p1, p2) | node = node or self.hash(text, p1, p2) | ||||
rawtext, validatehash = flagutil.processflagswrite(self, text, flags, | rawtext, validatehash = flagutil.processflagswrite(self, text, flags, | ||||
sidedata=sidedata) | sidedata=sidedata) | ||||
# If the flag processor modifies the revision data, ignore any provided | # If the flag processor modifies the revision data, ignore any provided |