Patchwork [3,of,4] mmapindex: move the 'mmapindexthreshold' option out of experimental

login
register
mail settings
Submitter Boris Feld
Date Dec. 2, 2018, 4:17 p.m.
Message ID <0fff68dfbe48d87dce8b.1543767462@pc62.home>
Download mbox | patch
Permalink /patch/36904/
State Accepted
Headers show

Comments

Boris Feld - Dec. 2, 2018, 4:17 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1542949653 -3600
#      Fri Nov 23 06:07:33 2018 +0100
# Node ID 0fff68dfbe48d87dce8b8736c0347ed5aa79030e
# Parent  0f29dba58034752d00c2c0000cbe41cc787b6dec
# EXP-Topic mmap
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0fff68dfbe48
mmapindex: move the 'mmapindexthreshold' option out of experimental

The option is useful and should be advertised more. We move it out of
experimental as a first step. The `storage` section is selected as this is
related to how the storage is accessed. A new 'performance' section might be
more appropriate.

We move from 'mmapindexthreshold` to `mmap-threshold` as non-index item are
also suitable for mmap (eg: the rev-branch-cache).

If relevant, we can introduce sub-option `mmap-threshold.revlog-index` later.

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -544,9 +544,6 @@  coreconfigitem('experimental', 'maxdelta
 coreconfigitem('experimental', 'mergetempdirprefix',
     default=None,
 )
-coreconfigitem('experimental', 'mmapindexthreshold',
-    default=None,
-)
 coreconfigitem('experimental', 'narrow',
     default=False,
 )
@@ -978,6 +975,10 @@  coreconfigitem('progress', 'width',
 coreconfigitem('push', 'pushvars.server',
     default=False,
 )
+coreconfigitem('storage', 'mmap-threshold',
+    default=None,
+    alias=[('experimental', 'mmapindexthreshold')],
+)
 coreconfigitem('storage', 'new-repo-backend',
     default='revlogv1',
 )
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -751,8 +751,7 @@  def resolverevlogstorevfsoptions(ui, req
     if 0 <= chainspan:
         options[b'maxdeltachainspan'] = chainspan
 
-    mmapindexthreshold = ui.configbytes(b'experimental',
-                                        b'mmapindexthreshold')
+    mmapindexthreshold = ui.configbytes(b'storage', b'mmap-threshold')
     if mmapindexthreshold is not None:
         options[b'mmapindexthreshold'] = mmapindexthreshold