comparison mercurial/revlog.py @ 43030:827cb4fe62a3

sidedata: introduce a new requirement to protect the feature 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. Differential Revision: https://phab.mercurial-scm.org/D6886
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 09 Sep 2019 22:42:55 +0200
parents 3518da504303
children 294afb982a88
comparison
equal deleted inserted replaced
43029:041f042afcc5 43030:827cb4fe62a3
386 self._compengineopts['zstd.level'] = opts['zstd.level'] 386 self._compengineopts['zstd.level'] = opts['zstd.level']
387 if 'maxdeltachainspan' in opts: 387 if 'maxdeltachainspan' in opts:
388 self._maxdeltachainspan = opts['maxdeltachainspan'] 388 self._maxdeltachainspan = opts['maxdeltachainspan']
389 if self._mmaplargeindex and 'mmapindexthreshold' in opts: 389 if self._mmaplargeindex and 'mmapindexthreshold' in opts:
390 mmapindexthreshold = opts['mmapindexthreshold'] 390 mmapindexthreshold = opts['mmapindexthreshold']
391 self.hassidedata = bool(opts.get('side-data', False))
391 self._sparserevlog = bool(opts.get('sparse-revlog', False)) 392 self._sparserevlog = bool(opts.get('sparse-revlog', False))
392 withsparseread = bool(opts.get('with-sparse-read', False)) 393 withsparseread = bool(opts.get('with-sparse-read', False))
393 # sparse-revlog forces sparse-read 394 # sparse-revlog forces sparse-read
394 self._withsparseread = self._sparserevlog or withsparseread 395 self._withsparseread = self._sparserevlog or withsparseread
395 if 'sparse-read-density-threshold' in opts: 396 if 'sparse-read-density-threshold' in opts:
1847 raise error.RevlogError(_("attempted to add linkrev -1 to %s") 1848 raise error.RevlogError(_("attempted to add linkrev -1 to %s")
1848 % self.indexfile) 1849 % self.indexfile)
1849 1850
1850 if sidedata is None: 1851 if sidedata is None:
1851 sidedata = {} 1852 sidedata = {}
1853 elif not self.hassidedata:
1854 raise error.ProgrammingError(
1855 _("trying to add sidedata to a revlog who don't support them")
1856 )
1852 1857
1853 if flags: 1858 if flags:
1854 node = node or self.hash(text, p1, p2) 1859 node = node or self.hash(text, p1, p2)
1855 1860
1856 rawtext, validatehash = flagutil.processflagswrite(self, text, flags, 1861 rawtext, validatehash = flagutil.processflagswrite(self, text, flags,