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