Comments
Patch
@@ -415,6 +415,9 @@
coreconfigitem('experimental', 'sparse-read.density-threshold',
default=0.25,
)
+coreconfigitem('experimental', 'sparse-read.min-block-size',
+ default='256K',
+)
coreconfigitem('experimental', 'treemanifest',
default=False,
)
@@ -611,8 +611,11 @@
withsparseread = self.ui.configbool('experimental', 'sparse-read')
srdensitythres = float(self.ui.config('experimental',
'sparse-read.density-threshold'))
+ srminblocksize = self.ui.configbytes('experimental',
+ 'sparse-read.min-block-size')
self.svfs.options['with-sparse-read'] = withsparseread
self.svfs.options['sparse-read-density-threshold'] = srdensitythres
+ self.svfs.options['sparse-read-min-block-size'] = srminblocksize
for r in self.requirements:
if r.startswith('exp-compression-'):
@@ -180,7 +180,7 @@
endbyte = start(revs[-1]) + length(revs[-1])
deltachainspan = endbyte - startbyte
- if len(revs) <= 1:
+ if deltachainspan <= revlog._srminblocksize or len(revs) <= 1:
yield revs
continue
@@ -359,6 +359,7 @@
self._maxdeltachainspan = -1
self._withsparseread = False
self._srdensitythreshold = 0.25
+ self._srminblocksize = 262144
mmapindexthreshold = None
v = REVLOG_DEFAULT_VERSION
@@ -388,6 +389,8 @@
self._withsparseread = bool(opts.get('with-sparse-read', False))
if 'sparse-read-density-threshold' in opts:
self._srdensitythreshold = opts['sparse-read-density-threshold']
+ if 'sparse-read-min-block-size' in opts:
+ self._srminblocksize = opts['sparse-read-min-block-size']
if self._chunkcachesize <= 0:
raise RevlogError(_('revlog chunk cache size %r is not greater '