##// END OF EJS Templates
persistent-nodemap: add a "abort" option to the slow-path config...
marmoute -
r47029:014ac7a3 default
parent child Browse files
Show More
@@ -1797,7 +1797,7 b' coreconfigitem('
1797 coreconfigitem(
1797 coreconfigitem(
1798 b'storage',
1798 b'storage',
1799 b'revlog.persistent-nodemap.slow-path',
1799 b'revlog.persistent-nodemap.slow-path',
1800 default=b"warn",
1800 default=b"abort",
1801 experimental=True,
1801 experimental=True,
1802 )
1802 )
1803
1803
@@ -904,8 +904,11 b' https://www.mercurial-scm.org/wiki/Missi'
904 operation for larger repository.
904 operation for larger repository.
905
905
906 The performance improving version of this feature is currently only
906 The performance improving version of this feature is currently only
907 implemented in Rust, so people using a version of Mercurial compiled
907 implemented in Rust, so people not using a version of Mercurial compiled
908 without the Rust part might actually suffer some slowdown.
908 with the Rust part might actually suffer some slowdown. For this reason,
909 Such version will by default refuse to access such repositories. That
910 behavior can be controlled by configuration. Check
911 :hg:`help config.storage.revlog.persistent-nodemap.slowpath` for details.
909
912
910 Repository with this on-disk format require Mercurial version 5.4 or above.
913 Repository with this on-disk format require Mercurial version 5.4 or above.
911
914
@@ -1960,8 +1963,7 b' category impact performance and reposito'
1960
1963
1961 ``allow``: Silently use the slower implementation to access the repository.
1964 ``allow``: Silently use the slower implementation to access the repository.
1962 ``warn``: Warn, but use the slower implementation to access the repository.
1965 ``warn``: Warn, but use the slower implementation to access the repository.
1963
1966 ``abort``: Prevent access to such repositories. (This is the default)
1964 Default to ``warn``
1965
1967
1966 For details on the "persistent-nodemap" feature, see:
1968 For details on the "persistent-nodemap" feature, see:
1967 :hg:`help config format.use-persistent-nodemap`.
1969 :hg:`help config format.use-persistent-nodemap`.
@@ -1048,7 +1048,7 b' def resolverevlogstorevfsoptions(ui, req'
1048 slow_path = ui.config(
1048 slow_path = ui.config(
1049 b'storage', b'revlog.persistent-nodemap.slow-path'
1049 b'storage', b'revlog.persistent-nodemap.slow-path'
1050 )
1050 )
1051 if slow_path not in (b'allow', b'warn'):
1051 if slow_path not in (b'allow', b'warn', b'abort'):
1052 default = ui.config_default(
1052 default = ui.config_default(
1053 b'storage', b'revlog.persistent-nodemap.slow-path'
1053 b'storage', b'revlog.persistent-nodemap.slow-path'
1054 )
1054 )
@@ -1069,12 +1069,15 b' def resolverevlogstorevfsoptions(ui, req'
1069 b"check `hg help config.format.use-persistent-nodemap` "
1069 b"check `hg help config.format.use-persistent-nodemap` "
1070 b"for details"
1070 b"for details"
1071 )
1071 )
1072 if slow_path == b'warn' and not revlog.HAS_FAST_PERSISTENT_NODEMAP:
1072 if not revlog.HAS_FAST_PERSISTENT_NODEMAP:
1073 if slow_path == b'warn':
1073 msg = b"warning: " + msg + b'\n'
1074 msg = b"warning: " + msg + b'\n'
1074 ui.warn(msg)
1075 ui.warn(msg)
1075 if not ui.quiet:
1076 if not ui.quiet:
1076 hint = b'(' + hint + b')\n'
1077 hint = b'(' + hint + b')\n'
1077 ui.warn(hint)
1078 ui.warn(hint)
1079 if slow_path == b'abort':
1080 raise error.Abort(msg, hint=hint)
1078 options[b'persistent-nodemap'] = True
1081 options[b'persistent-nodemap'] = True
1079 if ui.configbool(b'storage', b'revlog.persistent-nodemap.mmap'):
1082 if ui.configbool(b'storage', b'revlog.persistent-nodemap.mmap'):
1080 options[b'persistent-nodemap.mmap'] = True
1083 options[b'persistent-nodemap.mmap'] = True
@@ -17,9 +17,9 b' Check handling of the default slow-path '
17 #if no-pure no-rust
17 #if no-pure no-rust
18
18
19 $ hg id
19 $ hg id
20 warning: accessing `persistent-nodemap` repository without associated fast implementation.
20 abort: accessing `persistent-nodemap` repository without associated fast implementation.
21 (check `hg help config.format.use-persistent-nodemap` for details)
21 (check `hg help config.format.use-persistent-nodemap` for details)
22 000000000000 tip
22 [255]
23
23
24 Unlock further check (we are here to test the feature)
24 Unlock further check (we are here to test the feature)
25
25
@@ -135,14 +135,14 b' add a new commit'
135 Check slow-path config value handling
135 Check slow-path config value handling
136 -------------------------------------
136 -------------------------------------
137
137
138 #if no-pure no-rust
139
138 $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
140 $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
139 unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
141 unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
140 falling back to default value: warn
142 falling back to default value: abort
141 warning: accessing `persistent-nodemap` repository without associated fast implementation. (no-pure no-rust !)
143 abort: accessing `persistent-nodemap` repository without associated fast implementation.
142 (check `hg help config.format.use-persistent-nodemap` for details) (no-pure no-rust !)
144 (check `hg help config.format.use-persistent-nodemap` for details)
143 6b02b8c7b966+ tip
145 [255]
144
145 #if no-pure no-rust
146
146
147 $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn"
147 $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn"
148 warning: accessing `persistent-nodemap` repository without associated fast implementation.
148 warning: accessing `persistent-nodemap` repository without associated fast implementation.
@@ -153,12 +153,18 b' Check slow-path config value handling'
153 date: Thu Jan 01 01:23:20 1970 +0000
153 date: Thu Jan 01 01:23:20 1970 +0000
154 summary: r5000
154 summary: r5000
155
155
156 $ hg ci -m 'foo' --config "storage.revlog.nodemap.mode=strict"
156 $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort"
157 transaction abort!
157 abort: accessing `persistent-nodemap` repository without associated fast implementation.
158 rollback completed
158 (check `hg help config.format.use-persistent-nodemap` for details)
159 abort: persistent nodemap in strict mode without efficient method
160 [255]
159 [255]
161
160
161 #else
162
163 $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
164 unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
165 falling back to default value: abort
166 6b02b8c7b966+ tip
167
162 #endif
168 #endif
163
169
164 $ hg ci -m 'foo'
170 $ hg ci -m 'foo'
General Comments 0
You need to be logged in to leave comments. Login now