##// END OF EJS Templates
test: simpler requirements matching in test-repo-compengines.t...
marmoute -
r49508:d7135d8e default
parent child Browse files
Show More
@@ -1,258 +1,224 b''
1 A new repository uses zlib storage, which doesn't need a requirement
1 A new repository uses zlib storage, which doesn't need a requirement
2
2
3 $ cat << EOF >> $HGRCPATH
3 $ cat << EOF >> $HGRCPATH
4 > [format]
4 > [format]
5 > # stabilize test accross variant
5 > # stabilize test accross variant
6 > revlog-compression=zlib
6 > revlog-compression=zlib
7 > EOF
7 > EOF
8
8
9
9
10 $ hg init default
10 $ hg init default
11 $ cd default
11 $ cd default
12 $ hg debugrequires
12 $ hg debugrequires | grep compression
13 dotencode
13 [1]
14 dirstate-v2 (dirstate-v2 !)
15 fncache
16 generaldelta
17 persistent-nodemap (rust !)
18 revlogv1
19 sparserevlog
20 store
21 testonly-simplestore (reposimplestore !)
22
14
23 $ touch foo
15 $ touch foo
24 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression'
16 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression'
25 $ hg debugrevlog -c | grep 0x78
17 $ hg debugrevlog -c | grep 0x78
26 0x78 (x) : 1 (100.00%)
18 0x78 (x) : 1 (100.00%)
27 0x78 (x) : 110 (100.00%)
19 0x78 (x) : 110 (100.00%)
28
20
29 $ cd ..
21 $ cd ..
30
22
31 Unknown compression engine to format.compression aborts
23 Unknown compression engine to format.compression aborts
32
24
33 $ hg --config format.revlog-compression=unknown init unknown
25 $ hg --config format.revlog-compression=unknown init unknown
34 abort: compression engines "unknown" defined by format.revlog-compression not available
26 abort: compression engines "unknown" defined by format.revlog-compression not available
35 (run "hg debuginstall" to list available compression engines)
27 (run "hg debuginstall" to list available compression engines)
36 [255]
28 [255]
37
29
38 unknown compression engine in a list with known one works fine
30 unknown compression engine in a list with known one works fine
39
31
40 $ hg --config format.revlog-compression=zlib,unknown init zlib-before-unknow
32 $ hg --config format.revlog-compression=zlib,unknown init zlib-before-unknow
41 $ hg --config format.revlog-compression=unknown,zlib init unknown-before-zlib
33 $ hg --config format.revlog-compression=unknown,zlib init unknown-before-zlib
42
34
43 A requirement specifying an unknown compression engine results in bail
35 A requirement specifying an unknown compression engine results in bail
44
36
45 $ hg init unknownrequirement
37 $ hg init unknownrequirement
46 $ cd unknownrequirement
38 $ cd unknownrequirement
47 $ echo exp-compression-unknown >> .hg/requires
39 $ echo exp-compression-unknown >> .hg/requires
48 $ hg log
40 $ hg log
49 abort: repository requires features unknown to this Mercurial: exp-compression-unknown
41 abort: repository requires features unknown to this Mercurial: exp-compression-unknown
50 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
42 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
51 [255]
43 [255]
52
44
53 $ cd ..
45 $ cd ..
54
46
55 Specifying a new format.compression on an existing repo won't introduce data
47 Specifying a new format.compression on an existing repo won't introduce data
56 with that engine or a requirement
48 with that engine or a requirement
57
49
58 $ cd default
50 $ cd default
59 $ touch bar
51 $ touch bar
60 $ hg --config format.revlog-compression=none -q commit -A -m 'add bar with a lot of repeated repeated repeated text'
52 $ hg --config format.revlog-compression=none -q commit -A -m 'add bar with a lot of repeated repeated repeated text'
61
53
62 $ hg debugrequires
54 $ hg debugrequires | grep compression
63 dotencode
55 [1]
64 dirstate-v2 (dirstate-v2 !)
65 fncache
66 generaldelta
67 persistent-nodemap (rust !)
68 revlogv1
69 sparserevlog
70 store
71 testonly-simplestore (reposimplestore !)
72
56
73 $ hg debugrevlog -c | grep 0x78
57 $ hg debugrevlog -c | grep 0x78
74 0x78 (x) : 2 (100.00%)
58 0x78 (x) : 2 (100.00%)
75 0x78 (x) : 199 (100.00%)
59 0x78 (x) : 199 (100.00%)
76 $ cd ..
60 $ cd ..
77
61
78 #if zstd
62 #if zstd
79
63
80 $ hg --config format.revlog-compression=zstd init zstd
64 $ hg --config format.revlog-compression=zstd init zstd
81 $ cd zstd
65 $ cd zstd
82 $ hg debugrequires
66 $ hg debugrequires | grep compression
83 dotencode
84 dirstate-v2 (dirstate-v2 !)
85 fncache
86 generaldelta
87 persistent-nodemap (rust !)
88 revlog-compression-zstd
67 revlog-compression-zstd
89 revlogv1
90 sparserevlog
91 store
92 testonly-simplestore (reposimplestore !)
93
68
94 $ touch foo
69 $ touch foo
95 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text'
70 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text'
96
71
97 $ hg debugrevlog -c | grep 0x28
72 $ hg debugrevlog -c | grep 0x28
98 0x28 : 1 (100.00%)
73 0x28 : 1 (100.00%)
99 0x28 : 98 (100.00%)
74 0x28 : 98 (100.00%)
100
75
101 $ cd ..
76 $ cd ..
102
77
103
78
104 #endif
79 #endif
105
80
106 checking zlib options
81 checking zlib options
107 =====================
82 =====================
108
83
109 $ hg init zlib-level-default
84 $ hg init zlib-level-default
110 $ hg init zlib-level-1
85 $ hg init zlib-level-1
111 $ cat << EOF >> zlib-level-1/.hg/hgrc
86 $ cat << EOF >> zlib-level-1/.hg/hgrc
112 > [storage]
87 > [storage]
113 > revlog.zlib.level=1
88 > revlog.zlib.level=1
114 > EOF
89 > EOF
115 $ hg init zlib-level-9
90 $ hg init zlib-level-9
116 $ cat << EOF >> zlib-level-9/.hg/hgrc
91 $ cat << EOF >> zlib-level-9/.hg/hgrc
117 > [storage]
92 > [storage]
118 > revlog.zlib.level=9
93 > revlog.zlib.level=9
119 > EOF
94 > EOF
120
95
121
96
122 $ commitone() {
97 $ commitone() {
123 > repo=$1
98 > repo=$1
124 > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a
99 > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a
125 > hg -R $repo add $repo/a
100 > hg -R $repo add $repo/a
126 > hg -R $repo commit -m some-commit
101 > hg -R $repo commit -m some-commit
127 > }
102 > }
128
103
129 $ for repo in zlib-level-default zlib-level-1 zlib-level-9; do
104 $ for repo in zlib-level-default zlib-level-1 zlib-level-9; do
130 > commitone $repo
105 > commitone $repo
131 > done
106 > done
132
107
133 $ $RUNTESTDIR/f -s */.hg/store/data/*
108 $ $RUNTESTDIR/f -s */.hg/store/data/*
134 default/.hg/store/data/bar.i: size=64
109 default/.hg/store/data/bar.i: size=64
135 default/.hg/store/data/foo.i: size=64
110 default/.hg/store/data/foo.i: size=64
136 zlib-level-1/.hg/store/data/a.i: size=4146
111 zlib-level-1/.hg/store/data/a.i: size=4146
137 zlib-level-9/.hg/store/data/a.i: size=4138
112 zlib-level-9/.hg/store/data/a.i: size=4138
138 zlib-level-default/.hg/store/data/a.i: size=4138
113 zlib-level-default/.hg/store/data/a.i: size=4138
139 zstd/.hg/store/data/foo.i: size=64 (zstd !)
114 zstd/.hg/store/data/foo.i: size=64 (zstd !)
140
115
141 Test error cases
116 Test error cases
142
117
143 $ hg init zlib-level-invalid
118 $ hg init zlib-level-invalid
144 $ cat << EOF >> zlib-level-invalid/.hg/hgrc
119 $ cat << EOF >> zlib-level-invalid/.hg/hgrc
145 > [storage]
120 > [storage]
146 > revlog.zlib.level=foobar
121 > revlog.zlib.level=foobar
147 > EOF
122 > EOF
148 $ commitone zlib-level-invalid
123 $ commitone zlib-level-invalid
149 config error: storage.revlog.zlib.level is not a valid integer ('foobar')
124 config error: storage.revlog.zlib.level is not a valid integer ('foobar')
150 config error: storage.revlog.zlib.level is not a valid integer ('foobar')
125 config error: storage.revlog.zlib.level is not a valid integer ('foobar')
151 [30]
126 [30]
152
127
153 $ hg init zlib-level-out-of-range
128 $ hg init zlib-level-out-of-range
154 $ cat << EOF >> zlib-level-out-of-range/.hg/hgrc
129 $ cat << EOF >> zlib-level-out-of-range/.hg/hgrc
155 > [storage]
130 > [storage]
156 > revlog.zlib.level=42
131 > revlog.zlib.level=42
157 > EOF
132 > EOF
158
133
159 $ commitone zlib-level-out-of-range
134 $ commitone zlib-level-out-of-range
160 abort: invalid value for `storage.revlog.zlib.level` config: 42
135 abort: invalid value for `storage.revlog.zlib.level` config: 42
161 abort: invalid value for `storage.revlog.zlib.level` config: 42
136 abort: invalid value for `storage.revlog.zlib.level` config: 42
162 [255]
137 [255]
163
138
164 checking details of none compression
139 checking details of none compression
165 ====================================
140 ====================================
166
141
167 $ hg init none-compression --config format.revlog-compression=none
142 $ hg init none-compression --config format.revlog-compression=none
168
143
169 $ commitone() {
144 $ commitone() {
170 > repo=$1
145 > repo=$1
171 > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a
146 > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a
172 > hg -R $repo add $repo/a
147 > hg -R $repo add $repo/a
173 > hg -R $repo commit -m some-commit
148 > hg -R $repo commit -m some-commit
174 > }
149 > }
175
150
176 $ commitone none-compression
151 $ commitone none-compression
177
152
178 $ hg log -R none-compression
153 $ hg log -R none-compression
179 changeset: 0:68b53da39cd8
154 changeset: 0:68b53da39cd8
180 tag: tip
155 tag: tip
181 user: test
156 user: test
182 date: Thu Jan 01 00:00:00 1970 +0000
157 date: Thu Jan 01 00:00:00 1970 +0000
183 summary: some-commit
158 summary: some-commit
184
159
185
160
186 $ hg debugrequires -R none-compression/
161 $ hg debugrequires -R none-compression/ | grep compression
187 dotencode
188 exp-compression-none
162 exp-compression-none
189 dirstate-v2 (dirstate-v2 !)
190 fncache
191 generaldelta
192 persistent-nodemap (rust !)
193 revlogv1
194 sparserevlog
195 store
196 testonly-simplestore (reposimplestore !)
197
163
198 $ $RUNTESTDIR/f -s none-compression/.hg/store/data/*
164 $ $RUNTESTDIR/f -s none-compression/.hg/store/data/*
199 none-compression/.hg/store/data/a.i: size=4216
165 none-compression/.hg/store/data/a.i: size=4216
200
166
201 #if zstd
167 #if zstd
202
168
203 checking zstd options
169 checking zstd options
204 =====================
170 =====================
205
171
206 $ hg init zstd-level-default --config format.revlog-compression=zstd
172 $ hg init zstd-level-default --config format.revlog-compression=zstd
207 $ hg init zstd-level-1 --config format.revlog-compression=zstd
173 $ hg init zstd-level-1 --config format.revlog-compression=zstd
208 $ cat << EOF >> zstd-level-1/.hg/hgrc
174 $ cat << EOF >> zstd-level-1/.hg/hgrc
209 > [storage]
175 > [storage]
210 > revlog.zstd.level=1
176 > revlog.zstd.level=1
211 > EOF
177 > EOF
212 $ hg init zstd-level-22 --config format.revlog-compression=zstd
178 $ hg init zstd-level-22 --config format.revlog-compression=zstd
213 $ cat << EOF >> zstd-level-22/.hg/hgrc
179 $ cat << EOF >> zstd-level-22/.hg/hgrc
214 > [storage]
180 > [storage]
215 > revlog.zstd.level=22
181 > revlog.zstd.level=22
216 > EOF
182 > EOF
217
183
218
184
219 $ commitone() {
185 $ commitone() {
220 > repo=$1
186 > repo=$1
221 > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a
187 > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a
222 > hg -R $repo add $repo/a
188 > hg -R $repo add $repo/a
223 > hg -R $repo commit -m some-commit
189 > hg -R $repo commit -m some-commit
224 > }
190 > }
225
191
226 $ for repo in zstd-level-default zstd-level-1 zstd-level-22; do
192 $ for repo in zstd-level-default zstd-level-1 zstd-level-22; do
227 > commitone $repo
193 > commitone $repo
228 > done
194 > done
229
195
230 $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/*
196 $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/*
231 zstd-level-1/.hg/store/data/a.i: size=4114
197 zstd-level-1/.hg/store/data/a.i: size=4114
232 zstd-level-22/.hg/store/data/a.i: size=4091
198 zstd-level-22/.hg/store/data/a.i: size=4091
233 zstd-level-default/\.hg/store/data/a\.i: size=(4094|4102) (re)
199 zstd-level-default/\.hg/store/data/a\.i: size=(4094|4102) (re)
234
200
235 Test error cases
201 Test error cases
236
202
237 $ hg init zstd-level-invalid --config format.revlog-compression=zstd
203 $ hg init zstd-level-invalid --config format.revlog-compression=zstd
238 $ cat << EOF >> zstd-level-invalid/.hg/hgrc
204 $ cat << EOF >> zstd-level-invalid/.hg/hgrc
239 > [storage]
205 > [storage]
240 > revlog.zstd.level=foobar
206 > revlog.zstd.level=foobar
241 > EOF
207 > EOF
242 $ commitone zstd-level-invalid
208 $ commitone zstd-level-invalid
243 config error: storage.revlog.zstd.level is not a valid integer ('foobar')
209 config error: storage.revlog.zstd.level is not a valid integer ('foobar')
244 config error: storage.revlog.zstd.level is not a valid integer ('foobar')
210 config error: storage.revlog.zstd.level is not a valid integer ('foobar')
245 [30]
211 [30]
246
212
247 $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd
213 $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd
248 $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc
214 $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc
249 > [storage]
215 > [storage]
250 > revlog.zstd.level=42
216 > revlog.zstd.level=42
251 > EOF
217 > EOF
252
218
253 $ commitone zstd-level-out-of-range
219 $ commitone zstd-level-out-of-range
254 abort: invalid value for `storage.revlog.zstd.level` config: 42
220 abort: invalid value for `storage.revlog.zstd.level` config: 42
255 abort: invalid value for `storage.revlog.zstd.level` config: 42
221 abort: invalid value for `storage.revlog.zstd.level` config: 42
256 [255]
222 [255]
257
223
258 #endif
224 #endif
General Comments 0
You need to be logged in to leave comments. Login now