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" |
|
|
1800 | default=b"warn", | |
|
1801 | 1801 | experimental=True, |
|
1802 | 1802 | ) |
|
1803 | 1803 |
@@ -1959,8 +1959,9 b' category impact performance and reposito' | |||
|
1959 | 1959 | the feature: |
|
1960 | 1960 | |
|
1961 | 1961 | ``allow``: Silently use the slower implementation to access the repository. |
|
1962 | ||
|
1963 | Default to "allow" | |
|
1962 | ``warn``: Warn, but use the slower implementation to access the repository. | |
|
1963 | ||
|
1964 | Default to ``warn`` | |
|
1964 | 1965 | |
|
1965 | 1966 | For details on the "persistent-nodemap" feature, see: |
|
1966 | 1967 | :hg:`help config format.use-persistent-nodemap`. |
@@ -59,6 +59,7 b' from . import (' | |||
|
59 | 59 | rcutil, |
|
60 | 60 | repoview, |
|
61 | 61 | requirements as requirementsmod, |
|
62 | revlog, | |
|
62 | 63 | revset, |
|
63 | 64 | revsetlang, |
|
64 | 65 | scmutil, |
@@ -1047,7 +1048,7 b' def resolverevlogstorevfsoptions(ui, req' | |||
|
1047 | 1048 | slow_path = ui.config( |
|
1048 | 1049 | b'storage', b'revlog.persistent-nodemap.slow-path' |
|
1049 | 1050 | ) |
|
1050 | if slow_path not in (b'allow'): | |
|
1051 | if slow_path not in (b'allow', b'warn'): | |
|
1051 | 1052 | default = ui.config_default( |
|
1052 | 1053 | b'storage', b'revlog.persistent-nodemap.slow-path' |
|
1053 | 1054 | ) |
@@ -1059,6 +1060,21 b' def resolverevlogstorevfsoptions(ui, req' | |||
|
1059 | 1060 | if not ui.quiet: |
|
1060 | 1061 | ui.warn(_(b'falling back to default value: %s\n') % default) |
|
1061 | 1062 | slow_path = default |
|
1063 | ||
|
1064 | msg = _( | |
|
1065 | b"accessing `persistent-nodemap` repository without associated " | |
|
1066 | b"fast implementation." | |
|
1067 | ) | |
|
1068 | hint = _( | |
|
1069 | b"check `hg help config.format.use-persistent-nodemap` " | |
|
1070 | b"for details" | |
|
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) | |
|
1062 | 1078 | options[b'persistent-nodemap'] = True |
|
1063 | 1079 | if ui.configbool(b'storage', b'revlog.persistent-nodemap.mmap'): |
|
1064 | 1080 | options[b'persistent-nodemap.mmap'] = True |
@@ -161,6 +161,16 b' def _verify_revision(rl, skipflags, stat' | |||
|
161 | 161 | rl.revision(node) |
|
162 | 162 | |
|
163 | 163 | |
|
164 | # True if a fast implementation for persistent-nodemap is available | |
|
165 | # | |
|
166 | # We also consider we have a "fast" implementation in "pure" python because | |
|
167 | # people using pure don't really have performance consideration (and a | |
|
168 | # wheelbarrow of other slowness source) | |
|
169 | HAS_FAST_PERSISTENT_NODEMAP = rustrevlog is not None or util.safehasattr( | |
|
170 | parsers, 'BaseIndexObject' | |
|
171 | ) | |
|
172 | ||
|
173 | ||
|
164 | 174 | @attr.s(slots=True, frozen=True) |
|
165 | 175 | class _revisioninfo(object): |
|
166 | 176 | """Information about a revision that allows building its fulltext |
@@ -8,8 +8,30 b' Test the persistent on-disk nodemap' | |||
|
8 | 8 | > [devel] |
|
9 | 9 | > persistent-nodemap=yes |
|
10 | 10 | > EOF |
|
11 | $ hg init test-repo | |
|
11 | ||
|
12 | $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow | |
|
12 | 13 | $ cd test-repo |
|
14 | ||
|
15 | Check handling of the default slow-path value | |
|
16 | ||
|
17 | #if no-pure no-rust | |
|
18 | ||
|
19 | $ hg id | |
|
20 | warning: accessing `persistent-nodemap` repository without associated fast implementation. | |
|
21 | (check `hg help config.format.use-persistent-nodemap` for details) | |
|
22 | 000000000000 tip | |
|
23 | ||
|
24 | Unlock further check (we are here to test the feature) | |
|
25 | ||
|
26 | $ cat << EOF >> $HGRCPATH | |
|
27 | > [storage] | |
|
28 | > # to avoid spamming the test | |
|
29 | > revlog.persistent-nodemap.slow-path=allow | |
|
30 | > EOF | |
|
31 | ||
|
32 | #endif | |
|
33 | ||
|
34 | ||
|
13 | 35 | $ hg debugformat |
|
14 | 36 | format-variant repo |
|
15 | 37 | fncache: yes |
@@ -23,9 +45,8 b' Test the persistent on-disk nodemap' | |||
|
23 | 45 | plain-cl-delta: yes |
|
24 | 46 | compression: zlib |
|
25 | 47 | compression-level: default |
|
26 |
$ hg debugbuilddag .+5000 --new-file |
|
|
27 | persistent nodemap in strict mode without efficient method (no-rust no-pure !) | |
|
28 | persistent nodemap in strict mode without efficient method (no-rust no-pure !) | |
|
48 | $ hg debugbuilddag .+5000 --new-file | |
|
49 | ||
|
29 | 50 |
$ |
|
30 | 51 | uid: ???????????????? (glob) |
|
31 | 52 | tip-rev: 5000 |
@@ -116,11 +137,22 b' Check slow-path config value handling' | |||
|
116 | 137 | |
|
117 | 138 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" |
|
118 | 139 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" |
|
119 |
falling back to default 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 !) | |
|
120 | 143 | 6b02b8c7b966+ tip |
|
121 | 144 | |
|
122 | 145 | #if no-pure no-rust |
|
123 | 146 | |
|
147 | $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn" | |
|
148 | warning: accessing `persistent-nodemap` repository without associated fast implementation. | |
|
149 | (check `hg help config.format.use-persistent-nodemap` for details) | |
|
150 | changeset: 5000:6b02b8c7b966 | |
|
151 | tag: tip | |
|
152 | user: debugbuilddag | |
|
153 | date: Thu Jan 01 01:23:20 1970 +0000 | |
|
154 | summary: r5000 | |
|
155 | ||
|
124 | 156 | $ hg ci -m 'foo' --config "storage.revlog.nodemap.mode=strict" |
|
125 | 157 | transaction abort! |
|
126 | 158 | rollback completed |
General Comments 0
You need to be logged in to leave comments.
Login now