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