Show More
@@ -1,195 +1,196 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 | default/.hg/store/data/foo.i: size=64 (pure !) | |
|
114 | 115 | zlib-level-1/.hg/store/data/a.i: size=4146 |
|
115 | 116 | zlib-level-9/.hg/store/data/a.i: size=4138 |
|
116 | 117 | zlib-level-default/.hg/store/data/a.i: size=4138 |
|
117 | 118 | |
|
118 | 119 | Test error cases |
|
119 | 120 | |
|
120 | 121 | $ hg init zlib-level-invalid |
|
121 | 122 | $ cat << EOF >> zlib-level-invalid/.hg/hgrc |
|
122 | 123 | > [storage] |
|
123 | 124 | > revlog.zlib.level=foobar |
|
124 | 125 | > EOF |
|
125 | 126 | $ commitone zlib-level-invalid |
|
126 | 127 | abort: storage.revlog.zlib.level is not a valid integer ('foobar') |
|
127 | 128 | abort: storage.revlog.zlib.level is not a valid integer ('foobar') |
|
128 | 129 | [255] |
|
129 | 130 | |
|
130 | 131 | $ hg init zlib-level-out-of-range |
|
131 | 132 | $ cat << EOF >> zlib-level-out-of-range/.hg/hgrc |
|
132 | 133 | > [storage] |
|
133 | 134 | > revlog.zlib.level=42 |
|
134 | 135 | > EOF |
|
135 | 136 | |
|
136 | 137 | $ commitone zlib-level-out-of-range |
|
137 | 138 | abort: invalid value for `storage.revlog.zlib.level` config: 42 |
|
138 | 139 | abort: invalid value for `storage.revlog.zlib.level` config: 42 |
|
139 | 140 | [255] |
|
140 | 141 | |
|
141 | 142 | checking zstd options |
|
142 | 143 | ===================== |
|
143 | 144 | |
|
144 | 145 | $ hg init zstd-level-default --config format.revlog-compression=zstd |
|
145 | 146 | $ hg init zstd-level-1 --config format.revlog-compression=zstd |
|
146 | 147 | $ cat << EOF >> zstd-level-1/.hg/hgrc |
|
147 | 148 | > [storage] |
|
148 | 149 | > revlog.zstd.level=1 |
|
149 | 150 | > EOF |
|
150 | 151 | $ hg init zstd-level-22 --config format.revlog-compression=zstd |
|
151 | 152 | $ cat << EOF >> zstd-level-22/.hg/hgrc |
|
152 | 153 | > [storage] |
|
153 | 154 | > revlog.zstd.level=22 |
|
154 | 155 | > EOF |
|
155 | 156 | |
|
156 | 157 | |
|
157 | 158 | $ commitone() { |
|
158 | 159 | > repo=$1 |
|
159 | 160 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a |
|
160 | 161 | > hg -R $repo add $repo/a |
|
161 | 162 | > hg -R $repo commit -m some-commit |
|
162 | 163 | > } |
|
163 | 164 | |
|
164 | 165 | $ for repo in zstd-level-default zstd-level-1 zstd-level-22; do |
|
165 | 166 | > commitone $repo |
|
166 | 167 | > done |
|
167 | 168 | |
|
168 | 169 | $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/* |
|
169 | 170 | zstd-level-1/.hg/store/data/a.i: size=4097 |
|
170 | 171 | zstd-level-22/.hg/store/data/a.i: size=4091 |
|
171 | 172 | zstd-level-default/.hg/store/data/a.i: size=4094 |
|
172 | 173 | |
|
173 | 174 | Test error cases |
|
174 | 175 | |
|
175 | 176 | $ hg init zstd-level-invalid --config format.revlog-compression=zstd |
|
176 | 177 | $ cat << EOF >> zstd-level-invalid/.hg/hgrc |
|
177 | 178 | > [storage] |
|
178 | 179 | > revlog.zstd.level=foobar |
|
179 | 180 | > EOF |
|
180 | 181 | $ commitone zstd-level-invalid |
|
181 | 182 | abort: storage.revlog.zstd.level is not a valid integer ('foobar') |
|
182 | 183 | abort: storage.revlog.zstd.level is not a valid integer ('foobar') |
|
183 | 184 | [255] |
|
184 | 185 | |
|
185 | 186 | $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd |
|
186 | 187 | $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc |
|
187 | 188 | > [storage] |
|
188 | 189 | > revlog.zstd.level=42 |
|
189 | 190 | > EOF |
|
190 | 191 | |
|
191 | 192 | $ commitone zstd-level-out-of-range |
|
192 | 193 | abort: invalid value for `storage.revlog.zstd.level` config: 42 |
|
193 | 194 | abort: invalid value for `storage.revlog.zstd.level` config: 42 |
|
194 | 195 | [255] |
|
195 | 196 |
General Comments 0
You need to be logged in to leave comments.
Login now