diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -444,7 +444,7 @@ coreconfigitem('experimental', 'sparse-r coreconfigitem('experimental', 'sparse-read.density-threshold', default=0.25, ) -coreconfigitem('experimental', 'sparse-read.min-block-size', +coreconfigitem('experimental', 'sparse-read.min-gap-size', default='256K', ) coreconfigitem('experimental', 'treemanifest', diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -611,11 +611,11 @@ class localrepository(object): 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') + srmingapsize = self.ui.configbytes('experimental', + 'sparse-read.min-gap-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 + self.svfs.options['sparse-read-min-gap-size'] = srmingapsize for r in self.requirements: if r.startswith('exp-compression-'): diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -196,7 +196,8 @@ def _slicechunk(revlog, revs): if prevend is not None: gapsize = revstart - prevend - if gapsize: + # only consider holes that are large enough + if gapsize > revlog._srmingapsize: heapq.heappush(gapsheap, (-gapsize, i)) prevend = revstart + revlen @@ -371,7 +372,7 @@ class revlog(object): self._maxdeltachainspan = -1 self._withsparseread = False self._srdensitythreshold = 0.25 - self._srminblocksize = 262144 + self._srmingapsize = 262144 mmapindexthreshold = None v = REVLOG_DEFAULT_VERSION @@ -401,8 +402,8 @@ class revlog(object): 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 'sparse-read-min-gap-size' in opts: + self._srmingapsize = opts['sparse-read-min-gap-size'] if self._chunkcachesize <= 0: raise RevlogError(_('revlog chunk cache size %r is not greater '