##// END OF EJS Templates
nodemap: add a new mode option, with an optional "warn" value...
marmoute -
r45292:6493f0a5 default
parent child Browse files
Show More
@@ -681,6 +681,9 b' coreconfigitem('
681 681 b'experimental', b'exp-persistent-nodemap.mmap', default=True,
682 682 )
683 683 coreconfigitem(
684 b'experimental', b'exp-persistent-nodemap.mode', default=b'compat',
685 )
686 coreconfigitem(
684 687 b'experimental', b'server.filesdata.recommended-batch-size', default=50000,
685 688 )
686 689 coreconfigitem(
@@ -937,6 +937,8 b' def resolverevlogstorevfsoptions(ui, req'
937 937 options[b'exp-persistent-nodemap'] = True
938 938 if ui.configbool(b'experimental', b'exp-persistent-nodemap.mmap'):
939 939 options[b'exp-persistent-nodemap.mmap'] = True
940 epnm = ui.config(b'experimental', b'exp-persistent-nodemap.mode')
941 options[b'exp-persistent-nodemap.mode'] = epnm
940 942 if ui.configbool(b'devel', b'persistent-nodemap'):
941 943 options[b'devel-force-nodemap'] = True
942 944
@@ -13,6 +13,8 b' import os'
13 13 import re
14 14 import struct
15 15
16 from ..i18n import _
17
16 18 from .. import (
17 19 error,
18 20 node as nodemod,
@@ -105,6 +107,9 b' class _NoTransaction(object):'
105 107 def addabort(self, *args, **kwargs):
106 108 pass
107 109
110 def _report(self, *args):
111 pass
112
108 113
109 114 def update_persistent_nodemap(revlog):
110 115 """update the persistent nodemap right now
@@ -138,6 +143,11 b' def _persist_nodemap(tr, revlog, pending'
138 143 ondisk_docket = revlog._nodemap_docket
139 144 feed_data = util.safehasattr(revlog.index, "update_nodemap_data")
140 145 use_mmap = revlog.opener.options.get(b"exp-persistent-nodemap.mmap")
146 mode = revlog.opener.options.get(b"exp-persistent-nodemap.mode")
147 if not can_incremental:
148 msg = _(b"persistent nodemap in strict mode without efficient method")
149 if mode == b'warn':
150 tr._report(b"%s\n" % msg)
141 151
142 152 data = None
143 153 # first attemp an incremental update of the data
@@ -10,7 +10,9 b' Test the persistent on-disk nodemap'
10 10 > [devel]
11 11 > persistent-nodemap=yes
12 12 > EOF
13 $ hg debugbuilddag .+5000 --new-file
13 $ hg debugbuilddag .+5000 --new-file --config "experimental.exp-persistent-nodemap.mode=warn"
14 persistent nodemap in strict mode without efficient method (no-rust no-pure !)
15 persistent nodemap in strict mode without efficient method (no-rust no-pure !)
14 16 $ hg debugnodemap --metadata
15 17 uid: ???????????????? (glob)
16 18 tip-rev: 5000
General Comments 0
You need to be logged in to leave comments. Login now