##// END OF EJS Templates
tests: improve portability by no longer using the flag [tar --force-local]...
Arseniy Alekseyev -
r50353:b10e4c19 stable
parent child Browse files
Show More
@@ -1,632 +1,611 b''
1 ===============================================================
1 ===============================================================
2 Test non-regression on the corruption associated with issue6528
2 Test non-regression on the corruption associated with issue6528
3 ===============================================================
3 ===============================================================
4
4
5 Setup
5 Setup
6 =====
6 =====
7
7
8 $ hg init base-repo
8 $ hg init base-repo
9 $ cd base-repo
9 $ cd base-repo
10
10
11 $ cat <<EOF > a.txt
11 $ cat <<EOF > a.txt
12 > 1
12 > 1
13 > 2
13 > 2
14 > 3
14 > 3
15 > 4
15 > 4
16 > 5
16 > 5
17 > 6
17 > 6
18 > EOF
18 > EOF
19
19
20 $ hg add a.txt
20 $ hg add a.txt
21 $ hg commit -m 'c_base_c - create a.txt'
21 $ hg commit -m 'c_base_c - create a.txt'
22
22
23 Modify a.txt
23 Modify a.txt
24
24
25 $ sed -e 's/1/foo/' a.txt > a.tmp; mv a.tmp a.txt
25 $ sed -e 's/1/foo/' a.txt > a.tmp; mv a.tmp a.txt
26 $ hg commit -m 'c_modify_c - modify a.txt'
26 $ hg commit -m 'c_modify_c - modify a.txt'
27
27
28 Modify and rename a.txt to b.txt
28 Modify and rename a.txt to b.txt
29
29
30 $ hg up -r "desc('c_base_c')"
30 $ hg up -r "desc('c_base_c')"
31 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 $ sed -e 's/6/bar/' a.txt > a.tmp; mv a.tmp a.txt
32 $ sed -e 's/6/bar/' a.txt > a.tmp; mv a.tmp a.txt
33 $ hg mv a.txt b.txt
33 $ hg mv a.txt b.txt
34 $ hg commit -m 'c_rename_c - rename and modify a.txt to b.txt'
34 $ hg commit -m 'c_rename_c - rename and modify a.txt to b.txt'
35 created new head
35 created new head
36
36
37 Merge each branch
37 Merge each branch
38
38
39 $ hg merge -r "desc('c_modify_c')"
39 $ hg merge -r "desc('c_modify_c')"
40 merging b.txt and a.txt to b.txt
40 merging b.txt and a.txt to b.txt
41 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
41 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
42 (branch merge, don't forget to commit)
42 (branch merge, don't forget to commit)
43 $ hg commit -m 'c_merge_c: commit merge'
43 $ hg commit -m 'c_merge_c: commit merge'
44
44
45 $ hg debugrevlogindex b.txt
45 $ hg debugrevlogindex b.txt
46 rev linkrev nodeid p1 p2
46 rev linkrev nodeid p1 p2
47 0 2 05b806ebe5ea 000000000000 000000000000
47 0 2 05b806ebe5ea 000000000000 000000000000
48 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
48 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
49
49
50 Check commit Graph
50 Check commit Graph
51
51
52 $ hg log -G
52 $ hg log -G
53 @ changeset: 3:a1cc2bdca0aa
53 @ changeset: 3:a1cc2bdca0aa
54 |\ tag: tip
54 |\ tag: tip
55 | | parent: 2:615c6ccefd15
55 | | parent: 2:615c6ccefd15
56 | | parent: 1:373d507f4667
56 | | parent: 1:373d507f4667
57 | | user: test
57 | | user: test
58 | | date: Thu Jan 01 00:00:00 1970 +0000
58 | | date: Thu Jan 01 00:00:00 1970 +0000
59 | | summary: c_merge_c: commit merge
59 | | summary: c_merge_c: commit merge
60 | |
60 | |
61 | o changeset: 2:615c6ccefd15
61 | o changeset: 2:615c6ccefd15
62 | | parent: 0:f5a5a568022f
62 | | parent: 0:f5a5a568022f
63 | | user: test
63 | | user: test
64 | | date: Thu Jan 01 00:00:00 1970 +0000
64 | | date: Thu Jan 01 00:00:00 1970 +0000
65 | | summary: c_rename_c - rename and modify a.txt to b.txt
65 | | summary: c_rename_c - rename and modify a.txt to b.txt
66 | |
66 | |
67 o | changeset: 1:373d507f4667
67 o | changeset: 1:373d507f4667
68 |/ user: test
68 |/ user: test
69 | date: Thu Jan 01 00:00:00 1970 +0000
69 | date: Thu Jan 01 00:00:00 1970 +0000
70 | summary: c_modify_c - modify a.txt
70 | summary: c_modify_c - modify a.txt
71 |
71 |
72 o changeset: 0:f5a5a568022f
72 o changeset: 0:f5a5a568022f
73 user: test
73 user: test
74 date: Thu Jan 01 00:00:00 1970 +0000
74 date: Thu Jan 01 00:00:00 1970 +0000
75 summary: c_base_c - create a.txt
75 summary: c_base_c - create a.txt
76
76
77
77
78 $ hg cat -r . b.txt
78 $ hg cat -r . b.txt
79 foo
79 foo
80 2
80 2
81 3
81 3
82 4
82 4
83 5
83 5
84 bar
84 bar
85 $ cat b.txt
85 $ cat b.txt
86 foo
86 foo
87 2
87 2
88 3
88 3
89 4
89 4
90 5
90 5
91 bar
91 bar
92 $ cd ..
92 $ cd ..
93
93
94
94
95 Check the lack of corruption
95 Check the lack of corruption
96 ============================
96 ============================
97
97
98 $ hg clone --pull base-repo cloned
98 $ hg clone --pull base-repo cloned
99 requesting all changes
99 requesting all changes
100 adding changesets
100 adding changesets
101 adding manifests
101 adding manifests
102 adding file changes
102 adding file changes
103 added 4 changesets with 4 changes to 2 files
103 added 4 changesets with 4 changes to 2 files
104 new changesets f5a5a568022f:a1cc2bdca0aa
104 new changesets f5a5a568022f:a1cc2bdca0aa
105 updating to branch default
105 updating to branch default
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 $ cd cloned
107 $ cd cloned
108 $ hg up -r "desc('c_merge_c')"
108 $ hg up -r "desc('c_merge_c')"
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
110
110
111
111
112 Status is buggy, even with debugrebuilddirstate
112 Status is buggy, even with debugrebuilddirstate
113
113
114 $ hg cat -r . b.txt
114 $ hg cat -r . b.txt
115 foo
115 foo
116 2
116 2
117 3
117 3
118 4
118 4
119 5
119 5
120 bar
120 bar
121 $ cat b.txt
121 $ cat b.txt
122 foo
122 foo
123 2
123 2
124 3
124 3
125 4
125 4
126 5
126 5
127 bar
127 bar
128 $ hg status
128 $ hg status
129 $ hg debugrebuilddirstate
129 $ hg debugrebuilddirstate
130 $ hg status
130 $ hg status
131
131
132 the history was altered
132 the history was altered
133
133
134 in theory p1/p2 order does not matter but in practice p1 == nullid is used as a
134 in theory p1/p2 order does not matter but in practice p1 == nullid is used as a
135 marker that some metadata are present and should be fetched.
135 marker that some metadata are present and should be fetched.
136
136
137 $ hg debugrevlogindex b.txt
137 $ hg debugrevlogindex b.txt
138 rev linkrev nodeid p1 p2
138 rev linkrev nodeid p1 p2
139 0 2 05b806ebe5ea 000000000000 000000000000
139 0 2 05b806ebe5ea 000000000000 000000000000
140 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
140 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
141
141
142 Check commit Graph
142 Check commit Graph
143
143
144 $ hg log -G
144 $ hg log -G
145 @ changeset: 3:a1cc2bdca0aa
145 @ changeset: 3:a1cc2bdca0aa
146 |\ tag: tip
146 |\ tag: tip
147 | | parent: 2:615c6ccefd15
147 | | parent: 2:615c6ccefd15
148 | | parent: 1:373d507f4667
148 | | parent: 1:373d507f4667
149 | | user: test
149 | | user: test
150 | | date: Thu Jan 01 00:00:00 1970 +0000
150 | | date: Thu Jan 01 00:00:00 1970 +0000
151 | | summary: c_merge_c: commit merge
151 | | summary: c_merge_c: commit merge
152 | |
152 | |
153 | o changeset: 2:615c6ccefd15
153 | o changeset: 2:615c6ccefd15
154 | | parent: 0:f5a5a568022f
154 | | parent: 0:f5a5a568022f
155 | | user: test
155 | | user: test
156 | | date: Thu Jan 01 00:00:00 1970 +0000
156 | | date: Thu Jan 01 00:00:00 1970 +0000
157 | | summary: c_rename_c - rename and modify a.txt to b.txt
157 | | summary: c_rename_c - rename and modify a.txt to b.txt
158 | |
158 | |
159 o | changeset: 1:373d507f4667
159 o | changeset: 1:373d507f4667
160 |/ user: test
160 |/ user: test
161 | date: Thu Jan 01 00:00:00 1970 +0000
161 | date: Thu Jan 01 00:00:00 1970 +0000
162 | summary: c_modify_c - modify a.txt
162 | summary: c_modify_c - modify a.txt
163 |
163 |
164 o changeset: 0:f5a5a568022f
164 o changeset: 0:f5a5a568022f
165 user: test
165 user: test
166 date: Thu Jan 01 00:00:00 1970 +0000
166 date: Thu Jan 01 00:00:00 1970 +0000
167 summary: c_base_c - create a.txt
167 summary: c_base_c - create a.txt
168
168
169
169
170 Test the command that fixes the issue
170 Test the command that fixes the issue
171 =====================================
171 =====================================
172
172
173 Restore a broken repository with multiple broken revisions and a filename that
173 Restore a broken repository with multiple broken revisions and a filename that
174 would get encoded to test the `report` options.
174 would get encoded to test the `report` options.
175 It's a tarball because unbundle might magically fix the issue later.
175 It's a tarball because unbundle might magically fix the issue later.
176
176
177 $ cd ..
177 $ cd ..
178 $ mkdir repo-to-fix
178 $ mkdir repo-to-fix
179 $ cd repo-to-fix
179 $ cd repo-to-fix
180 #if windows
180 $ tar -x < $TESTDIR/bundles/issue6528.tar
181 tar interprets `:` in paths (like `C:`) as being remote, force local on Windows
182 only since some versions of tar don't have this flag.
183
184 $ tar --force-local -xf $TESTDIR/bundles/issue6528.tar
185 #else
186 $ tar xf $TESTDIR/bundles/issue6528.tar
187 #endif
188
181
189 Check that the issue is present
182 Check that the issue is present
190 (It is currently not present with rhg but will be when optimizations are added
183 (It is currently not present with rhg but will be when optimizations are added
191 to resolve ambiguous files at the end of status without reading their content
184 to resolve ambiguous files at the end of status without reading their content
192 if the size differs, and reading the expected size without resolving filelog
185 if the size differs, and reading the expected size without resolving filelog
193 deltas where possible.)
186 deltas where possible.)
194
187
195 $ hg st
188 $ hg st
196 M D.txt
189 M D.txt
197 M b.txt
190 M b.txt
198 $ hg debugrevlogindex b.txt
191 $ hg debugrevlogindex b.txt
199 rev linkrev nodeid p1 p2
192 rev linkrev nodeid p1 p2
200 0 2 05b806ebe5ea 000000000000 000000000000
193 0 2 05b806ebe5ea 000000000000 000000000000
201 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
194 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
202 2 6 216a5fe8b8ed 000000000000 000000000000
195 2 6 216a5fe8b8ed 000000000000 000000000000
203 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
196 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
204 $ hg debugrevlogindex D.txt
197 $ hg debugrevlogindex D.txt
205 rev linkrev nodeid p1 p2
198 rev linkrev nodeid p1 p2
206 0 6 2a8d3833f2fb 000000000000 000000000000
199 0 6 2a8d3833f2fb 000000000000 000000000000
207 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
200 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
208
201
209 Dry-run the fix
202 Dry-run the fix
210 $ hg debug-repair-issue6528 --dry-run
203 $ hg debug-repair-issue6528 --dry-run
211 found affected revision 1 for filelog 'data/D.txt.i'
204 found affected revision 1 for filelog 'data/D.txt.i'
212 found affected revision 1 for filelog 'data/b.txt.i'
205 found affected revision 1 for filelog 'data/b.txt.i'
213 found affected revision 3 for filelog 'data/b.txt.i'
206 found affected revision 3 for filelog 'data/b.txt.i'
214 $ hg st
207 $ hg st
215 M D.txt
208 M D.txt
216 M b.txt
209 M b.txt
217 $ hg debugrevlogindex b.txt
210 $ hg debugrevlogindex b.txt
218 rev linkrev nodeid p1 p2
211 rev linkrev nodeid p1 p2
219 0 2 05b806ebe5ea 000000000000 000000000000
212 0 2 05b806ebe5ea 000000000000 000000000000
220 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
213 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
221 2 6 216a5fe8b8ed 000000000000 000000000000
214 2 6 216a5fe8b8ed 000000000000 000000000000
222 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
215 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
223 $ hg debugrevlogindex D.txt
216 $ hg debugrevlogindex D.txt
224 rev linkrev nodeid p1 p2
217 rev linkrev nodeid p1 p2
225 0 6 2a8d3833f2fb 000000000000 000000000000
218 0 6 2a8d3833f2fb 000000000000 000000000000
226 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
219 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
227
220
228 Test the --paranoid option
221 Test the --paranoid option
229 $ hg debug-repair-issue6528 --dry-run --paranoid
222 $ hg debug-repair-issue6528 --dry-run --paranoid
230 found affected revision 1 for filelog 'data/D.txt.i'
223 found affected revision 1 for filelog 'data/D.txt.i'
231 found affected revision 1 for filelog 'data/b.txt.i'
224 found affected revision 1 for filelog 'data/b.txt.i'
232 found affected revision 3 for filelog 'data/b.txt.i'
225 found affected revision 3 for filelog 'data/b.txt.i'
233 $ hg st
226 $ hg st
234 M D.txt
227 M D.txt
235 M b.txt
228 M b.txt
236 $ hg debugrevlogindex b.txt
229 $ hg debugrevlogindex b.txt
237 rev linkrev nodeid p1 p2
230 rev linkrev nodeid p1 p2
238 0 2 05b806ebe5ea 000000000000 000000000000
231 0 2 05b806ebe5ea 000000000000 000000000000
239 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
232 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
240 2 6 216a5fe8b8ed 000000000000 000000000000
233 2 6 216a5fe8b8ed 000000000000 000000000000
241 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
234 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
242 $ hg debugrevlogindex D.txt
235 $ hg debugrevlogindex D.txt
243 rev linkrev nodeid p1 p2
236 rev linkrev nodeid p1 p2
244 0 6 2a8d3833f2fb 000000000000 000000000000
237 0 6 2a8d3833f2fb 000000000000 000000000000
245 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
238 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
246
239
247 Run the fix
240 Run the fix
248 $ hg debug-repair-issue6528
241 $ hg debug-repair-issue6528
249 found affected revision 1 for filelog 'data/D.txt.i'
242 found affected revision 1 for filelog 'data/D.txt.i'
250 repaired revision 1 of 'filelog data/D.txt.i'
243 repaired revision 1 of 'filelog data/D.txt.i'
251 found affected revision 1 for filelog 'data/b.txt.i'
244 found affected revision 1 for filelog 'data/b.txt.i'
252 found affected revision 3 for filelog 'data/b.txt.i'
245 found affected revision 3 for filelog 'data/b.txt.i'
253 repaired revision 1 of 'filelog data/b.txt.i'
246 repaired revision 1 of 'filelog data/b.txt.i'
254 repaired revision 3 of 'filelog data/b.txt.i'
247 repaired revision 3 of 'filelog data/b.txt.i'
255
248
256 Check that the fix worked and that running it twice does nothing
249 Check that the fix worked and that running it twice does nothing
257 $ hg st
250 $ hg st
258 $ hg debugrevlogindex b.txt
251 $ hg debugrevlogindex b.txt
259 rev linkrev nodeid p1 p2
252 rev linkrev nodeid p1 p2
260 0 2 05b806ebe5ea 000000000000 000000000000
253 0 2 05b806ebe5ea 000000000000 000000000000
261 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
254 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
262 2 6 216a5fe8b8ed 000000000000 000000000000
255 2 6 216a5fe8b8ed 000000000000 000000000000
263 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
256 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
264 $ hg debugrevlogindex D.txt
257 $ hg debugrevlogindex D.txt
265 rev linkrev nodeid p1 p2
258 rev linkrev nodeid p1 p2
266 0 6 2a8d3833f2fb 000000000000 000000000000
259 0 6 2a8d3833f2fb 000000000000 000000000000
267 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
260 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
268 $ hg debug-repair-issue6528
261 $ hg debug-repair-issue6528
269 no affected revisions were found
262 no affected revisions were found
270 $ hg st
263 $ hg st
271 $ hg debugrevlogindex b.txt
264 $ hg debugrevlogindex b.txt
272 rev linkrev nodeid p1 p2
265 rev linkrev nodeid p1 p2
273 0 2 05b806ebe5ea 000000000000 000000000000
266 0 2 05b806ebe5ea 000000000000 000000000000
274 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
267 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
275 2 6 216a5fe8b8ed 000000000000 000000000000
268 2 6 216a5fe8b8ed 000000000000 000000000000
276 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
269 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
277 $ hg debugrevlogindex D.txt
270 $ hg debugrevlogindex D.txt
278 rev linkrev nodeid p1 p2
271 rev linkrev nodeid p1 p2
279 0 6 2a8d3833f2fb 000000000000 000000000000
272 0 6 2a8d3833f2fb 000000000000 000000000000
280 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
273 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
281
274
282 Try the using the report options
275 Try the using the report options
283 --------------------------------
276 --------------------------------
284
277
285 $ cd ..
278 $ cd ..
286 $ mkdir repo-to-fix-report
279 $ mkdir repo-to-fix-report
287 $ cd repo-to-fix
280 $ cd repo-to-fix
288 #if windows
281 $ tar -x < "$TESTDIR"/bundles/issue6528.tar
289 tar interprets `:` in paths (like `C:`) as being remote, force local on Windows
290 only since some versions of tar don't have this flag.
291
292 $ tar --force-local -xf $TESTDIR/bundles/issue6528.tar
293 #else
294 $ tar xf $TESTDIR/bundles/issue6528.tar
295 #endif
296
282
297 $ hg debug-repair-issue6528 --to-report $TESTTMP/report.txt
283 $ hg debug-repair-issue6528 --to-report $TESTTMP/report.txt
298 found affected revision 1 for filelog 'data/D.txt.i'
284 found affected revision 1 for filelog 'data/D.txt.i'
299 found affected revision 1 for filelog 'data/b.txt.i'
285 found affected revision 1 for filelog 'data/b.txt.i'
300 found affected revision 3 for filelog 'data/b.txt.i'
286 found affected revision 3 for filelog 'data/b.txt.i'
301 $ cat $TESTTMP/report.txt
287 $ cat $TESTTMP/report.txt
302 2a80419dfc31d7dfb308ac40f3f138282de7d73b D.txt
288 2a80419dfc31d7dfb308ac40f3f138282de7d73b D.txt
303 a58b36ad6b6545195952793099613c2116f3563b,ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 b.txt
289 a58b36ad6b6545195952793099613c2116f3563b,ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 b.txt
304
290
305 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt --dry-run
291 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt --dry-run
306 loading report file '$TESTTMP/report.txt'
292 loading report file '$TESTTMP/report.txt'
307 found affected revision 1 for filelog 'D.txt'
293 found affected revision 1 for filelog 'D.txt'
308 found affected revision 1 for filelog 'b.txt'
294 found affected revision 1 for filelog 'b.txt'
309 found affected revision 3 for filelog 'b.txt'
295 found affected revision 3 for filelog 'b.txt'
310 $ hg st
296 $ hg st
311 M D.txt
297 M D.txt
312 M b.txt
298 M b.txt
313 $ hg debugrevlogindex b.txt
299 $ hg debugrevlogindex b.txt
314 rev linkrev nodeid p1 p2
300 rev linkrev nodeid p1 p2
315 0 2 05b806ebe5ea 000000000000 000000000000
301 0 2 05b806ebe5ea 000000000000 000000000000
316 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
302 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
317 2 6 216a5fe8b8ed 000000000000 000000000000
303 2 6 216a5fe8b8ed 000000000000 000000000000
318 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
304 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
319 $ hg debugrevlogindex D.txt
305 $ hg debugrevlogindex D.txt
320 rev linkrev nodeid p1 p2
306 rev linkrev nodeid p1 p2
321 0 6 2a8d3833f2fb 000000000000 000000000000
307 0 6 2a8d3833f2fb 000000000000 000000000000
322 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
308 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
323
309
324 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt
310 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt
325 loading report file '$TESTTMP/report.txt'
311 loading report file '$TESTTMP/report.txt'
326 found affected revision 1 for filelog 'D.txt'
312 found affected revision 1 for filelog 'D.txt'
327 repaired revision 1 of 'filelog data/D.txt.i'
313 repaired revision 1 of 'filelog data/D.txt.i'
328 found affected revision 1 for filelog 'b.txt'
314 found affected revision 1 for filelog 'b.txt'
329 found affected revision 3 for filelog 'b.txt'
315 found affected revision 3 for filelog 'b.txt'
330 repaired revision 1 of 'filelog data/b.txt.i'
316 repaired revision 1 of 'filelog data/b.txt.i'
331 repaired revision 3 of 'filelog data/b.txt.i'
317 repaired revision 3 of 'filelog data/b.txt.i'
332 $ hg st
318 $ hg st
333 $ hg debugrevlogindex b.txt
319 $ hg debugrevlogindex b.txt
334 rev linkrev nodeid p1 p2
320 rev linkrev nodeid p1 p2
335 0 2 05b806ebe5ea 000000000000 000000000000
321 0 2 05b806ebe5ea 000000000000 000000000000
336 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
322 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
337 2 6 216a5fe8b8ed 000000000000 000000000000
323 2 6 216a5fe8b8ed 000000000000 000000000000
338 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
324 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
339 $ hg debugrevlogindex D.txt
325 $ hg debugrevlogindex D.txt
340 rev linkrev nodeid p1 p2
326 rev linkrev nodeid p1 p2
341 0 6 2a8d3833f2fb 000000000000 000000000000
327 0 6 2a8d3833f2fb 000000000000 000000000000
342 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
328 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
343
329
344 Check that the revision is not "fixed" again
330 Check that the revision is not "fixed" again
345
331
346 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt
332 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt
347 loading report file '$TESTTMP/report.txt'
333 loading report file '$TESTTMP/report.txt'
348 revision 2a80419dfc31d7dfb308ac40f3f138282de7d73b of file 'D.txt' is not affected
334 revision 2a80419dfc31d7dfb308ac40f3f138282de7d73b of file 'D.txt' is not affected
349 no affected revisions were found for 'D.txt'
335 no affected revisions were found for 'D.txt'
350 revision a58b36ad6b6545195952793099613c2116f3563b of file 'b.txt' is not affected
336 revision a58b36ad6b6545195952793099613c2116f3563b of file 'b.txt' is not affected
351 revision ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 of file 'b.txt' is not affected
337 revision ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 of file 'b.txt' is not affected
352 no affected revisions were found for 'b.txt'
338 no affected revisions were found for 'b.txt'
353 $ hg st
339 $ hg st
354 $ hg debugrevlogindex b.txt
340 $ hg debugrevlogindex b.txt
355 rev linkrev nodeid p1 p2
341 rev linkrev nodeid p1 p2
356 0 2 05b806ebe5ea 000000000000 000000000000
342 0 2 05b806ebe5ea 000000000000 000000000000
357 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
343 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
358 2 6 216a5fe8b8ed 000000000000 000000000000
344 2 6 216a5fe8b8ed 000000000000 000000000000
359 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
345 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
360 $ hg debugrevlogindex D.txt
346 $ hg debugrevlogindex D.txt
361 rev linkrev nodeid p1 p2
347 rev linkrev nodeid p1 p2
362 0 6 2a8d3833f2fb 000000000000 000000000000
348 0 6 2a8d3833f2fb 000000000000 000000000000
363 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
349 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
364
350
365 Try it with a non-inline revlog
351 Try it with a non-inline revlog
366 -------------------------------
352 -------------------------------
367
353
368 $ cd ..
354 $ cd ..
369 $ mkdir $TESTTMP/ext
355 $ mkdir $TESTTMP/ext
370 $ cat << EOF > $TESTTMP/ext/small_inline.py
356 $ cat << EOF > $TESTTMP/ext/small_inline.py
371 > from mercurial import revlog
357 > from mercurial import revlog
372 > revlog._maxinline = 8
358 > revlog._maxinline = 8
373 > EOF
359 > EOF
374
360
375 $ cat << EOF >> $HGRCPATH
361 $ cat << EOF >> $HGRCPATH
376 > [extensions]
362 > [extensions]
377 > small_inline=$TESTTMP/ext/small_inline.py
363 > small_inline=$TESTTMP/ext/small_inline.py
378 > EOF
364 > EOF
379
365
380 $ mkdir repo-to-fix-not-inline
366 $ mkdir repo-to-fix-not-inline
381 $ cd repo-to-fix-not-inline
367 $ cd repo-to-fix-not-inline
382 #if windows
368 $ tar -x < "$TESTDIR"/bundles/issue6528.tar
383 tar interprets `:` in paths (like `C:`) as being remote, force local on Windows
384 only since some versions of tar don't have this flag.
385
386 $ tar --force-local -xf $TESTDIR/bundles/issue6528.tar
387 #else
388 $ tar xf $TESTDIR/bundles/issue6528.tar
389 #endif
390 $ echo b >> b.txt
369 $ echo b >> b.txt
391 $ hg commit -qm "inline -> separate"
370 $ hg commit -qm "inline -> separate"
392 $ find .hg -name *b.txt.d
371 $ find .hg -name *b.txt.d
393 .hg/store/data/b.txt.d
372 .hg/store/data/b.txt.d
394
373
395 Status is correct, but the problem is still there, in the earlier revision
374 Status is correct, but the problem is still there, in the earlier revision
396 $ hg st
375 $ hg st
397 $ hg up 3
376 $ hg up 3
398 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
377 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
399 $ hg st
378 $ hg st
400 M b.txt
379 M b.txt
401 $ hg debugrevlogindex b.txt
380 $ hg debugrevlogindex b.txt
402 rev linkrev nodeid p1 p2
381 rev linkrev nodeid p1 p2
403 0 2 05b806ebe5ea 000000000000 000000000000
382 0 2 05b806ebe5ea 000000000000 000000000000
404 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
383 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
405 2 6 216a5fe8b8ed 000000000000 000000000000
384 2 6 216a5fe8b8ed 000000000000 000000000000
406 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
385 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
407 4 8 db234885e2fe ea4f2f2463cc 000000000000
386 4 8 db234885e2fe ea4f2f2463cc 000000000000
408 $ hg debugrevlogindex D.txt
387 $ hg debugrevlogindex D.txt
409 rev linkrev nodeid p1 p2
388 rev linkrev nodeid p1 p2
410 0 6 2a8d3833f2fb 000000000000 000000000000
389 0 6 2a8d3833f2fb 000000000000 000000000000
411 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
390 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
412 2 8 65aecc89bb5d 2a80419dfc31 000000000000
391 2 8 65aecc89bb5d 2a80419dfc31 000000000000
413
392
414 Run the fix on the non-inline revlog
393 Run the fix on the non-inline revlog
415 $ hg debug-repair-issue6528
394 $ hg debug-repair-issue6528
416 found affected revision 1 for filelog 'data/D.txt.i'
395 found affected revision 1 for filelog 'data/D.txt.i'
417 repaired revision 1 of 'filelog data/D.txt.i'
396 repaired revision 1 of 'filelog data/D.txt.i'
418 found affected revision 1 for filelog 'data/b.txt.i'
397 found affected revision 1 for filelog 'data/b.txt.i'
419 found affected revision 3 for filelog 'data/b.txt.i'
398 found affected revision 3 for filelog 'data/b.txt.i'
420 repaired revision 1 of 'filelog data/b.txt.i'
399 repaired revision 1 of 'filelog data/b.txt.i'
421 repaired revision 3 of 'filelog data/b.txt.i'
400 repaired revision 3 of 'filelog data/b.txt.i'
422
401
423 Check that it worked
402 Check that it worked
424 $ hg debugrevlogindex b.txt
403 $ hg debugrevlogindex b.txt
425 rev linkrev nodeid p1 p2
404 rev linkrev nodeid p1 p2
426 0 2 05b806ebe5ea 000000000000 000000000000
405 0 2 05b806ebe5ea 000000000000 000000000000
427 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
406 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
428 2 6 216a5fe8b8ed 000000000000 000000000000
407 2 6 216a5fe8b8ed 000000000000 000000000000
429 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
408 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
430 4 8 db234885e2fe ea4f2f2463cc 000000000000
409 4 8 db234885e2fe ea4f2f2463cc 000000000000
431 $ hg debugrevlogindex D.txt
410 $ hg debugrevlogindex D.txt
432 rev linkrev nodeid p1 p2
411 rev linkrev nodeid p1 p2
433 0 6 2a8d3833f2fb 000000000000 000000000000
412 0 6 2a8d3833f2fb 000000000000 000000000000
434 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
413 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
435 2 8 65aecc89bb5d 2a80419dfc31 000000000000
414 2 8 65aecc89bb5d 2a80419dfc31 000000000000
436 $ hg debug-repair-issue6528
415 $ hg debug-repair-issue6528
437 no affected revisions were found
416 no affected revisions were found
438 $ hg st
417 $ hg st
439
418
440 $ cd ..
419 $ cd ..
441
420
442 Applying a bad bundle should fix it on the fly
421 Applying a bad bundle should fix it on the fly
443 ----------------------------------------------
422 ----------------------------------------------
444
423
445 from a v1 bundle
424 from a v1 bundle
446 ~~~~~~~~~~~~~~~~
425 ~~~~~~~~~~~~~~~~
447
426
448 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1
427 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1
449 bzip2-v1
428 bzip2-v1
450
429
451 $ hg init unbundle-v1
430 $ hg init unbundle-v1
452 $ cd unbundle-v1
431 $ cd unbundle-v1
453
432
454 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1
433 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1
455 adding changesets
434 adding changesets
456 adding manifests
435 adding manifests
457 adding file changes
436 adding file changes
458 added 8 changesets with 12 changes to 4 files
437 added 8 changesets with 12 changes to 4 files
459 new changesets f5a5a568022f:3beabb508514 (8 drafts)
438 new changesets f5a5a568022f:3beabb508514 (8 drafts)
460 (run 'hg update' to get a working copy)
439 (run 'hg update' to get a working copy)
461
440
462 Check that revision were fixed on the fly
441 Check that revision were fixed on the fly
463
442
464 $ hg debugrevlogindex b.txt
443 $ hg debugrevlogindex b.txt
465 rev linkrev nodeid p1 p2
444 rev linkrev nodeid p1 p2
466 0 2 05b806ebe5ea 000000000000 000000000000
445 0 2 05b806ebe5ea 000000000000 000000000000
467 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
446 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
468 2 6 216a5fe8b8ed 000000000000 000000000000
447 2 6 216a5fe8b8ed 000000000000 000000000000
469 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
448 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
470
449
471 $ hg debugrevlogindex D.txt
450 $ hg debugrevlogindex D.txt
472 rev linkrev nodeid p1 p2
451 rev linkrev nodeid p1 p2
473 0 6 2a8d3833f2fb 000000000000 000000000000
452 0 6 2a8d3833f2fb 000000000000 000000000000
474 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
453 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
475
454
476 That we don't see the symptoms of the bug
455 That we don't see the symptoms of the bug
477
456
478 $ hg up -- -1
457 $ hg up -- -1
479 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
458 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 $ hg status
459 $ hg status
481
460
482 And that the repair command does not find anything to fix
461 And that the repair command does not find anything to fix
483
462
484 $ hg debug-repair-issue6528
463 $ hg debug-repair-issue6528
485 no affected revisions were found
464 no affected revisions were found
486
465
487 $ cd ..
466 $ cd ..
488
467
489 from a v2 bundle
468 from a v2 bundle
490 ~~~~~~~~~~~~~~~~
469 ~~~~~~~~~~~~~~~~
491
470
492 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2
471 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2
493 bzip2-v2
472 bzip2-v2
494
473
495 $ hg init unbundle-v2
474 $ hg init unbundle-v2
496 $ cd unbundle-v2
475 $ cd unbundle-v2
497
476
498 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2
477 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2
499 adding changesets
478 adding changesets
500 adding manifests
479 adding manifests
501 adding file changes
480 adding file changes
502 added 8 changesets with 12 changes to 4 files
481 added 8 changesets with 12 changes to 4 files
503 new changesets f5a5a568022f:3beabb508514 (8 drafts)
482 new changesets f5a5a568022f:3beabb508514 (8 drafts)
504 (run 'hg update' to get a working copy)
483 (run 'hg update' to get a working copy)
505
484
506 Check that revision were fixed on the fly
485 Check that revision were fixed on the fly
507
486
508 $ hg debugrevlogindex b.txt
487 $ hg debugrevlogindex b.txt
509 rev linkrev nodeid p1 p2
488 rev linkrev nodeid p1 p2
510 0 2 05b806ebe5ea 000000000000 000000000000
489 0 2 05b806ebe5ea 000000000000 000000000000
511 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
490 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
512 2 6 216a5fe8b8ed 000000000000 000000000000
491 2 6 216a5fe8b8ed 000000000000 000000000000
513 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
492 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
514
493
515 $ hg debugrevlogindex D.txt
494 $ hg debugrevlogindex D.txt
516 rev linkrev nodeid p1 p2
495 rev linkrev nodeid p1 p2
517 0 6 2a8d3833f2fb 000000000000 000000000000
496 0 6 2a8d3833f2fb 000000000000 000000000000
518 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
497 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
519
498
520 That we don't see the symptoms of the bug
499 That we don't see the symptoms of the bug
521
500
522 $ hg up -- -1
501 $ hg up -- -1
523 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
502 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
524 $ hg status
503 $ hg status
525
504
526 And that the repair command does not find anything to fix
505 And that the repair command does not find anything to fix
527
506
528 $ hg debug-repair-issue6528
507 $ hg debug-repair-issue6528
529 no affected revisions were found
508 no affected revisions were found
530
509
531 $ cd ..
510 $ cd ..
532
511
533 A config option can disable the fixing of the bad bundle on the fly
512 A config option can disable the fixing of the bad bundle on the fly
534 -------------------------------------------------------------------
513 -------------------------------------------------------------------
535
514
536
515
537
516
538 from a v1 bundle
517 from a v1 bundle
539 ~~~~~~~~~~~~~~~~
518 ~~~~~~~~~~~~~~~~
540
519
541 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1
520 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1
542 bzip2-v1
521 bzip2-v1
543
522
544 $ hg init unbundle-v1-no-fix
523 $ hg init unbundle-v1-no-fix
545 $ cd unbundle-v1-no-fix
524 $ cd unbundle-v1-no-fix
546
525
547 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1 --config storage.revlog.issue6528.fix-incoming=no
526 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1 --config storage.revlog.issue6528.fix-incoming=no
548 adding changesets
527 adding changesets
549 adding manifests
528 adding manifests
550 adding file changes
529 adding file changes
551 added 8 changesets with 12 changes to 4 files
530 added 8 changesets with 12 changes to 4 files
552 new changesets f5a5a568022f:3beabb508514 (8 drafts)
531 new changesets f5a5a568022f:3beabb508514 (8 drafts)
553 (run 'hg update' to get a working copy)
532 (run 'hg update' to get a working copy)
554
533
555 Check that revision were not fixed on the fly
534 Check that revision were not fixed on the fly
556
535
557 $ hg debugrevlogindex b.txt
536 $ hg debugrevlogindex b.txt
558 rev linkrev nodeid p1 p2
537 rev linkrev nodeid p1 p2
559 0 2 05b806ebe5ea 000000000000 000000000000
538 0 2 05b806ebe5ea 000000000000 000000000000
560 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
539 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
561 2 6 216a5fe8b8ed 000000000000 000000000000
540 2 6 216a5fe8b8ed 000000000000 000000000000
562 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
541 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
563
542
564 $ hg debugrevlogindex D.txt
543 $ hg debugrevlogindex D.txt
565 rev linkrev nodeid p1 p2
544 rev linkrev nodeid p1 p2
566 0 6 2a8d3833f2fb 000000000000 000000000000
545 0 6 2a8d3833f2fb 000000000000 000000000000
567 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
546 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
568
547
569 That we do see the symptoms of the bug
548 That we do see the symptoms of the bug
570
549
571 $ hg up -- -1
550 $ hg up -- -1
572 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
551 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
573 $ hg status
552 $ hg status
574 M D.txt (?)
553 M D.txt (?)
575 M b.txt (?)
554 M b.txt (?)
576
555
577 And that the repair command find issue to fix.
556 And that the repair command find issue to fix.
578
557
579 $ hg debug-repair-issue6528 --dry-run
558 $ hg debug-repair-issue6528 --dry-run
580 found affected revision 1 for filelog 'data/D.txt.i'
559 found affected revision 1 for filelog 'data/D.txt.i'
581 found affected revision 1 for filelog 'data/b.txt.i'
560 found affected revision 1 for filelog 'data/b.txt.i'
582 found affected revision 3 for filelog 'data/b.txt.i'
561 found affected revision 3 for filelog 'data/b.txt.i'
583
562
584 $ cd ..
563 $ cd ..
585
564
586 from a v2 bundle
565 from a v2 bundle
587 ~~~~~~~~~~~~~~~~
566 ~~~~~~~~~~~~~~~~
588
567
589 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2
568 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2
590 bzip2-v2
569 bzip2-v2
591
570
592 $ hg init unbundle-v2-no-fix
571 $ hg init unbundle-v2-no-fix
593 $ cd unbundle-v2-no-fix
572 $ cd unbundle-v2-no-fix
594
573
595 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2 --config storage.revlog.issue6528.fix-incoming=no
574 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2 --config storage.revlog.issue6528.fix-incoming=no
596 adding changesets
575 adding changesets
597 adding manifests
576 adding manifests
598 adding file changes
577 adding file changes
599 added 8 changesets with 12 changes to 4 files
578 added 8 changesets with 12 changes to 4 files
600 new changesets f5a5a568022f:3beabb508514 (8 drafts)
579 new changesets f5a5a568022f:3beabb508514 (8 drafts)
601 (run 'hg update' to get a working copy)
580 (run 'hg update' to get a working copy)
602
581
603 Check that revision were not fixed on the fly
582 Check that revision were not fixed on the fly
604
583
605 $ hg debugrevlogindex b.txt
584 $ hg debugrevlogindex b.txt
606 rev linkrev nodeid p1 p2
585 rev linkrev nodeid p1 p2
607 0 2 05b806ebe5ea 000000000000 000000000000
586 0 2 05b806ebe5ea 000000000000 000000000000
608 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
587 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
609 2 6 216a5fe8b8ed 000000000000 000000000000
588 2 6 216a5fe8b8ed 000000000000 000000000000
610 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
589 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
611
590
612 $ hg debugrevlogindex D.txt
591 $ hg debugrevlogindex D.txt
613 rev linkrev nodeid p1 p2
592 rev linkrev nodeid p1 p2
614 0 6 2a8d3833f2fb 000000000000 000000000000
593 0 6 2a8d3833f2fb 000000000000 000000000000
615 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
594 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
616
595
617 That we do see the symptoms of the bug
596 That we do see the symptoms of the bug
618
597
619 $ hg up -- -1
598 $ hg up -- -1
620 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
599 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
621 $ hg status
600 $ hg status
622 M D.txt (?)
601 M D.txt (?)
623 M b.txt (?)
602 M b.txt (?)
624
603
625 And that the repair command find issue to fix.
604 And that the repair command find issue to fix.
626
605
627 $ hg debug-repair-issue6528 --dry-run
606 $ hg debug-repair-issue6528 --dry-run
628 found affected revision 1 for filelog 'data/D.txt.i'
607 found affected revision 1 for filelog 'data/D.txt.i'
629 found affected revision 1 for filelog 'data/b.txt.i'
608 found affected revision 1 for filelog 'data/b.txt.i'
630 found affected revision 3 for filelog 'data/b.txt.i'
609 found affected revision 3 for filelog 'data/b.txt.i'
631
610
632 $ cd ..
611 $ cd ..
@@ -1,89 +1,89 b''
1 $ hg init empty-repo
1 $ hg init empty-repo
2 $ cd empty-repo
2 $ cd empty-repo
3
3
4 Flags on revlog version 0 are rejected
4 Flags on revlog version 0 are rejected
5
5
6 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
6 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
7 ... fh.write(b'\x00\x01\x00\x00') and None
7 ... fh.write(b'\x00\x01\x00\x00') and None
8
8
9 $ hg log
9 $ hg log
10 abort: unknown flags (0x01) in version 0 revlog 00changelog
10 abort: unknown flags (0x01) in version 0 revlog 00changelog
11 [50]
11 [50]
12
12
13 Unknown flags on revlog version 1 are rejected
13 Unknown flags on revlog version 1 are rejected
14
14
15 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
15 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
16 ... fh.write(b'\x00\x04\x00\x01') and None
16 ... fh.write(b'\x00\x04\x00\x01') and None
17
17
18 $ hg log
18 $ hg log
19 abort: unknown flags (0x04) in version 1 revlog 00changelog
19 abort: unknown flags (0x04) in version 1 revlog 00changelog
20 [50]
20 [50]
21
21
22 Unknown version is rejected
22 Unknown version is rejected
23
23
24 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
24 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
25 ... fh.write(b'\x00\x00\xbe\xef') and None
25 ... fh.write(b'\x00\x00\xbe\xef') and None
26
26
27 $ hg log
27 $ hg log
28 abort: unknown version (48879) in revlog 00changelog
28 abort: unknown version (48879) in revlog 00changelog
29 [50]
29 [50]
30
30
31 $ cd ..
31 $ cd ..
32
32
33 Test for CVE-2016-3630
33 Test for CVE-2016-3630
34
34
35 $ mkdir test2; cd test2
35 $ mkdir test2; cd test2
36 $ hg init
36 $ hg init
37
37
38 >>> import codecs
38 >>> import codecs
39 >>> open("a.i", "wb").write(codecs.decode(codecs.decode(
39 >>> open("a.i", "wb").write(codecs.decode(codecs.decode(
40 ... b"""eJxjYGZgZIAAYQYGxhgom+k/FMx8YKx9ZUaKSOyqo4cnuKb8mbqHV5cBCVTMWb1Cwqkhe4Gsg9AD
40 ... b"""eJxjYGZgZIAAYQYGxhgom+k/FMx8YKx9ZUaKSOyqo4cnuKb8mbqHV5cBCVTMWb1Cwqkhe4Gsg9AD
41 ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA==""",
41 ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA==""",
42 ... "base64"), "zlib")) and None
42 ... "base64"), "zlib")) and None
43
43
44 $ hg debugrevlogindex a.i
44 $ hg debugrevlogindex a.i
45 rev linkrev nodeid p1 p2
45 rev linkrev nodeid p1 p2
46 0 2 99e0332bd498 000000000000 000000000000
46 0 2 99e0332bd498 000000000000 000000000000
47 1 3 6674f57a23d8 99e0332bd498 000000000000
47 1 3 6674f57a23d8 99e0332bd498 000000000000
48
48
49 >>> from mercurial.revlogutils.constants import KIND_OTHER
49 >>> from mercurial.revlogutils.constants import KIND_OTHER
50 >>> from mercurial import revlog, vfs
50 >>> from mercurial import revlog, vfs
51 >>> tvfs = vfs.vfs(b'.')
51 >>> tvfs = vfs.vfs(b'.')
52 >>> tvfs.options = {b'revlogv1': True}
52 >>> tvfs.options = {b'revlogv1': True}
53 >>> rl = revlog.revlog(tvfs, target=(KIND_OTHER, b'test'), radix=b'a')
53 >>> rl = revlog.revlog(tvfs, target=(KIND_OTHER, b'test'), radix=b'a')
54 >>> rl.revision(1)
54 >>> rl.revision(1)
55 mpatchError(*'patch cannot be decoded'*) (glob)
55 mpatchError(*'patch cannot be decoded'*) (glob)
56
56
57 $ cd ..
57 $ cd ..
58
58
59
59
60 Regression test for support for the old repos with strange diff encoding.
60 Regression test for support for the old repos with strange diff encoding.
61 Apparently it used to be possible (maybe it's still possible, but we don't know how)
61 Apparently it used to be possible (maybe it's still possible, but we don't know how)
62 to create commits whose diffs are encoded relative to a nullrev.
62 to create commits whose diffs are encoded relative to a nullrev.
63 This test checks that a repo with that encoding can still be read.
63 This test checks that a repo with that encoding can still be read.
64
64
65 This is what we did to produce the repo in test-revlog-diff-relative-to-nullrev.tar:
65 This is what we did to produce the repo in test-revlog-diff-relative-to-nullrev.tar:
66
66
67 - tweak the code in mercurial/revlogutils/deltas.py to produce such "trivial" deltas:
67 - tweak the code in mercurial/revlogutils/deltas.py to produce such "trivial" deltas:
68 > if deltainfo is None:
68 > if deltainfo is None:
69 > - deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)
69 > - deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)
70 > + deltainfo = self._builddeltainfo(revinfo, nullrev, fh)
70 > + deltainfo = self._builddeltainfo(revinfo, nullrev, fh)
71 - hg init
71 - hg init
72 - echo hi > a
72 - echo hi > a
73 - hg commit -Am_
73 - hg commit -Am_
74 - remove some cache files
74 - remove some cache files
75
75
76 $ tar --force-local -xf "$TESTDIR"/bundles/test-revlog-diff-relative-to-nullrev.tar
76 $ tar -x < "$TESTDIR"/bundles/test-revlog-diff-relative-to-nullrev.tar
77 $ cd nullrev-diff
77 $ cd nullrev-diff
78 $ hg debugdeltachain a
78 $ hg debugdeltachain a
79 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
79 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
80 0 -1 -1 1 2 -1 p1 15 3 15 5.00000 15 0 0.00000 15 15 1.00000 1
80 0 -1 -1 1 2 -1 p1 15 3 15 5.00000 15 0 0.00000 15 15 1.00000 1
81 1 0 -1 1 2 -1 p2 15 3 15 5.00000 30 15 1.00000 30 30 0.50000 1
81 1 0 -1 1 2 -1 p2 15 3 15 5.00000 30 15 1.00000 30 30 0.50000 1
82 2 -1 -1 1 2 -1 p1 15 3 15 5.00000 45 30 2.00000 45 45 0.33333 1
82 2 -1 -1 1 2 -1 p1 15 3 15 5.00000 45 30 2.00000 45 45 0.33333 1
83 $ hg cat --config rhg.cat=true -r 0 a
83 $ hg cat --config rhg.cat=true -r 0 a
84 hi
84 hi
85 $ hg cat --config rhg.cat=true -r 1 a
85 $ hg cat --config rhg.cat=true -r 1 a
86 ho
86 ho
87 $ hg cat --config rhg.cat=true -r 2 a
87 $ hg cat --config rhg.cat=true -r 2 a
88 ha
88 ha
89 $ cd ..
89 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now