Show More
@@ -1,195 +1,196 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 | $ hg init default |
|
3 | $ hg init default | |
4 | $ cd default |
|
4 | $ cd default | |
5 | $ cat .hg/requires |
|
5 | $ cat .hg/requires | |
6 | dotencode |
|
6 | dotencode | |
7 | fncache |
|
7 | fncache | |
8 | generaldelta |
|
8 | generaldelta | |
9 | revlogv1 |
|
9 | revlogv1 | |
10 | sparserevlog |
|
10 | sparserevlog | |
11 | store |
|
11 | store | |
12 | testonly-simplestore (reposimplestore !) |
|
12 | testonly-simplestore (reposimplestore !) | |
13 |
|
13 | |||
14 | $ touch foo |
|
14 | $ touch foo | |
15 | $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression' |
|
15 | $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression' | |
16 | $ hg debugrevlog -c | grep 0x78 |
|
16 | $ hg debugrevlog -c | grep 0x78 | |
17 | 0x78 (x) : 1 (100.00%) |
|
17 | 0x78 (x) : 1 (100.00%) | |
18 | 0x78 (x) : 110 (100.00%) |
|
18 | 0x78 (x) : 110 (100.00%) | |
19 |
|
19 | |||
20 | $ cd .. |
|
20 | $ cd .. | |
21 |
|
21 | |||
22 | Unknown compression engine to format.compression aborts |
|
22 | Unknown compression engine to format.compression aborts | |
23 |
|
23 | |||
24 | $ hg --config format.revlog-compression=unknown init unknown |
|
24 | $ hg --config format.revlog-compression=unknown init unknown | |
25 | abort: compression engine unknown defined by format.revlog-compression not available |
|
25 | abort: compression engine unknown defined by format.revlog-compression not available | |
26 | (run "hg debuginstall" to list available compression engines) |
|
26 | (run "hg debuginstall" to list available compression engines) | |
27 | [255] |
|
27 | [255] | |
28 |
|
28 | |||
29 | A requirement specifying an unknown compression engine results in bail |
|
29 | A requirement specifying an unknown compression engine results in bail | |
30 |
|
30 | |||
31 | $ hg init unknownrequirement |
|
31 | $ hg init unknownrequirement | |
32 | $ cd unknownrequirement |
|
32 | $ cd unknownrequirement | |
33 | $ echo exp-compression-unknown >> .hg/requires |
|
33 | $ echo exp-compression-unknown >> .hg/requires | |
34 | $ hg log |
|
34 | $ hg log | |
35 | abort: repository requires features unknown to this Mercurial: exp-compression-unknown! |
|
35 | abort: repository requires features unknown to this Mercurial: exp-compression-unknown! | |
36 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
36 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
37 | [255] |
|
37 | [255] | |
38 |
|
38 | |||
39 | $ cd .. |
|
39 | $ cd .. | |
40 |
|
40 | |||
41 | #if zstd |
|
41 | #if zstd | |
42 |
|
42 | |||
43 | $ hg --config format.revlog-compression=zstd init zstd |
|
43 | $ hg --config format.revlog-compression=zstd init zstd | |
44 | $ cd zstd |
|
44 | $ cd zstd | |
45 | $ cat .hg/requires |
|
45 | $ cat .hg/requires | |
46 | dotencode |
|
46 | dotencode | |
47 | fncache |
|
47 | fncache | |
48 | generaldelta |
|
48 | generaldelta | |
49 | revlog-compression-zstd |
|
49 | revlog-compression-zstd | |
50 | revlogv1 |
|
50 | revlogv1 | |
51 | sparserevlog |
|
51 | sparserevlog | |
52 | store |
|
52 | store | |
53 | testonly-simplestore (reposimplestore !) |
|
53 | testonly-simplestore (reposimplestore !) | |
54 |
|
54 | |||
55 | $ touch foo |
|
55 | $ touch foo | |
56 | $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text' |
|
56 | $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text' | |
57 |
|
57 | |||
58 | $ hg debugrevlog -c | grep 0x28 |
|
58 | $ hg debugrevlog -c | grep 0x28 | |
59 | 0x28 : 1 (100.00%) |
|
59 | 0x28 : 1 (100.00%) | |
60 | 0x28 : 98 (100.00%) |
|
60 | 0x28 : 98 (100.00%) | |
61 |
|
61 | |||
62 | $ cd .. |
|
62 | $ cd .. | |
63 |
|
63 | |||
64 | Specifying a new format.compression on an existing repo won't introduce data |
|
64 | Specifying a new format.compression on an existing repo won't introduce data | |
65 | with that engine or a requirement |
|
65 | with that engine or a requirement | |
66 |
|
66 | |||
67 | $ cd default |
|
67 | $ cd default | |
68 | $ touch bar |
|
68 | $ touch bar | |
69 | $ hg --config format.revlog-compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text' |
|
69 | $ hg --config format.revlog-compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text' | |
70 |
|
70 | |||
71 | $ cat .hg/requires |
|
71 | $ cat .hg/requires | |
72 | dotencode |
|
72 | dotencode | |
73 | fncache |
|
73 | fncache | |
74 | generaldelta |
|
74 | generaldelta | |
75 | revlogv1 |
|
75 | revlogv1 | |
76 | sparserevlog |
|
76 | sparserevlog | |
77 | store |
|
77 | store | |
78 | testonly-simplestore (reposimplestore !) |
|
78 | testonly-simplestore (reposimplestore !) | |
79 |
|
79 | |||
80 | $ hg debugrevlog -c | grep 0x78 |
|
80 | $ hg debugrevlog -c | grep 0x78 | |
81 | 0x78 (x) : 2 (100.00%) |
|
81 | 0x78 (x) : 2 (100.00%) | |
82 | 0x78 (x) : 199 (100.00%) |
|
82 | 0x78 (x) : 199 (100.00%) | |
83 |
|
83 | |||
84 | #endif |
|
84 | #endif | |
85 |
|
85 | |||
86 | checking zlib options |
|
86 | checking zlib options | |
87 | ===================== |
|
87 | ===================== | |
88 |
|
88 | |||
89 | $ hg init zlib-level-default |
|
89 | $ hg init zlib-level-default | |
90 | $ hg init zlib-level-1 |
|
90 | $ hg init zlib-level-1 | |
91 | $ cat << EOF >> zlib-level-1/.hg/hgrc |
|
91 | $ cat << EOF >> zlib-level-1/.hg/hgrc | |
92 | > [storage] |
|
92 | > [storage] | |
93 | > revlog.zlib.level=1 |
|
93 | > revlog.zlib.level=1 | |
94 | > EOF |
|
94 | > EOF | |
95 | $ hg init zlib-level-9 |
|
95 | $ hg init zlib-level-9 | |
96 | $ cat << EOF >> zlib-level-9/.hg/hgrc |
|
96 | $ cat << EOF >> zlib-level-9/.hg/hgrc | |
97 | > [storage] |
|
97 | > [storage] | |
98 | > revlog.zlib.level=9 |
|
98 | > revlog.zlib.level=9 | |
99 | > EOF |
|
99 | > EOF | |
100 |
|
100 | |||
101 |
|
101 | |||
102 | $ commitone() { |
|
102 | $ commitone() { | |
103 | > repo=$1 |
|
103 | > repo=$1 | |
104 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a |
|
104 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a | |
105 | > hg -R $repo add $repo/a |
|
105 | > hg -R $repo add $repo/a | |
106 | > hg -R $repo commit -m some-commit |
|
106 | > hg -R $repo commit -m some-commit | |
107 | > } |
|
107 | > } | |
108 |
|
108 | |||
109 | $ for repo in zlib-level-default zlib-level-1 zlib-level-9; do |
|
109 | $ for repo in zlib-level-default zlib-level-1 zlib-level-9; do | |
110 | > commitone $repo |
|
110 | > commitone $repo | |
111 | > done |
|
111 | > done | |
112 |
|
112 | |||
113 | $ $RUNTESTDIR/f -s */.hg/store/data/* |
|
113 | $ $RUNTESTDIR/f -s */.hg/store/data/* | |
|
114 | default/.hg/store/data/foo.i: size=64 (pure !) | |||
114 | zlib-level-1/.hg/store/data/a.i: size=4146 |
|
115 | zlib-level-1/.hg/store/data/a.i: size=4146 | |
115 | zlib-level-9/.hg/store/data/a.i: size=4138 |
|
116 | zlib-level-9/.hg/store/data/a.i: size=4138 | |
116 | zlib-level-default/.hg/store/data/a.i: size=4138 |
|
117 | zlib-level-default/.hg/store/data/a.i: size=4138 | |
117 |
|
118 | |||
118 | Test error cases |
|
119 | Test error cases | |
119 |
|
120 | |||
120 | $ hg init zlib-level-invalid |
|
121 | $ hg init zlib-level-invalid | |
121 | $ cat << EOF >> zlib-level-invalid/.hg/hgrc |
|
122 | $ cat << EOF >> zlib-level-invalid/.hg/hgrc | |
122 | > [storage] |
|
123 | > [storage] | |
123 | > revlog.zlib.level=foobar |
|
124 | > revlog.zlib.level=foobar | |
124 | > EOF |
|
125 | > EOF | |
125 | $ commitone zlib-level-invalid |
|
126 | $ commitone zlib-level-invalid | |
126 | abort: storage.revlog.zlib.level is not a valid integer ('foobar') |
|
127 | abort: storage.revlog.zlib.level is not a valid integer ('foobar') | |
127 | abort: storage.revlog.zlib.level is not a valid integer ('foobar') |
|
128 | abort: storage.revlog.zlib.level is not a valid integer ('foobar') | |
128 | [255] |
|
129 | [255] | |
129 |
|
130 | |||
130 | $ hg init zlib-level-out-of-range |
|
131 | $ hg init zlib-level-out-of-range | |
131 | $ cat << EOF >> zlib-level-out-of-range/.hg/hgrc |
|
132 | $ cat << EOF >> zlib-level-out-of-range/.hg/hgrc | |
132 | > [storage] |
|
133 | > [storage] | |
133 | > revlog.zlib.level=42 |
|
134 | > revlog.zlib.level=42 | |
134 | > EOF |
|
135 | > EOF | |
135 |
|
136 | |||
136 | $ commitone zlib-level-out-of-range |
|
137 | $ commitone zlib-level-out-of-range | |
137 | abort: invalid value for `storage.revlog.zlib.level` config: 42 |
|
138 | abort: invalid value for `storage.revlog.zlib.level` config: 42 | |
138 | abort: invalid value for `storage.revlog.zlib.level` config: 42 |
|
139 | abort: invalid value for `storage.revlog.zlib.level` config: 42 | |
139 | [255] |
|
140 | [255] | |
140 |
|
141 | |||
141 | checking zstd options |
|
142 | checking zstd options | |
142 | ===================== |
|
143 | ===================== | |
143 |
|
144 | |||
144 | $ hg init zstd-level-default --config format.revlog-compression=zstd |
|
145 | $ hg init zstd-level-default --config format.revlog-compression=zstd | |
145 | $ hg init zstd-level-1 --config format.revlog-compression=zstd |
|
146 | $ hg init zstd-level-1 --config format.revlog-compression=zstd | |
146 | $ cat << EOF >> zstd-level-1/.hg/hgrc |
|
147 | $ cat << EOF >> zstd-level-1/.hg/hgrc | |
147 | > [storage] |
|
148 | > [storage] | |
148 | > revlog.zstd.level=1 |
|
149 | > revlog.zstd.level=1 | |
149 | > EOF |
|
150 | > EOF | |
150 | $ hg init zstd-level-22 --config format.revlog-compression=zstd |
|
151 | $ hg init zstd-level-22 --config format.revlog-compression=zstd | |
151 | $ cat << EOF >> zstd-level-22/.hg/hgrc |
|
152 | $ cat << EOF >> zstd-level-22/.hg/hgrc | |
152 | > [storage] |
|
153 | > [storage] | |
153 | > revlog.zstd.level=22 |
|
154 | > revlog.zstd.level=22 | |
154 | > EOF |
|
155 | > EOF | |
155 |
|
156 | |||
156 |
|
157 | |||
157 | $ commitone() { |
|
158 | $ commitone() { | |
158 | > repo=$1 |
|
159 | > repo=$1 | |
159 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a |
|
160 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a | |
160 | > hg -R $repo add $repo/a |
|
161 | > hg -R $repo add $repo/a | |
161 | > hg -R $repo commit -m some-commit |
|
162 | > hg -R $repo commit -m some-commit | |
162 | > } |
|
163 | > } | |
163 |
|
164 | |||
164 | $ for repo in zstd-level-default zstd-level-1 zstd-level-22; do |
|
165 | $ for repo in zstd-level-default zstd-level-1 zstd-level-22; do | |
165 | > commitone $repo |
|
166 | > commitone $repo | |
166 | > done |
|
167 | > done | |
167 |
|
168 | |||
168 | $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/* |
|
169 | $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/* | |
169 | zstd-level-1/.hg/store/data/a.i: size=4097 |
|
170 | zstd-level-1/.hg/store/data/a.i: size=4097 | |
170 | zstd-level-22/.hg/store/data/a.i: size=4091 |
|
171 | zstd-level-22/.hg/store/data/a.i: size=4091 | |
171 | zstd-level-default/.hg/store/data/a.i: size=4094 |
|
172 | zstd-level-default/.hg/store/data/a.i: size=4094 | |
172 |
|
173 | |||
173 | Test error cases |
|
174 | Test error cases | |
174 |
|
175 | |||
175 | $ hg init zstd-level-invalid --config format.revlog-compression=zstd |
|
176 | $ hg init zstd-level-invalid --config format.revlog-compression=zstd | |
176 | $ cat << EOF >> zstd-level-invalid/.hg/hgrc |
|
177 | $ cat << EOF >> zstd-level-invalid/.hg/hgrc | |
177 | > [storage] |
|
178 | > [storage] | |
178 | > revlog.zstd.level=foobar |
|
179 | > revlog.zstd.level=foobar | |
179 | > EOF |
|
180 | > EOF | |
180 | $ commitone zstd-level-invalid |
|
181 | $ commitone zstd-level-invalid | |
181 | abort: storage.revlog.zstd.level is not a valid integer ('foobar') |
|
182 | abort: storage.revlog.zstd.level is not a valid integer ('foobar') | |
182 | abort: storage.revlog.zstd.level is not a valid integer ('foobar') |
|
183 | abort: storage.revlog.zstd.level is not a valid integer ('foobar') | |
183 | [255] |
|
184 | [255] | |
184 |
|
185 | |||
185 | $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd |
|
186 | $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd | |
186 | $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc |
|
187 | $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc | |
187 | > [storage] |
|
188 | > [storage] | |
188 | > revlog.zstd.level=42 |
|
189 | > revlog.zstd.level=42 | |
189 | > EOF |
|
190 | > EOF | |
190 |
|
191 | |||
191 | $ commitone zstd-level-out-of-range |
|
192 | $ commitone zstd-level-out-of-range | |
192 | abort: invalid value for `storage.revlog.zstd.level` config: 42 |
|
193 | abort: invalid value for `storage.revlog.zstd.level` config: 42 | |
193 | abort: invalid value for `storage.revlog.zstd.level` config: 42 |
|
194 | abort: invalid value for `storage.revlog.zstd.level` config: 42 | |
194 | [255] |
|
195 | [255] | |
195 |
|
196 |
General Comments 0
You need to be logged in to leave comments.
Login now