##// END OF EJS Templates
tests: use the `--quiet` flag for verify when applicable...
Raphaël Gomès -
r50720:2f2682f4 default
parent child Browse files
Show More
@@ -1,352 +1,277
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3 $ hg unbundle "$TESTDIR/bundles/remote.hg"
3 $ hg unbundle "$TESTDIR/bundles/remote.hg"
4 adding changesets
4 adding changesets
5 adding manifests
5 adding manifests
6 adding file changes
6 adding file changes
7 added 9 changesets with 7 changes to 4 files (+1 heads)
7 added 9 changesets with 7 changes to 4 files (+1 heads)
8 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
8 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
9 (run 'hg heads' to see heads, 'hg merge' to merge)
9 (run 'hg heads' to see heads, 'hg merge' to merge)
10 $ hg up tip
10 $ hg up tip
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 $ cd ..
12 $ cd ..
13
13
14 $ for i in 0 1 2 3 4 5 6 7 8; do
14 $ for i in 0 1 2 3 4 5 6 7 8; do
15 > mkdir test-"$i"
15 > mkdir test-"$i"
16 > hg --cwd test-"$i" init
16 > hg --cwd test-"$i" init
17 > hg -R test bundle -r "$i" test-"$i".hg test-"$i"
17 > hg -R test bundle -r "$i" test-"$i".hg test-"$i"
18 > cd test-"$i"
18 > cd test-"$i"
19 > hg unbundle ../test-"$i".hg
19 > hg unbundle ../test-"$i".hg
20 > hg verify
20 > hg verify -q
21 > hg tip -q
21 > hg tip -q
22 > cd ..
22 > cd ..
23 > done
23 > done
24 searching for changes
24 searching for changes
25 1 changesets found
25 1 changesets found
26 adding changesets
26 adding changesets
27 adding manifests
27 adding manifests
28 adding file changes
28 adding file changes
29 added 1 changesets with 1 changes to 1 files
29 added 1 changesets with 1 changes to 1 files
30 new changesets bfaf4b5cbf01 (1 drafts)
30 new changesets bfaf4b5cbf01 (1 drafts)
31 (run 'hg update' to get a working copy)
31 (run 'hg update' to get a working copy)
32 checking changesets
33 checking manifests
34 crosschecking files in changesets and manifests
35 checking files
36 checked 1 changesets with 1 changes to 1 files
37 0:bfaf4b5cbf01
32 0:bfaf4b5cbf01
38 searching for changes
33 searching for changes
39 2 changesets found
34 2 changesets found
40 adding changesets
35 adding changesets
41 adding manifests
36 adding manifests
42 adding file changes
37 adding file changes
43 added 2 changesets with 2 changes to 1 files
38 added 2 changesets with 2 changes to 1 files
44 new changesets bfaf4b5cbf01:21f32785131f (2 drafts)
39 new changesets bfaf4b5cbf01:21f32785131f (2 drafts)
45 (run 'hg update' to get a working copy)
40 (run 'hg update' to get a working copy)
46 checking changesets
47 checking manifests
48 crosschecking files in changesets and manifests
49 checking files
50 checked 2 changesets with 2 changes to 1 files
51 1:21f32785131f
41 1:21f32785131f
52 searching for changes
42 searching for changes
53 3 changesets found
43 3 changesets found
54 adding changesets
44 adding changesets
55 adding manifests
45 adding manifests
56 adding file changes
46 adding file changes
57 added 3 changesets with 3 changes to 1 files
47 added 3 changesets with 3 changes to 1 files
58 new changesets bfaf4b5cbf01:4ce51a113780 (3 drafts)
48 new changesets bfaf4b5cbf01:4ce51a113780 (3 drafts)
59 (run 'hg update' to get a working copy)
49 (run 'hg update' to get a working copy)
60 checking changesets
61 checking manifests
62 crosschecking files in changesets and manifests
63 checking files
64 checked 3 changesets with 3 changes to 1 files
65 2:4ce51a113780
50 2:4ce51a113780
66 searching for changes
51 searching for changes
67 4 changesets found
52 4 changesets found
68 adding changesets
53 adding changesets
69 adding manifests
54 adding manifests
70 adding file changes
55 adding file changes
71 added 4 changesets with 4 changes to 1 files
56 added 4 changesets with 4 changes to 1 files
72 new changesets bfaf4b5cbf01:93ee6ab32777 (4 drafts)
57 new changesets bfaf4b5cbf01:93ee6ab32777 (4 drafts)
73 (run 'hg update' to get a working copy)
58 (run 'hg update' to get a working copy)
74 checking changesets
75 checking manifests
76 crosschecking files in changesets and manifests
77 checking files
78 checked 4 changesets with 4 changes to 1 files
79 3:93ee6ab32777
59 3:93ee6ab32777
80 searching for changes
60 searching for changes
81 2 changesets found
61 2 changesets found
82 adding changesets
62 adding changesets
83 adding manifests
63 adding manifests
84 adding file changes
64 adding file changes
85 added 2 changesets with 2 changes to 1 files
65 added 2 changesets with 2 changes to 1 files
86 new changesets bfaf4b5cbf01:c70afb1ee985 (2 drafts)
66 new changesets bfaf4b5cbf01:c70afb1ee985 (2 drafts)
87 (run 'hg update' to get a working copy)
67 (run 'hg update' to get a working copy)
88 checking changesets
89 checking manifests
90 crosschecking files in changesets and manifests
91 checking files
92 checked 2 changesets with 2 changes to 1 files
93 1:c70afb1ee985
68 1:c70afb1ee985
94 searching for changes
69 searching for changes
95 3 changesets found
70 3 changesets found
96 adding changesets
71 adding changesets
97 adding manifests
72 adding manifests
98 adding file changes
73 adding file changes
99 added 3 changesets with 3 changes to 1 files
74 added 3 changesets with 3 changes to 1 files
100 new changesets bfaf4b5cbf01:f03ae5a9b979 (3 drafts)
75 new changesets bfaf4b5cbf01:f03ae5a9b979 (3 drafts)
101 (run 'hg update' to get a working copy)
76 (run 'hg update' to get a working copy)
102 checking changesets
103 checking manifests
104 crosschecking files in changesets and manifests
105 checking files
106 checked 3 changesets with 3 changes to 1 files
107 2:f03ae5a9b979
77 2:f03ae5a9b979
108 searching for changes
78 searching for changes
109 4 changesets found
79 4 changesets found
110 adding changesets
80 adding changesets
111 adding manifests
81 adding manifests
112 adding file changes
82 adding file changes
113 added 4 changesets with 5 changes to 2 files
83 added 4 changesets with 5 changes to 2 files
114 new changesets bfaf4b5cbf01:095cb14b1b4d (4 drafts)
84 new changesets bfaf4b5cbf01:095cb14b1b4d (4 drafts)
115 (run 'hg update' to get a working copy)
85 (run 'hg update' to get a working copy)
116 checking changesets
117 checking manifests
118 crosschecking files in changesets and manifests
119 checking files
120 checked 4 changesets with 5 changes to 2 files
121 3:095cb14b1b4d
86 3:095cb14b1b4d
122 searching for changes
87 searching for changes
123 5 changesets found
88 5 changesets found
124 adding changesets
89 adding changesets
125 adding manifests
90 adding manifests
126 adding file changes
91 adding file changes
127 added 5 changesets with 6 changes to 3 files
92 added 5 changesets with 6 changes to 3 files
128 new changesets bfaf4b5cbf01:faa2e4234c7a (5 drafts)
93 new changesets bfaf4b5cbf01:faa2e4234c7a (5 drafts)
129 (run 'hg update' to get a working copy)
94 (run 'hg update' to get a working copy)
130 checking changesets
131 checking manifests
132 crosschecking files in changesets and manifests
133 checking files
134 checked 5 changesets with 6 changes to 3 files
135 4:faa2e4234c7a
95 4:faa2e4234c7a
136 searching for changes
96 searching for changes
137 5 changesets found
97 5 changesets found
138 adding changesets
98 adding changesets
139 adding manifests
99 adding manifests
140 adding file changes
100 adding file changes
141 added 5 changesets with 5 changes to 2 files
101 added 5 changesets with 5 changes to 2 files
142 new changesets bfaf4b5cbf01:916f1afdef90 (5 drafts)
102 new changesets bfaf4b5cbf01:916f1afdef90 (5 drafts)
143 (run 'hg update' to get a working copy)
103 (run 'hg update' to get a working copy)
144 checking changesets
145 checking manifests
146 crosschecking files in changesets and manifests
147 checking files
148 checked 5 changesets with 5 changes to 2 files
149 4:916f1afdef90
104 4:916f1afdef90
150 $ cd test-8
105 $ cd test-8
151 $ hg pull ../test-7
106 $ hg pull ../test-7
152 pulling from ../test-7
107 pulling from ../test-7
153 searching for changes
108 searching for changes
154 adding changesets
109 adding changesets
155 adding manifests
110 adding manifests
156 adding file changes
111 adding file changes
157 added 4 changesets with 2 changes to 3 files (+1 heads)
112 added 4 changesets with 2 changes to 3 files (+1 heads)
158 new changesets c70afb1ee985:faa2e4234c7a
113 new changesets c70afb1ee985:faa2e4234c7a
159 1 local changesets published
114 1 local changesets published
160 (run 'hg heads' to see heads, 'hg merge' to merge)
115 (run 'hg heads' to see heads, 'hg merge' to merge)
161 $ hg verify
116 $ hg verify -q
162 checking changesets
163 checking manifests
164 crosschecking files in changesets and manifests
165 checking files
166 checked 9 changesets with 7 changes to 4 files
167 $ hg rollback
117 $ hg rollback
168 repository tip rolled back to revision 4 (undo pull)
118 repository tip rolled back to revision 4 (undo pull)
169 $ cd ..
119 $ cd ..
170
120
171 should fail
121 should fail
172
122
173 $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg test-3
123 $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg test-3
174 abort: --base is incompatible with specifying destinations
124 abort: --base is incompatible with specifying destinations
175 [10]
125 [10]
176 $ hg -R test bundle -a -r tip test-bundle-branch1.hg test-3
126 $ hg -R test bundle -a -r tip test-bundle-branch1.hg test-3
177 abort: --all is incompatible with specifying destinations
127 abort: --all is incompatible with specifying destinations
178 [10]
128 [10]
179 $ hg -R test bundle -r tip test-bundle-branch1.hg
129 $ hg -R test bundle -r tip test-bundle-branch1.hg
180 config error: default repository not configured!
130 config error: default repository not configured!
181 (see 'hg help config.paths')
131 (see 'hg help config.paths')
182 [30]
132 [30]
183
133
184 $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg
134 $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg
185 2 changesets found
135 2 changesets found
186 $ hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
136 $ hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
187 4 changesets found
137 4 changesets found
188 $ hg -R test bundle --base 2 test-bundle-all.hg
138 $ hg -R test bundle --base 2 test-bundle-all.hg
189 6 changesets found
139 6 changesets found
190 $ hg -R test bundle --base 2 --all test-bundle-all-2.hg
140 $ hg -R test bundle --base 2 --all test-bundle-all-2.hg
191 ignoring --base because --all was specified
141 ignoring --base because --all was specified
192 9 changesets found
142 9 changesets found
193 $ hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
143 $ hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
194 1 changesets found
144 1 changesets found
195
145
196 empty bundle
146 empty bundle
197
147
198 $ hg -R test bundle --base 7 --base 8 test-bundle-empty.hg
148 $ hg -R test bundle --base 7 --base 8 test-bundle-empty.hg
199 no changes found
149 no changes found
200 [1]
150 [1]
201
151
202 issue76 msg2163
152 issue76 msg2163
203
153
204 $ hg -R test bundle --base 3 -r 3 -r 3 test-bundle-cset-3.hg
154 $ hg -R test bundle --base 3 -r 3 -r 3 test-bundle-cset-3.hg
205 no changes found
155 no changes found
206 [1]
156 [1]
207
157
208 Issue1910: 'hg bundle --base $head' does not exclude $head from
158 Issue1910: 'hg bundle --base $head' does not exclude $head from
209 result
159 result
210
160
211 $ hg -R test bundle --base 7 test-bundle-cset-7.hg
161 $ hg -R test bundle --base 7 test-bundle-cset-7.hg
212 4 changesets found
162 4 changesets found
213
163
214 $ hg clone test-2 test-9
164 $ hg clone test-2 test-9
215 updating to branch default
165 updating to branch default
216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
217 $ cd test-9
167 $ cd test-9
218
168
219 revision 2
169 revision 2
220
170
221 $ hg tip -q
171 $ hg tip -q
222 2:4ce51a113780
172 2:4ce51a113780
223 $ hg unbundle ../test-bundle-should-fail.hg
173 $ hg unbundle ../test-bundle-should-fail.hg
224 adding changesets
174 adding changesets
225 transaction abort!
175 transaction abort!
226 rollback completed
176 rollback completed
227 abort: 00changelog@93ee6ab32777cd430e07da694794fb6a4f917712: unknown parent
177 abort: 00changelog@93ee6ab32777cd430e07da694794fb6a4f917712: unknown parent
228 [50]
178 [50]
229
179
230 revision 2
180 revision 2
231
181
232 $ hg tip -q
182 $ hg tip -q
233 2:4ce51a113780
183 2:4ce51a113780
234 $ hg unbundle ../test-bundle-all.hg
184 $ hg unbundle ../test-bundle-all.hg
235 adding changesets
185 adding changesets
236 adding manifests
186 adding manifests
237 adding file changes
187 adding file changes
238 added 6 changesets with 4 changes to 4 files (+1 heads)
188 added 6 changesets with 4 changes to 4 files (+1 heads)
239 new changesets 93ee6ab32777:916f1afdef90 (6 drafts)
189 new changesets 93ee6ab32777:916f1afdef90 (6 drafts)
240 (run 'hg heads' to see heads, 'hg merge' to merge)
190 (run 'hg heads' to see heads, 'hg merge' to merge)
241
191
242 revision 8
192 revision 8
243
193
244 $ hg tip -q
194 $ hg tip -q
245 8:916f1afdef90
195 8:916f1afdef90
246 $ hg verify
196 $ hg verify -q
247 checking changesets
248 checking manifests
249 crosschecking files in changesets and manifests
250 checking files
251 checked 9 changesets with 7 changes to 4 files
252 $ hg rollback
197 $ hg rollback
253 repository tip rolled back to revision 2 (undo unbundle)
198 repository tip rolled back to revision 2 (undo unbundle)
254
199
255 revision 2
200 revision 2
256
201
257 $ hg tip -q
202 $ hg tip -q
258 2:4ce51a113780
203 2:4ce51a113780
259 $ hg unbundle ../test-bundle-branch1.hg
204 $ hg unbundle ../test-bundle-branch1.hg
260 adding changesets
205 adding changesets
261 adding manifests
206 adding manifests
262 adding file changes
207 adding file changes
263 added 2 changesets with 2 changes to 2 files
208 added 2 changesets with 2 changes to 2 files
264 new changesets 93ee6ab32777:916f1afdef90 (2 drafts)
209 new changesets 93ee6ab32777:916f1afdef90 (2 drafts)
265 (run 'hg update' to get a working copy)
210 (run 'hg update' to get a working copy)
266
211
267 revision 4
212 revision 4
268
213
269 $ hg tip -q
214 $ hg tip -q
270 4:916f1afdef90
215 4:916f1afdef90
271 $ hg verify
216 $ hg verify -q
272 checking changesets
273 checking manifests
274 crosschecking files in changesets and manifests
275 checking files
276 checked 5 changesets with 5 changes to 2 files
277 $ hg rollback
217 $ hg rollback
278 repository tip rolled back to revision 2 (undo unbundle)
218 repository tip rolled back to revision 2 (undo unbundle)
279 $ hg unbundle ../test-bundle-branch2.hg
219 $ hg unbundle ../test-bundle-branch2.hg
280 adding changesets
220 adding changesets
281 adding manifests
221 adding manifests
282 adding file changes
222 adding file changes
283 added 4 changesets with 3 changes to 3 files (+1 heads)
223 added 4 changesets with 3 changes to 3 files (+1 heads)
284 new changesets c70afb1ee985:faa2e4234c7a (4 drafts)
224 new changesets c70afb1ee985:faa2e4234c7a (4 drafts)
285 (run 'hg heads' to see heads, 'hg merge' to merge)
225 (run 'hg heads' to see heads, 'hg merge' to merge)
286
226
287 revision 6
227 revision 6
288
228
289 $ hg tip -q
229 $ hg tip -q
290 6:faa2e4234c7a
230 6:faa2e4234c7a
291 $ hg verify
231 $ hg verify -q
292 checking changesets
293 checking manifests
294 crosschecking files in changesets and manifests
295 checking files
296 checked 7 changesets with 6 changes to 3 files
297 $ hg rollback
232 $ hg rollback
298 repository tip rolled back to revision 2 (undo unbundle)
233 repository tip rolled back to revision 2 (undo unbundle)
299 $ hg unbundle ../test-bundle-cset-7.hg
234 $ hg unbundle ../test-bundle-cset-7.hg
300 adding changesets
235 adding changesets
301 adding manifests
236 adding manifests
302 adding file changes
237 adding file changes
303 added 2 changesets with 2 changes to 2 files
238 added 2 changesets with 2 changes to 2 files
304 new changesets 93ee6ab32777:916f1afdef90 (2 drafts)
239 new changesets 93ee6ab32777:916f1afdef90 (2 drafts)
305 (run 'hg update' to get a working copy)
240 (run 'hg update' to get a working copy)
306
241
307 revision 4
242 revision 4
308
243
309 $ hg tip -q
244 $ hg tip -q
310 4:916f1afdef90
245 4:916f1afdef90
311 $ hg verify
246 $ hg verify -q
312 checking changesets
313 checking manifests
314 crosschecking files in changesets and manifests
315 checking files
316 checked 5 changesets with 5 changes to 2 files
317
247
318 $ cd ../test
248 $ cd ../test
319 $ hg merge 7
249 $ hg merge 7
320 note: possible conflict - afile was renamed multiple times to:
250 note: possible conflict - afile was renamed multiple times to:
321 adifferentfile
251 adifferentfile
322 anotherfile
252 anotherfile
323 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
324 (branch merge, don't forget to commit)
254 (branch merge, don't forget to commit)
325 $ hg ci -m merge
255 $ hg ci -m merge
326 $ cd ..
256 $ cd ..
327 $ hg -R test bundle --base 2 test-bundle-head.hg
257 $ hg -R test bundle --base 2 test-bundle-head.hg
328 7 changesets found
258 7 changesets found
329 $ hg clone test-2 test-10
259 $ hg clone test-2 test-10
330 updating to branch default
260 updating to branch default
331 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
261 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 $ cd test-10
262 $ cd test-10
333 $ hg unbundle ../test-bundle-head.hg
263 $ hg unbundle ../test-bundle-head.hg
334 adding changesets
264 adding changesets
335 adding manifests
265 adding manifests
336 adding file changes
266 adding file changes
337 added 7 changesets with 4 changes to 4 files
267 added 7 changesets with 4 changes to 4 files
338 new changesets 93ee6ab32777:03fc0b0e347c (7 drafts)
268 new changesets 93ee6ab32777:03fc0b0e347c (7 drafts)
339 (run 'hg update' to get a working copy)
269 (run 'hg update' to get a working copy)
340
270
341 revision 9
271 revision 9
342
272
343 $ hg tip -q
273 $ hg tip -q
344 9:03fc0b0e347c
274 9:03fc0b0e347c
345 $ hg verify
275 $ hg verify -q
346 checking changesets
347 checking manifests
348 crosschecking files in changesets and manifests
349 checking files
350 checked 10 changesets with 7 changes to 4 files
351
276
352 $ cd ..
277 $ cd ..
@@ -1,1127 +1,1107
1 Setting up test
1 Setting up test
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ echo 0 > afile
5 $ echo 0 > afile
6 $ hg add afile
6 $ hg add afile
7 $ hg commit -m "0.0"
7 $ hg commit -m "0.0"
8 $ echo 1 >> afile
8 $ echo 1 >> afile
9 $ hg commit -m "0.1"
9 $ hg commit -m "0.1"
10 $ echo 2 >> afile
10 $ echo 2 >> afile
11 $ hg commit -m "0.2"
11 $ hg commit -m "0.2"
12 $ echo 3 >> afile
12 $ echo 3 >> afile
13 $ hg commit -m "0.3"
13 $ hg commit -m "0.3"
14 $ hg update -C 0
14 $ hg update -C 0
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ echo 1 >> afile
16 $ echo 1 >> afile
17 $ hg commit -m "1.1"
17 $ hg commit -m "1.1"
18 created new head
18 created new head
19 $ echo 2 >> afile
19 $ echo 2 >> afile
20 $ hg commit -m "1.2"
20 $ hg commit -m "1.2"
21 $ echo "a line" > fred
21 $ echo "a line" > fred
22 $ echo 3 >> afile
22 $ echo 3 >> afile
23 $ hg add fred
23 $ hg add fred
24 $ hg commit -m "1.3"
24 $ hg commit -m "1.3"
25 $ hg mv afile adifferentfile
25 $ hg mv afile adifferentfile
26 $ hg commit -m "1.3m"
26 $ hg commit -m "1.3m"
27 $ hg update -C 3
27 $ hg update -C 3
28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
29 $ hg mv afile anotherfile
29 $ hg mv afile anotherfile
30 $ hg commit -m "0.3m"
30 $ hg commit -m "0.3m"
31 $ hg verify
31 $ hg verify -q
32 checking changesets
33 checking manifests
34 crosschecking files in changesets and manifests
35 checking files
36 checked 9 changesets with 7 changes to 4 files
37 $ cd ..
32 $ cd ..
38 $ hg init empty
33 $ hg init empty
39
34
40 Bundle and phase
35 Bundle and phase
41
36
42 $ hg -R test phase --force --secret 0
37 $ hg -R test phase --force --secret 0
43 $ hg -R test bundle phase.hg empty
38 $ hg -R test bundle phase.hg empty
44 searching for changes
39 searching for changes
45 no changes found (ignored 9 secret changesets)
40 no changes found (ignored 9 secret changesets)
46 [1]
41 [1]
47 $ hg -R test phase --draft -r 'head()'
42 $ hg -R test phase --draft -r 'head()'
48
43
49 Bundle --all
44 Bundle --all
50
45
51 $ hg -R test bundle --all all.hg
46 $ hg -R test bundle --all all.hg
52 9 changesets found
47 9 changesets found
53
48
54 Bundle test to full.hg
49 Bundle test to full.hg
55
50
56 $ hg -R test bundle full.hg empty
51 $ hg -R test bundle full.hg empty
57 searching for changes
52 searching for changes
58 9 changesets found
53 9 changesets found
59
54
60 Unbundle full.hg in test
55 Unbundle full.hg in test
61
56
62 $ hg -R test unbundle full.hg
57 $ hg -R test unbundle full.hg
63 adding changesets
58 adding changesets
64 adding manifests
59 adding manifests
65 adding file changes
60 adding file changes
66 added 0 changesets with 0 changes to 4 files
61 added 0 changesets with 0 changes to 4 files
67 (run 'hg update' to get a working copy)
62 (run 'hg update' to get a working copy)
68
63
69 Verify empty
64 Verify empty
70
65
71 $ hg -R empty heads
66 $ hg -R empty heads
72 [1]
67 [1]
73 $ hg -R empty verify
68 $ hg -R empty verify -q
74 checking changesets
75 checking manifests
76 crosschecking files in changesets and manifests
77 checking files
78 checked 0 changesets with 0 changes to 0 files
79
69
80 #if repobundlerepo
70 #if repobundlerepo
81
71
82 Pull full.hg into test (using --cwd)
72 Pull full.hg into test (using --cwd)
83
73
84 $ hg --cwd test pull ../full.hg
74 $ hg --cwd test pull ../full.hg
85 pulling from ../full.hg
75 pulling from ../full.hg
86 searching for changes
76 searching for changes
87 no changes found
77 no changes found
88
78
89 Verify that there are no leaked temporary files after pull (issue2797)
79 Verify that there are no leaked temporary files after pull (issue2797)
90
80
91 $ ls test/.hg | grep .hg10un
81 $ ls test/.hg | grep .hg10un
92 [1]
82 [1]
93
83
94 Pull full.hg into empty (using --cwd)
84 Pull full.hg into empty (using --cwd)
95
85
96 $ hg --cwd empty pull ../full.hg
86 $ hg --cwd empty pull ../full.hg
97 pulling from ../full.hg
87 pulling from ../full.hg
98 requesting all changes
88 requesting all changes
99 adding changesets
89 adding changesets
100 adding manifests
90 adding manifests
101 adding file changes
91 adding file changes
102 added 9 changesets with 7 changes to 4 files (+1 heads)
92 added 9 changesets with 7 changes to 4 files (+1 heads)
103 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
93 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
104 (run 'hg heads' to see heads, 'hg merge' to merge)
94 (run 'hg heads' to see heads, 'hg merge' to merge)
105
95
106 Rollback empty
96 Rollback empty
107
97
108 $ hg -R empty rollback
98 $ hg -R empty rollback
109 repository tip rolled back to revision -1 (undo pull)
99 repository tip rolled back to revision -1 (undo pull)
110
100
111 Pull full.hg into empty again (using --cwd)
101 Pull full.hg into empty again (using --cwd)
112
102
113 $ hg --cwd empty pull ../full.hg
103 $ hg --cwd empty pull ../full.hg
114 pulling from ../full.hg
104 pulling from ../full.hg
115 requesting all changes
105 requesting all changes
116 adding changesets
106 adding changesets
117 adding manifests
107 adding manifests
118 adding file changes
108 adding file changes
119 added 9 changesets with 7 changes to 4 files (+1 heads)
109 added 9 changesets with 7 changes to 4 files (+1 heads)
120 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
110 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
121 (run 'hg heads' to see heads, 'hg merge' to merge)
111 (run 'hg heads' to see heads, 'hg merge' to merge)
122
112
123 Pull full.hg into test (using -R)
113 Pull full.hg into test (using -R)
124
114
125 $ hg -R test pull full.hg
115 $ hg -R test pull full.hg
126 pulling from full.hg
116 pulling from full.hg
127 searching for changes
117 searching for changes
128 no changes found
118 no changes found
129
119
130 Pull full.hg into empty (using -R)
120 Pull full.hg into empty (using -R)
131
121
132 $ hg -R empty pull full.hg
122 $ hg -R empty pull full.hg
133 pulling from full.hg
123 pulling from full.hg
134 searching for changes
124 searching for changes
135 no changes found
125 no changes found
136
126
137 Rollback empty
127 Rollback empty
138
128
139 $ hg -R empty rollback
129 $ hg -R empty rollback
140 repository tip rolled back to revision -1 (undo pull)
130 repository tip rolled back to revision -1 (undo pull)
141
131
142 Pull full.hg into empty again (using -R)
132 Pull full.hg into empty again (using -R)
143
133
144 $ hg -R empty pull full.hg
134 $ hg -R empty pull full.hg
145 pulling from full.hg
135 pulling from full.hg
146 requesting all changes
136 requesting all changes
147 adding changesets
137 adding changesets
148 adding manifests
138 adding manifests
149 adding file changes
139 adding file changes
150 added 9 changesets with 7 changes to 4 files (+1 heads)
140 added 9 changesets with 7 changes to 4 files (+1 heads)
151 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
141 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
142 (run 'hg heads' to see heads, 'hg merge' to merge)
153
143
154 Log -R full.hg in fresh empty
144 Log -R full.hg in fresh empty
155
145
156 $ rm -r empty
146 $ rm -r empty
157 $ hg init empty
147 $ hg init empty
158 $ cd empty
148 $ cd empty
159 $ hg -R bundle://../full.hg log
149 $ hg -R bundle://../full.hg log
160 changeset: 8:aa35859c02ea
150 changeset: 8:aa35859c02ea
161 tag: tip
151 tag: tip
162 parent: 3:eebf5a27f8ca
152 parent: 3:eebf5a27f8ca
163 user: test
153 user: test
164 date: Thu Jan 01 00:00:00 1970 +0000
154 date: Thu Jan 01 00:00:00 1970 +0000
165 summary: 0.3m
155 summary: 0.3m
166
156
167 changeset: 7:a6a34bfa0076
157 changeset: 7:a6a34bfa0076
168 user: test
158 user: test
169 date: Thu Jan 01 00:00:00 1970 +0000
159 date: Thu Jan 01 00:00:00 1970 +0000
170 summary: 1.3m
160 summary: 1.3m
171
161
172 changeset: 6:7373c1169842
162 changeset: 6:7373c1169842
173 user: test
163 user: test
174 date: Thu Jan 01 00:00:00 1970 +0000
164 date: Thu Jan 01 00:00:00 1970 +0000
175 summary: 1.3
165 summary: 1.3
176
166
177 changeset: 5:1bb50a9436a7
167 changeset: 5:1bb50a9436a7
178 user: test
168 user: test
179 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
180 summary: 1.2
170 summary: 1.2
181
171
182 changeset: 4:095197eb4973
172 changeset: 4:095197eb4973
183 parent: 0:f9ee2f85a263
173 parent: 0:f9ee2f85a263
184 user: test
174 user: test
185 date: Thu Jan 01 00:00:00 1970 +0000
175 date: Thu Jan 01 00:00:00 1970 +0000
186 summary: 1.1
176 summary: 1.1
187
177
188 changeset: 3:eebf5a27f8ca
178 changeset: 3:eebf5a27f8ca
189 user: test
179 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
180 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: 0.3
181 summary: 0.3
192
182
193 changeset: 2:e38ba6f5b7e0
183 changeset: 2:e38ba6f5b7e0
194 user: test
184 user: test
195 date: Thu Jan 01 00:00:00 1970 +0000
185 date: Thu Jan 01 00:00:00 1970 +0000
196 summary: 0.2
186 summary: 0.2
197
187
198 changeset: 1:34c2bf6b0626
188 changeset: 1:34c2bf6b0626
199 user: test
189 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
190 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: 0.1
191 summary: 0.1
202
192
203 changeset: 0:f9ee2f85a263
193 changeset: 0:f9ee2f85a263
204 user: test
194 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
195 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: 0.0
196 summary: 0.0
207
197
208 Make sure bundlerepo doesn't leak tempfiles (issue2491)
198 Make sure bundlerepo doesn't leak tempfiles (issue2491)
209
199
210 $ ls .hg
200 $ ls .hg
211 00changelog.i
201 00changelog.i
212 cache
202 cache
213 requires
203 requires
214 store
204 store
215 wcache
205 wcache
216
206
217 Pull ../full.hg into empty (with hook)
207 Pull ../full.hg into empty (with hook)
218
208
219 $ cat >> .hg/hgrc <<EOF
209 $ cat >> .hg/hgrc <<EOF
220 > [hooks]
210 > [hooks]
221 > changegroup = sh -c "printenv.py --line changegroup"
211 > changegroup = sh -c "printenv.py --line changegroup"
222 > EOF
212 > EOF
223
213
224 doesn't work (yet ?)
214 doesn't work (yet ?)
225 NOTE: msys is mangling the URL below
215 NOTE: msys is mangling the URL below
226
216
227 hg -R bundle://../full.hg verify
217 hg -R bundle://../full.hg verify
228
218
229 $ hg pull bundle://../full.hg
219 $ hg pull bundle://../full.hg
230 pulling from bundle:../full.hg
220 pulling from bundle:../full.hg
231 requesting all changes
221 requesting all changes
232 adding changesets
222 adding changesets
233 adding manifests
223 adding manifests
234 adding file changes
224 adding file changes
235 added 9 changesets with 7 changes to 4 files (+1 heads)
225 added 9 changesets with 7 changes to 4 files (+1 heads)
236 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
226 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
237 changegroup hook: HG_HOOKNAME=changegroup
227 changegroup hook: HG_HOOKNAME=changegroup
238 HG_HOOKTYPE=changegroup
228 HG_HOOKTYPE=changegroup
239 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
229 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
240 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
230 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
241 HG_SOURCE=pull
231 HG_SOURCE=pull
242 HG_TXNID=TXN:$ID$
232 HG_TXNID=TXN:$ID$
243 HG_TXNNAME=pull
233 HG_TXNNAME=pull
244 bundle:../full.hg (no-msys !)
234 bundle:../full.hg (no-msys !)
245 bundle;../full.hg (msys !)
235 bundle;../full.hg (msys !)
246 HG_URL=bundle:../full.hg (no-msys !)
236 HG_URL=bundle:../full.hg (no-msys !)
247 HG_URL=bundle;../full.hg (msys !)
237 HG_URL=bundle;../full.hg (msys !)
248
238
249 (run 'hg heads' to see heads, 'hg merge' to merge)
239 (run 'hg heads' to see heads, 'hg merge' to merge)
250
240
251 Rollback empty
241 Rollback empty
252
242
253 $ hg rollback
243 $ hg rollback
254 repository tip rolled back to revision -1 (undo pull)
244 repository tip rolled back to revision -1 (undo pull)
255 $ cd ..
245 $ cd ..
256
246
257 Log -R bundle:empty+full.hg
247 Log -R bundle:empty+full.hg
258
248
259 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
249 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
260 8 7 6 5 4 3 2 1 0
250 8 7 6 5 4 3 2 1 0
261
251
262 Pull full.hg into empty again (using -R; with hook)
252 Pull full.hg into empty again (using -R; with hook)
263
253
264 $ hg -R empty pull full.hg
254 $ hg -R empty pull full.hg
265 pulling from full.hg
255 pulling from full.hg
266 requesting all changes
256 requesting all changes
267 adding changesets
257 adding changesets
268 adding manifests
258 adding manifests
269 adding file changes
259 adding file changes
270 added 9 changesets with 7 changes to 4 files (+1 heads)
260 added 9 changesets with 7 changes to 4 files (+1 heads)
271 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
261 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
272 changegroup hook: HG_HOOKNAME=changegroup
262 changegroup hook: HG_HOOKNAME=changegroup
273 HG_HOOKTYPE=changegroup
263 HG_HOOKTYPE=changegroup
274 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
264 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
275 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
265 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
276 HG_SOURCE=pull
266 HG_SOURCE=pull
277 HG_TXNID=TXN:$ID$
267 HG_TXNID=TXN:$ID$
278 HG_TXNNAME=pull
268 HG_TXNNAME=pull
279 bundle:empty+full.hg
269 bundle:empty+full.hg
280 HG_URL=bundle:empty+full.hg
270 HG_URL=bundle:empty+full.hg
281
271
282 (run 'hg heads' to see heads, 'hg merge' to merge)
272 (run 'hg heads' to see heads, 'hg merge' to merge)
283
273
284 #endif
274 #endif
285
275
286 Cannot produce streaming clone bundles with "hg bundle"
276 Cannot produce streaming clone bundles with "hg bundle"
287
277
288 $ hg -R test bundle -t packed1 packed.hg
278 $ hg -R test bundle -t packed1 packed.hg
289 abort: packed bundles cannot be produced by "hg bundle"
279 abort: packed bundles cannot be produced by "hg bundle"
290 (use 'hg debugcreatestreamclonebundle')
280 (use 'hg debugcreatestreamclonebundle')
291 [10]
281 [10]
292
282
293 packed1 is produced properly
283 packed1 is produced properly
294
284
295
285
296 #if reporevlogstore rust
286 #if reporevlogstore rust
297
287
298 $ hg -R test debugcreatestreamclonebundle packed.hg
288 $ hg -R test debugcreatestreamclonebundle packed.hg
299 writing 2665 bytes for 6 files
289 writing 2665 bytes for 6 files
300 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
290 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
301
291
302 $ f -B 64 --size --sha1 --hexdump packed.hg
292 $ f -B 64 --size --sha1 --hexdump packed.hg
303 packed.hg: size=2865, sha1=353d10311f4befa195d9a1ca4b8e26518115c702
293 packed.hg: size=2865, sha1=353d10311f4befa195d9a1ca4b8e26518115c702
304 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
294 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
305 0010: 00 00 00 00 0a 69 00 3b 67 65 6e 65 72 61 6c 64 |.....i.;generald|
295 0010: 00 00 00 00 0a 69 00 3b 67 65 6e 65 72 61 6c 64 |.....i.;generald|
306 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 2d 63 6f 6d 70 |elta,revlog-comp|
296 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 2d 63 6f 6d 70 |elta,revlog-comp|
307 0030: 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c 72 65 76 |ression-zstd,rev|
297 0030: 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c 72 65 76 |ression-zstd,rev|
308 $ hg debugbundle --spec packed.hg
298 $ hg debugbundle --spec packed.hg
309 none-packed1;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog
299 none-packed1;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog
310 #endif
300 #endif
311
301
312 #if reporevlogstore no-rust zstd
302 #if reporevlogstore no-rust zstd
313
303
314 $ hg -R test debugcreatestreamclonebundle packed.hg
304 $ hg -R test debugcreatestreamclonebundle packed.hg
315 writing 2665 bytes for 6 files
305 writing 2665 bytes for 6 files
316 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
306 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
317
307
318 $ f -B 64 --size --sha1 --hexdump packed.hg
308 $ f -B 64 --size --sha1 --hexdump packed.hg
319 packed.hg: size=2865, sha1=353d10311f4befa195d9a1ca4b8e26518115c702
309 packed.hg: size=2865, sha1=353d10311f4befa195d9a1ca4b8e26518115c702
320 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
310 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
321 0010: 00 00 00 00 0a 69 00 3b 67 65 6e 65 72 61 6c 64 |.....i.;generald|
311 0010: 00 00 00 00 0a 69 00 3b 67 65 6e 65 72 61 6c 64 |.....i.;generald|
322 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 2d 63 6f 6d 70 |elta,revlog-comp|
312 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 2d 63 6f 6d 70 |elta,revlog-comp|
323 0030: 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c 72 65 76 |ression-zstd,rev|
313 0030: 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c 72 65 76 |ression-zstd,rev|
324 $ hg debugbundle --spec packed.hg
314 $ hg debugbundle --spec packed.hg
325 none-packed1;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog
315 none-packed1;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog
326 #endif
316 #endif
327
317
328 #if reporevlogstore no-rust no-zstd
318 #if reporevlogstore no-rust no-zstd
329
319
330 $ hg -R test debugcreatestreamclonebundle packed.hg
320 $ hg -R test debugcreatestreamclonebundle packed.hg
331 writing 2664 bytes for 6 files
321 writing 2664 bytes for 6 files
332 bundle requirements: generaldelta, revlogv1, sparserevlog
322 bundle requirements: generaldelta, revlogv1, sparserevlog
333
323
334 $ f -B 64 --size --sha1 --hexdump packed.hg
324 $ f -B 64 --size --sha1 --hexdump packed.hg
335 packed.hg: size=2840, sha1=12bf3eee3eb8a04c503ce2d29b48f0135c7edff5
325 packed.hg: size=2840, sha1=12bf3eee3eb8a04c503ce2d29b48f0135c7edff5
336 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
326 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
337 0010: 00 00 00 00 0a 68 00 23 67 65 6e 65 72 61 6c 64 |.....h.#generald|
327 0010: 00 00 00 00 0a 68 00 23 67 65 6e 65 72 61 6c 64 |.....h.#generald|
338 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 2c 73 70 |elta,revlogv1,sp|
328 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 2c 73 70 |elta,revlogv1,sp|
339 0030: 61 72 73 65 72 65 76 6c 6f 67 00 64 61 74 61 2f |arserevlog.data/|
329 0030: 61 72 73 65 72 65 76 6c 6f 67 00 64 61 74 61 2f |arserevlog.data/|
340 $ hg debugbundle --spec packed.hg
330 $ hg debugbundle --spec packed.hg
341 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog
331 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog
342 #endif
332 #endif
343
333
344 #if reporevlogstore
334 #if reporevlogstore
345
335
346 generaldelta requirement is not listed in stream clone bundles unless used
336 generaldelta requirement is not listed in stream clone bundles unless used
347
337
348 $ hg --config format.usegeneraldelta=false init testnongd
338 $ hg --config format.usegeneraldelta=false init testnongd
349 $ cd testnongd
339 $ cd testnongd
350 $ touch foo
340 $ touch foo
351 $ hg -q commit -A -m initial
341 $ hg -q commit -A -m initial
352 $ cd ..
342 $ cd ..
353
343
354 #endif
344 #endif
355
345
356 #if reporevlogstore rust
346 #if reporevlogstore rust
357
347
358 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
348 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
359 writing 301 bytes for 3 files
349 writing 301 bytes for 3 files
360 bundle requirements: revlog-compression-zstd, revlogv1
350 bundle requirements: revlog-compression-zstd, revlogv1
361
351
362 $ f -B 64 --size --sha1 --hexdump packednongd.hg
352 $ f -B 64 --size --sha1 --hexdump packednongd.hg
363 packednongd.hg: size=407, sha1=0b8714422b785ba8eb98c916b41ffd5fb994c9b5
353 packednongd.hg: size=407, sha1=0b8714422b785ba8eb98c916b41ffd5fb994c9b5
364 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
354 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
365 0010: 00 00 00 00 01 2d 00 21 72 65 76 6c 6f 67 2d 63 |.....-.!revlog-c|
355 0010: 00 00 00 00 01 2d 00 21 72 65 76 6c 6f 67 2d 63 |.....-.!revlog-c|
366 0020: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c |ompression-zstd,|
356 0020: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c |ompression-zstd,|
367 0030: 72 65 76 6c 6f 67 76 31 00 64 61 74 61 2f 66 6f |revlogv1.data/fo|
357 0030: 72 65 76 6c 6f 67 76 31 00 64 61 74 61 2f 66 6f |revlogv1.data/fo|
368
358
369 $ hg debugbundle --spec packednongd.hg
359 $ hg debugbundle --spec packednongd.hg
370 none-packed1;requirements%3Drevlog-compression-zstd%2Crevlogv1
360 none-packed1;requirements%3Drevlog-compression-zstd%2Crevlogv1
371
361
372 #endif
362 #endif
373
363
374 #if reporevlogstore no-rust zstd
364 #if reporevlogstore no-rust zstd
375
365
376 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
366 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
377 writing 301 bytes for 3 files
367 writing 301 bytes for 3 files
378 bundle requirements: revlog-compression-zstd, revlogv1
368 bundle requirements: revlog-compression-zstd, revlogv1
379
369
380 $ f -B 64 --size --sha1 --hexdump packednongd.hg
370 $ f -B 64 --size --sha1 --hexdump packednongd.hg
381 packednongd.hg: size=407, sha1=0b8714422b785ba8eb98c916b41ffd5fb994c9b5
371 packednongd.hg: size=407, sha1=0b8714422b785ba8eb98c916b41ffd5fb994c9b5
382 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
372 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
383 0010: 00 00 00 00 01 2d 00 21 72 65 76 6c 6f 67 2d 63 |.....-.!revlog-c|
373 0010: 00 00 00 00 01 2d 00 21 72 65 76 6c 6f 67 2d 63 |.....-.!revlog-c|
384 0020: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c |ompression-zstd,|
374 0020: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c |ompression-zstd,|
385 0030: 72 65 76 6c 6f 67 76 31 00 64 61 74 61 2f 66 6f |revlogv1.data/fo|
375 0030: 72 65 76 6c 6f 67 76 31 00 64 61 74 61 2f 66 6f |revlogv1.data/fo|
386
376
387 $ hg debugbundle --spec packednongd.hg
377 $ hg debugbundle --spec packednongd.hg
388 none-packed1;requirements%3Drevlog-compression-zstd%2Crevlogv1
378 none-packed1;requirements%3Drevlog-compression-zstd%2Crevlogv1
389
379
390
380
391 #endif
381 #endif
392
382
393 #if reporevlogstore no-rust no-zstd
383 #if reporevlogstore no-rust no-zstd
394
384
395 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
385 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
396 writing 301 bytes for 3 files
386 writing 301 bytes for 3 files
397 bundle requirements: revlogv1
387 bundle requirements: revlogv1
398
388
399 $ f -B 64 --size --sha1 --hexdump packednongd.hg
389 $ f -B 64 --size --sha1 --hexdump packednongd.hg
400 packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
390 packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
401 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
391 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
402 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
392 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
403 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
393 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
404 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
394 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
405
395
406 $ hg debugbundle --spec packednongd.hg
396 $ hg debugbundle --spec packednongd.hg
407 none-packed1;requirements%3Drevlogv1
397 none-packed1;requirements%3Drevlogv1
408
398
409
399
410 #endif
400 #endif
411
401
412 #if reporevlogstore
402 #if reporevlogstore
413
403
414 Warning emitted when packed bundles contain secret changesets
404 Warning emitted when packed bundles contain secret changesets
415
405
416 $ hg init testsecret
406 $ hg init testsecret
417 $ cd testsecret
407 $ cd testsecret
418 $ touch foo
408 $ touch foo
419 $ hg -q commit -A -m initial
409 $ hg -q commit -A -m initial
420 $ hg phase --force --secret -r .
410 $ hg phase --force --secret -r .
421 $ cd ..
411 $ cd ..
422
412
423 #endif
413 #endif
424
414
425 #if reporevlogstore rust
415 #if reporevlogstore rust
426
416
427 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
417 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
428 (warning: stream clone bundle will contain secret revisions)
418 (warning: stream clone bundle will contain secret revisions)
429 writing 301 bytes for 3 files
419 writing 301 bytes for 3 files
430 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
420 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
431
421
432 #endif
422 #endif
433
423
434 #if reporevlogstore no-rust zstd
424 #if reporevlogstore no-rust zstd
435
425
436 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
426 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
437 (warning: stream clone bundle will contain secret revisions)
427 (warning: stream clone bundle will contain secret revisions)
438 writing 301 bytes for 3 files
428 writing 301 bytes for 3 files
439 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
429 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
440
430
441 #endif
431 #endif
442
432
443 #if reporevlogstore no-rust no-zstd
433 #if reporevlogstore no-rust no-zstd
444
434
445 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
435 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
446 (warning: stream clone bundle will contain secret revisions)
436 (warning: stream clone bundle will contain secret revisions)
447 writing 301 bytes for 3 files
437 writing 301 bytes for 3 files
448 bundle requirements: generaldelta, revlogv1, sparserevlog
438 bundle requirements: generaldelta, revlogv1, sparserevlog
449
439
450 #endif
440 #endif
451
441
452 #if reporevlogstore
442 #if reporevlogstore
453
443
454 Unpacking packed1 bundles with "hg unbundle" isn't allowed
444 Unpacking packed1 bundles with "hg unbundle" isn't allowed
455
445
456 $ hg init packed
446 $ hg init packed
457 $ hg -R packed unbundle packed.hg
447 $ hg -R packed unbundle packed.hg
458 abort: packed bundles cannot be applied with "hg unbundle"
448 abort: packed bundles cannot be applied with "hg unbundle"
459 (use "hg debugapplystreamclonebundle")
449 (use "hg debugapplystreamclonebundle")
460 [10]
450 [10]
461
451
462 packed1 can be consumed from debug command
452 packed1 can be consumed from debug command
463
453
464 (this also confirms that streamclone-ed changes are visible via
454 (this also confirms that streamclone-ed changes are visible via
465 @filecache properties to in-process procedures before closing
455 @filecache properties to in-process procedures before closing
466 transaction)
456 transaction)
467
457
468 $ cat > $TESTTMP/showtip.py <<EOF
458 $ cat > $TESTTMP/showtip.py <<EOF
469 >
459 >
470 > def showtip(ui, repo, hooktype, **kwargs):
460 > def showtip(ui, repo, hooktype, **kwargs):
471 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
461 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
472 >
462 >
473 > def reposetup(ui, repo):
463 > def reposetup(ui, repo):
474 > # this confirms (and ensures) that (empty) 00changelog.i
464 > # this confirms (and ensures) that (empty) 00changelog.i
475 > # before streamclone is already cached as repo.changelog
465 > # before streamclone is already cached as repo.changelog
476 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
466 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
477 >
467 >
478 > # this confirms that streamclone-ed changes are visible to
468 > # this confirms that streamclone-ed changes are visible to
479 > # in-process procedures before closing transaction
469 > # in-process procedures before closing transaction
480 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
470 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
481 >
471 >
482 > # this confirms that streamclone-ed changes are still visible
472 > # this confirms that streamclone-ed changes are still visible
483 > # after closing transaction
473 > # after closing transaction
484 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
474 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
485 > EOF
475 > EOF
486 $ cat >> $HGRCPATH <<EOF
476 $ cat >> $HGRCPATH <<EOF
487 > [extensions]
477 > [extensions]
488 > showtip = $TESTTMP/showtip.py
478 > showtip = $TESTTMP/showtip.py
489 > EOF
479 > EOF
490
480
491 $ hg -R packed debugapplystreamclonebundle packed.hg
481 $ hg -R packed debugapplystreamclonebundle packed.hg
492 6 files to transfer, 2.60 KB of data
482 6 files to transfer, 2.60 KB of data
493 pretxnopen: 000000000000
483 pretxnopen: 000000000000
494 pretxnclose: aa35859c02ea
484 pretxnclose: aa35859c02ea
495 transferred 2.60 KB in * seconds (* */sec) (glob)
485 transferred 2.60 KB in * seconds (* */sec) (glob)
496 txnclose: aa35859c02ea
486 txnclose: aa35859c02ea
497
487
498 (for safety, confirm visibility of streamclone-ed changes by another
488 (for safety, confirm visibility of streamclone-ed changes by another
499 process, too)
489 process, too)
500
490
501 $ hg -R packed tip -T "{node|short}\n"
491 $ hg -R packed tip -T "{node|short}\n"
502 aa35859c02ea
492 aa35859c02ea
503
493
504 $ cat >> $HGRCPATH <<EOF
494 $ cat >> $HGRCPATH <<EOF
505 > [extensions]
495 > [extensions]
506 > showtip = !
496 > showtip = !
507 > EOF
497 > EOF
508
498
509 Does not work on non-empty repo
499 Does not work on non-empty repo
510
500
511 $ hg -R packed debugapplystreamclonebundle packed.hg
501 $ hg -R packed debugapplystreamclonebundle packed.hg
512 abort: cannot apply stream clone bundle on non-empty repo
502 abort: cannot apply stream clone bundle on non-empty repo
513 [255]
503 [255]
514
504
515 #endif
505 #endif
516
506
517 Create partial clones
507 Create partial clones
518
508
519 $ rm -r empty
509 $ rm -r empty
520 $ hg init empty
510 $ hg init empty
521 $ hg clone -r 3 test partial
511 $ hg clone -r 3 test partial
522 adding changesets
512 adding changesets
523 adding manifests
513 adding manifests
524 adding file changes
514 adding file changes
525 added 4 changesets with 4 changes to 1 files
515 added 4 changesets with 4 changes to 1 files
526 new changesets f9ee2f85a263:eebf5a27f8ca
516 new changesets f9ee2f85a263:eebf5a27f8ca
527 updating to branch default
517 updating to branch default
528 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
518 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
529 $ hg clone partial partial2
519 $ hg clone partial partial2
530 updating to branch default
520 updating to branch default
531 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
521 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
532 $ cd partial
522 $ cd partial
533
523
534 #if repobundlerepo
524 #if repobundlerepo
535
525
536 Log -R full.hg in partial
526 Log -R full.hg in partial
537
527
538 $ hg -R bundle://../full.hg log -T phases
528 $ hg -R bundle://../full.hg log -T phases
539 changeset: 8:aa35859c02ea
529 changeset: 8:aa35859c02ea
540 tag: tip
530 tag: tip
541 phase: draft
531 phase: draft
542 parent: 3:eebf5a27f8ca
532 parent: 3:eebf5a27f8ca
543 user: test
533 user: test
544 date: Thu Jan 01 00:00:00 1970 +0000
534 date: Thu Jan 01 00:00:00 1970 +0000
545 summary: 0.3m
535 summary: 0.3m
546
536
547 changeset: 7:a6a34bfa0076
537 changeset: 7:a6a34bfa0076
548 phase: draft
538 phase: draft
549 user: test
539 user: test
550 date: Thu Jan 01 00:00:00 1970 +0000
540 date: Thu Jan 01 00:00:00 1970 +0000
551 summary: 1.3m
541 summary: 1.3m
552
542
553 changeset: 6:7373c1169842
543 changeset: 6:7373c1169842
554 phase: draft
544 phase: draft
555 user: test
545 user: test
556 date: Thu Jan 01 00:00:00 1970 +0000
546 date: Thu Jan 01 00:00:00 1970 +0000
557 summary: 1.3
547 summary: 1.3
558
548
559 changeset: 5:1bb50a9436a7
549 changeset: 5:1bb50a9436a7
560 phase: draft
550 phase: draft
561 user: test
551 user: test
562 date: Thu Jan 01 00:00:00 1970 +0000
552 date: Thu Jan 01 00:00:00 1970 +0000
563 summary: 1.2
553 summary: 1.2
564
554
565 changeset: 4:095197eb4973
555 changeset: 4:095197eb4973
566 phase: draft
556 phase: draft
567 parent: 0:f9ee2f85a263
557 parent: 0:f9ee2f85a263
568 user: test
558 user: test
569 date: Thu Jan 01 00:00:00 1970 +0000
559 date: Thu Jan 01 00:00:00 1970 +0000
570 summary: 1.1
560 summary: 1.1
571
561
572 changeset: 3:eebf5a27f8ca
562 changeset: 3:eebf5a27f8ca
573 phase: public
563 phase: public
574 user: test
564 user: test
575 date: Thu Jan 01 00:00:00 1970 +0000
565 date: Thu Jan 01 00:00:00 1970 +0000
576 summary: 0.3
566 summary: 0.3
577
567
578 changeset: 2:e38ba6f5b7e0
568 changeset: 2:e38ba6f5b7e0
579 phase: public
569 phase: public
580 user: test
570 user: test
581 date: Thu Jan 01 00:00:00 1970 +0000
571 date: Thu Jan 01 00:00:00 1970 +0000
582 summary: 0.2
572 summary: 0.2
583
573
584 changeset: 1:34c2bf6b0626
574 changeset: 1:34c2bf6b0626
585 phase: public
575 phase: public
586 user: test
576 user: test
587 date: Thu Jan 01 00:00:00 1970 +0000
577 date: Thu Jan 01 00:00:00 1970 +0000
588 summary: 0.1
578 summary: 0.1
589
579
590 changeset: 0:f9ee2f85a263
580 changeset: 0:f9ee2f85a263
591 phase: public
581 phase: public
592 user: test
582 user: test
593 date: Thu Jan 01 00:00:00 1970 +0000
583 date: Thu Jan 01 00:00:00 1970 +0000
594 summary: 0.0
584 summary: 0.0
595
585
596
586
597 Incoming full.hg in partial
587 Incoming full.hg in partial
598
588
599 $ hg incoming bundle://../full.hg
589 $ hg incoming bundle://../full.hg
600 comparing with bundle:../full.hg
590 comparing with bundle:../full.hg
601 searching for changes
591 searching for changes
602 changeset: 4:095197eb4973
592 changeset: 4:095197eb4973
603 parent: 0:f9ee2f85a263
593 parent: 0:f9ee2f85a263
604 user: test
594 user: test
605 date: Thu Jan 01 00:00:00 1970 +0000
595 date: Thu Jan 01 00:00:00 1970 +0000
606 summary: 1.1
596 summary: 1.1
607
597
608 changeset: 5:1bb50a9436a7
598 changeset: 5:1bb50a9436a7
609 user: test
599 user: test
610 date: Thu Jan 01 00:00:00 1970 +0000
600 date: Thu Jan 01 00:00:00 1970 +0000
611 summary: 1.2
601 summary: 1.2
612
602
613 changeset: 6:7373c1169842
603 changeset: 6:7373c1169842
614 user: test
604 user: test
615 date: Thu Jan 01 00:00:00 1970 +0000
605 date: Thu Jan 01 00:00:00 1970 +0000
616 summary: 1.3
606 summary: 1.3
617
607
618 changeset: 7:a6a34bfa0076
608 changeset: 7:a6a34bfa0076
619 user: test
609 user: test
620 date: Thu Jan 01 00:00:00 1970 +0000
610 date: Thu Jan 01 00:00:00 1970 +0000
621 summary: 1.3m
611 summary: 1.3m
622
612
623 changeset: 8:aa35859c02ea
613 changeset: 8:aa35859c02ea
624 tag: tip
614 tag: tip
625 parent: 3:eebf5a27f8ca
615 parent: 3:eebf5a27f8ca
626 user: test
616 user: test
627 date: Thu Jan 01 00:00:00 1970 +0000
617 date: Thu Jan 01 00:00:00 1970 +0000
628 summary: 0.3m
618 summary: 0.3m
629
619
630
620
631 Outgoing -R full.hg vs partial2 in partial
621 Outgoing -R full.hg vs partial2 in partial
632
622
633 $ hg -R bundle://../full.hg outgoing ../partial2
623 $ hg -R bundle://../full.hg outgoing ../partial2
634 comparing with ../partial2
624 comparing with ../partial2
635 searching for changes
625 searching for changes
636 changeset: 4:095197eb4973
626 changeset: 4:095197eb4973
637 parent: 0:f9ee2f85a263
627 parent: 0:f9ee2f85a263
638 user: test
628 user: test
639 date: Thu Jan 01 00:00:00 1970 +0000
629 date: Thu Jan 01 00:00:00 1970 +0000
640 summary: 1.1
630 summary: 1.1
641
631
642 changeset: 5:1bb50a9436a7
632 changeset: 5:1bb50a9436a7
643 user: test
633 user: test
644 date: Thu Jan 01 00:00:00 1970 +0000
634 date: Thu Jan 01 00:00:00 1970 +0000
645 summary: 1.2
635 summary: 1.2
646
636
647 changeset: 6:7373c1169842
637 changeset: 6:7373c1169842
648 user: test
638 user: test
649 date: Thu Jan 01 00:00:00 1970 +0000
639 date: Thu Jan 01 00:00:00 1970 +0000
650 summary: 1.3
640 summary: 1.3
651
641
652 changeset: 7:a6a34bfa0076
642 changeset: 7:a6a34bfa0076
653 user: test
643 user: test
654 date: Thu Jan 01 00:00:00 1970 +0000
644 date: Thu Jan 01 00:00:00 1970 +0000
655 summary: 1.3m
645 summary: 1.3m
656
646
657 changeset: 8:aa35859c02ea
647 changeset: 8:aa35859c02ea
658 tag: tip
648 tag: tip
659 parent: 3:eebf5a27f8ca
649 parent: 3:eebf5a27f8ca
660 user: test
650 user: test
661 date: Thu Jan 01 00:00:00 1970 +0000
651 date: Thu Jan 01 00:00:00 1970 +0000
662 summary: 0.3m
652 summary: 0.3m
663
653
664
654
665 Outgoing -R does-not-exist.hg vs partial2 in partial
655 Outgoing -R does-not-exist.hg vs partial2 in partial
666
656
667 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
657 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
668 abort: *../does-not-exist.hg* (glob)
658 abort: *../does-not-exist.hg* (glob)
669 [255]
659 [255]
670
660
671 #endif
661 #endif
672
662
673 $ cd ..
663 $ cd ..
674
664
675 hide outer repo
665 hide outer repo
676 $ hg init
666 $ hg init
677
667
678 Direct clone from bundle (all-history)
668 Direct clone from bundle (all-history)
679
669
680 #if repobundlerepo
670 #if repobundlerepo
681
671
682 $ hg clone full.hg full-clone
672 $ hg clone full.hg full-clone
683 requesting all changes
673 requesting all changes
684 adding changesets
674 adding changesets
685 adding manifests
675 adding manifests
686 adding file changes
676 adding file changes
687 added 9 changesets with 7 changes to 4 files (+1 heads)
677 added 9 changesets with 7 changes to 4 files (+1 heads)
688 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
678 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
689 updating to branch default
679 updating to branch default
690 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
680 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
691 $ hg -R full-clone heads
681 $ hg -R full-clone heads
692 changeset: 8:aa35859c02ea
682 changeset: 8:aa35859c02ea
693 tag: tip
683 tag: tip
694 parent: 3:eebf5a27f8ca
684 parent: 3:eebf5a27f8ca
695 user: test
685 user: test
696 date: Thu Jan 01 00:00:00 1970 +0000
686 date: Thu Jan 01 00:00:00 1970 +0000
697 summary: 0.3m
687 summary: 0.3m
698
688
699 changeset: 7:a6a34bfa0076
689 changeset: 7:a6a34bfa0076
700 user: test
690 user: test
701 date: Thu Jan 01 00:00:00 1970 +0000
691 date: Thu Jan 01 00:00:00 1970 +0000
702 summary: 1.3m
692 summary: 1.3m
703
693
704 $ rm -r full-clone
694 $ rm -r full-clone
705
695
706 When cloning from a non-copiable repository into '', do not
696 When cloning from a non-copiable repository into '', do not
707 recurse infinitely (issue2528)
697 recurse infinitely (issue2528)
708
698
709 $ hg clone full.hg ''
699 $ hg clone full.hg ''
710 abort: empty destination path is not valid
700 abort: empty destination path is not valid
711 [10]
701 [10]
712
702
713 test for https://bz.mercurial-scm.org/216
703 test for https://bz.mercurial-scm.org/216
714
704
715 Unbundle incremental bundles into fresh empty in one go
705 Unbundle incremental bundles into fresh empty in one go
716
706
717 $ rm -r empty
707 $ rm -r empty
718 $ hg init empty
708 $ hg init empty
719 $ hg -R test bundle --base null -r 0 ../0.hg
709 $ hg -R test bundle --base null -r 0 ../0.hg
720 1 changesets found
710 1 changesets found
721 $ hg -R test bundle --exact -r 1 ../1.hg
711 $ hg -R test bundle --exact -r 1 ../1.hg
722 1 changesets found
712 1 changesets found
723 $ hg -R empty unbundle -u ../0.hg ../1.hg
713 $ hg -R empty unbundle -u ../0.hg ../1.hg
724 adding changesets
714 adding changesets
725 adding manifests
715 adding manifests
726 adding file changes
716 adding file changes
727 added 1 changesets with 1 changes to 1 files
717 added 1 changesets with 1 changes to 1 files
728 new changesets f9ee2f85a263 (1 drafts)
718 new changesets f9ee2f85a263 (1 drafts)
729 adding changesets
719 adding changesets
730 adding manifests
720 adding manifests
731 adding file changes
721 adding file changes
732 added 1 changesets with 1 changes to 1 files
722 added 1 changesets with 1 changes to 1 files
733 new changesets 34c2bf6b0626 (1 drafts)
723 new changesets 34c2bf6b0626 (1 drafts)
734 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
724 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
735
725
736 View full contents of the bundle
726 View full contents of the bundle
737 $ hg -R test bundle --base null -r 3 ../partial.hg
727 $ hg -R test bundle --base null -r 3 ../partial.hg
738 4 changesets found
728 4 changesets found
739 $ cd test
729 $ cd test
740 $ hg -R ../../partial.hg log -r "bundle()"
730 $ hg -R ../../partial.hg log -r "bundle()"
741 changeset: 0:f9ee2f85a263
731 changeset: 0:f9ee2f85a263
742 user: test
732 user: test
743 date: Thu Jan 01 00:00:00 1970 +0000
733 date: Thu Jan 01 00:00:00 1970 +0000
744 summary: 0.0
734 summary: 0.0
745
735
746 changeset: 1:34c2bf6b0626
736 changeset: 1:34c2bf6b0626
747 user: test
737 user: test
748 date: Thu Jan 01 00:00:00 1970 +0000
738 date: Thu Jan 01 00:00:00 1970 +0000
749 summary: 0.1
739 summary: 0.1
750
740
751 changeset: 2:e38ba6f5b7e0
741 changeset: 2:e38ba6f5b7e0
752 user: test
742 user: test
753 date: Thu Jan 01 00:00:00 1970 +0000
743 date: Thu Jan 01 00:00:00 1970 +0000
754 summary: 0.2
744 summary: 0.2
755
745
756 changeset: 3:eebf5a27f8ca
746 changeset: 3:eebf5a27f8ca
757 user: test
747 user: test
758 date: Thu Jan 01 00:00:00 1970 +0000
748 date: Thu Jan 01 00:00:00 1970 +0000
759 summary: 0.3
749 summary: 0.3
760
750
761 $ cd ..
751 $ cd ..
762
752
763 #endif
753 #endif
764
754
765 test for 540d1059c802
755 test for 540d1059c802
766
756
767 $ hg init orig
757 $ hg init orig
768 $ cd orig
758 $ cd orig
769 $ echo foo > foo
759 $ echo foo > foo
770 $ hg add foo
760 $ hg add foo
771 $ hg ci -m 'add foo'
761 $ hg ci -m 'add foo'
772
762
773 $ hg clone . ../copy
763 $ hg clone . ../copy
774 updating to branch default
764 updating to branch default
775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
765 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
776 $ hg tag foo
766 $ hg tag foo
777
767
778 $ cd ../copy
768 $ cd ../copy
779 $ echo >> foo
769 $ echo >> foo
780 $ hg ci -m 'change foo'
770 $ hg ci -m 'change foo'
781 $ hg bundle ../bundle.hg ../orig
771 $ hg bundle ../bundle.hg ../orig
782 searching for changes
772 searching for changes
783 1 changesets found
773 1 changesets found
784
774
785 $ cd ..
775 $ cd ..
786
776
787 #if repobundlerepo
777 #if repobundlerepo
788 $ cd orig
778 $ cd orig
789 $ hg incoming ../bundle.hg
779 $ hg incoming ../bundle.hg
790 comparing with ../bundle.hg
780 comparing with ../bundle.hg
791 searching for changes
781 searching for changes
792 changeset: 2:ed1b79f46b9a
782 changeset: 2:ed1b79f46b9a
793 tag: tip
783 tag: tip
794 parent: 0:bbd179dfa0a7
784 parent: 0:bbd179dfa0a7
795 user: test
785 user: test
796 date: Thu Jan 01 00:00:00 1970 +0000
786 date: Thu Jan 01 00:00:00 1970 +0000
797 summary: change foo
787 summary: change foo
798
788
799 $ cd ..
789 $ cd ..
800
790
801 test bundle with # in the filename (issue2154):
791 test bundle with # in the filename (issue2154):
802
792
803 $ cp bundle.hg 'test#bundle.hg'
793 $ cp bundle.hg 'test#bundle.hg'
804 $ cd orig
794 $ cd orig
805 $ hg incoming '../test#bundle.hg'
795 $ hg incoming '../test#bundle.hg'
806 comparing with ../test
796 comparing with ../test
807 abort: unknown revision 'bundle.hg'
797 abort: unknown revision 'bundle.hg'
808 [10]
798 [10]
809
799
810 note that percent encoding is not handled:
800 note that percent encoding is not handled:
811
801
812 $ hg incoming ../test%23bundle.hg
802 $ hg incoming ../test%23bundle.hg
813 abort: repository ../test%23bundle.hg not found
803 abort: repository ../test%23bundle.hg not found
814 [255]
804 [255]
815 $ cd ..
805 $ cd ..
816
806
817 #endif
807 #endif
818
808
819 test to bundle revisions on the newly created branch (issue3828):
809 test to bundle revisions on the newly created branch (issue3828):
820
810
821 $ hg -q clone -U test test-clone
811 $ hg -q clone -U test test-clone
822 $ cd test
812 $ cd test
823
813
824 $ hg -q branch foo
814 $ hg -q branch foo
825 $ hg commit -m "create foo branch"
815 $ hg commit -m "create foo branch"
826 $ hg -q outgoing ../test-clone
816 $ hg -q outgoing ../test-clone
827 9:b4f5acb1ee27
817 9:b4f5acb1ee27
828 $ hg -q bundle --branch foo foo.hg ../test-clone
818 $ hg -q bundle --branch foo foo.hg ../test-clone
829 #if repobundlerepo
819 #if repobundlerepo
830 $ hg -R foo.hg -q log -r "bundle()"
820 $ hg -R foo.hg -q log -r "bundle()"
831 9:b4f5acb1ee27
821 9:b4f5acb1ee27
832 #endif
822 #endif
833
823
834 $ cd ..
824 $ cd ..
835
825
836 test for https://bz.mercurial-scm.org/1144
826 test for https://bz.mercurial-scm.org/1144
837
827
838 test that verify bundle does not traceback
828 test that verify bundle does not traceback
839
829
840 partial history bundle, fails w/ unknown parent
830 partial history bundle, fails w/ unknown parent
841
831
842 $ hg -R bundle.hg verify
832 $ hg -R bundle.hg verify
843 abort: 00changelog@bbd179dfa0a71671c253b3ae0aa1513b60d199fa: unknown parent
833 abort: 00changelog@bbd179dfa0a71671c253b3ae0aa1513b60d199fa: unknown parent
844 [50]
834 [50]
845
835
846 full history bundle, refuses to verify non-local repo
836 full history bundle, refuses to verify non-local repo
847
837
848 #if repobundlerepo
838 #if repobundlerepo
849 $ hg -R all.hg verify
839 $ hg -R all.hg verify
850 abort: cannot verify bundle or remote repos
840 abort: cannot verify bundle or remote repos
851 [255]
841 [255]
852 #endif
842 #endif
853
843
854 but, regular verify must continue to work
844 but, regular verify must continue to work
855
845
856 $ hg -R orig verify
846 $ hg -R orig verify -q
857 checking changesets
858 checking manifests
859 crosschecking files in changesets and manifests
860 checking files
861 checked 2 changesets with 2 changes to 2 files
862
847
863 #if repobundlerepo
848 #if repobundlerepo
864 diff against bundle
849 diff against bundle
865
850
866 $ hg init b
851 $ hg init b
867 $ cd b
852 $ cd b
868 $ hg -R ../all.hg diff -r tip
853 $ hg -R ../all.hg diff -r tip
869 diff -r aa35859c02ea anotherfile
854 diff -r aa35859c02ea anotherfile
870 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
855 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
871 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
856 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
872 @@ -1,4 +0,0 @@
857 @@ -1,4 +0,0 @@
873 -0
858 -0
874 -1
859 -1
875 -2
860 -2
876 -3
861 -3
877 $ cd ..
862 $ cd ..
878 #endif
863 #endif
879
864
880 bundle single branch
865 bundle single branch
881
866
882 $ hg init branchy
867 $ hg init branchy
883 $ cd branchy
868 $ cd branchy
884 $ echo a >a
869 $ echo a >a
885 $ echo x >x
870 $ echo x >x
886 $ hg ci -Ama
871 $ hg ci -Ama
887 adding a
872 adding a
888 adding x
873 adding x
889 $ echo c >c
874 $ echo c >c
890 $ echo xx >x
875 $ echo xx >x
891 $ hg ci -Amc
876 $ hg ci -Amc
892 adding c
877 adding c
893 $ echo c1 >c1
878 $ echo c1 >c1
894 $ hg ci -Amc1
879 $ hg ci -Amc1
895 adding c1
880 adding c1
896 $ hg up 0
881 $ hg up 0
897 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
882 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
898 $ echo b >b
883 $ echo b >b
899 $ hg ci -Amb
884 $ hg ci -Amb
900 adding b
885 adding b
901 created new head
886 created new head
902 $ echo b1 >b1
887 $ echo b1 >b1
903 $ echo xx >x
888 $ echo xx >x
904 $ hg ci -Amb1
889 $ hg ci -Amb1
905 adding b1
890 adding b1
906 $ hg clone -q -r2 . part
891 $ hg clone -q -r2 . part
907
892
908 == bundling via incoming
893 == bundling via incoming
909
894
910 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
895 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
911 comparing with .
896 comparing with .
912 searching for changes
897 searching for changes
913 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
898 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
914 057f4db07f61970e1c11e83be79e9d08adc4dc31
899 057f4db07f61970e1c11e83be79e9d08adc4dc31
915
900
916 == bundling
901 == bundling
917
902
918 $ hg bundle bundle.hg part --debug --config progress.debug=true
903 $ hg bundle bundle.hg part --debug --config progress.debug=true
919 query 1; heads
904 query 1; heads
920 searching for changes
905 searching for changes
921 all remote heads known locally
906 all remote heads known locally
922 2 changesets found
907 2 changesets found
923 list of changesets:
908 list of changesets:
924 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
909 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
925 057f4db07f61970e1c11e83be79e9d08adc4dc31
910 057f4db07f61970e1c11e83be79e9d08adc4dc31
926 bundle2-output-bundle: "HG20", (1 params) 2 parts total
911 bundle2-output-bundle: "HG20", (1 params) 2 parts total
927 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
912 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
928 changesets: 1/2 chunks (50.00%)
913 changesets: 1/2 chunks (50.00%)
929 changesets: 2/2 chunks (100.00%)
914 changesets: 2/2 chunks (100.00%)
930 manifests: 1/2 chunks (50.00%)
915 manifests: 1/2 chunks (50.00%)
931 manifests: 2/2 chunks (100.00%)
916 manifests: 2/2 chunks (100.00%)
932 files: b 1/3 files (33.33%)
917 files: b 1/3 files (33.33%)
933 files: b1 2/3 files (66.67%)
918 files: b1 2/3 files (66.67%)
934 files: x 3/3 files (100.00%)
919 files: x 3/3 files (100.00%)
935 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
920 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
936
921
937 #if repobundlerepo
922 #if repobundlerepo
938 == Test for issue3441
923 == Test for issue3441
939
924
940 $ hg clone -q -r0 . part2
925 $ hg clone -q -r0 . part2
941 $ hg -q -R part2 pull bundle.hg
926 $ hg -q -R part2 pull bundle.hg
942 $ hg -R part2 verify
927 $ hg -R part2 verify -q
943 checking changesets
944 checking manifests
945 crosschecking files in changesets and manifests
946 checking files
947 checked 3 changesets with 5 changes to 4 files
948 #endif
928 #endif
949
929
950 == Test bundling no commits
930 == Test bundling no commits
951
931
952 $ hg bundle -r 'public()' no-output.hg
932 $ hg bundle -r 'public()' no-output.hg
953 abort: no commits to bundle
933 abort: no commits to bundle
954 [10]
934 [10]
955
935
956 $ cd ..
936 $ cd ..
957
937
958 When user merges to the revision existing only in the bundle,
938 When user merges to the revision existing only in the bundle,
959 it should show warning that second parent of the working
939 it should show warning that second parent of the working
960 directory does not exist
940 directory does not exist
961
941
962 $ hg init update2bundled
942 $ hg init update2bundled
963 $ cd update2bundled
943 $ cd update2bundled
964 $ cat <<EOF >> .hg/hgrc
944 $ cat <<EOF >> .hg/hgrc
965 > [extensions]
945 > [extensions]
966 > strip =
946 > strip =
967 > EOF
947 > EOF
968 $ echo "aaa" >> a
948 $ echo "aaa" >> a
969 $ hg commit -A -m 0
949 $ hg commit -A -m 0
970 adding a
950 adding a
971 $ echo "bbb" >> b
951 $ echo "bbb" >> b
972 $ hg commit -A -m 1
952 $ hg commit -A -m 1
973 adding b
953 adding b
974 $ echo "ccc" >> c
954 $ echo "ccc" >> c
975 $ hg commit -A -m 2
955 $ hg commit -A -m 2
976 adding c
956 adding c
977 $ hg update -r 1
957 $ hg update -r 1
978 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
958 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
979 $ echo "ddd" >> d
959 $ echo "ddd" >> d
980 $ hg commit -A -m 3
960 $ hg commit -A -m 3
981 adding d
961 adding d
982 created new head
962 created new head
983 $ hg update -r 2
963 $ hg update -r 2
984 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
964 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
985 $ hg log -G
965 $ hg log -G
986 o changeset: 3:8bd3e1f196af
966 o changeset: 3:8bd3e1f196af
987 | tag: tip
967 | tag: tip
988 | parent: 1:a01eca7af26d
968 | parent: 1:a01eca7af26d
989 | user: test
969 | user: test
990 | date: Thu Jan 01 00:00:00 1970 +0000
970 | date: Thu Jan 01 00:00:00 1970 +0000
991 | summary: 3
971 | summary: 3
992 |
972 |
993 | @ changeset: 2:4652c276ac4f
973 | @ changeset: 2:4652c276ac4f
994 |/ user: test
974 |/ user: test
995 | date: Thu Jan 01 00:00:00 1970 +0000
975 | date: Thu Jan 01 00:00:00 1970 +0000
996 | summary: 2
976 | summary: 2
997 |
977 |
998 o changeset: 1:a01eca7af26d
978 o changeset: 1:a01eca7af26d
999 | user: test
979 | user: test
1000 | date: Thu Jan 01 00:00:00 1970 +0000
980 | date: Thu Jan 01 00:00:00 1970 +0000
1001 | summary: 1
981 | summary: 1
1002 |
982 |
1003 o changeset: 0:4fe08cd4693e
983 o changeset: 0:4fe08cd4693e
1004 user: test
984 user: test
1005 date: Thu Jan 01 00:00:00 1970 +0000
985 date: Thu Jan 01 00:00:00 1970 +0000
1006 summary: 0
986 summary: 0
1007
987
1008
988
1009 #if repobundlerepo
989 #if repobundlerepo
1010 $ hg bundle --base 1 -r 3 ../update2bundled.hg
990 $ hg bundle --base 1 -r 3 ../update2bundled.hg
1011 1 changesets found
991 1 changesets found
1012 $ hg strip -r 3
992 $ hg strip -r 3
1013 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
993 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
1014 $ hg merge -R ../update2bundled.hg -r 3
994 $ hg merge -R ../update2bundled.hg -r 3
1015 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
995 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
1016 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
996 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1017 (branch merge, don't forget to commit)
997 (branch merge, don't forget to commit)
1018
998
1019 When user updates to the revision existing only in the bundle,
999 When user updates to the revision existing only in the bundle,
1020 it should show warning
1000 it should show warning
1021
1001
1022 $ hg update -R ../update2bundled.hg --clean -r 3
1002 $ hg update -R ../update2bundled.hg --clean -r 3
1023 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
1003 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
1024 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1004 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1025
1005
1026 When user updates to the revision existing in the local repository
1006 When user updates to the revision existing in the local repository
1027 the warning shouldn't be emitted
1007 the warning shouldn't be emitted
1028
1008
1029 $ hg update -R ../update2bundled.hg -r 0
1009 $ hg update -R ../update2bundled.hg -r 0
1030 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1010 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1031 #endif
1011 #endif
1032
1012
1033 Test the option that create slim bundle
1013 Test the option that create slim bundle
1034
1014
1035 $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg
1015 $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg
1036 3 changesets found
1016 3 changesets found
1037
1017
1038 Test the option that create and no-delta's bundle
1018 Test the option that create and no-delta's bundle
1039 $ hg bundle -a --config devel.bundle.delta=full ./full.hg
1019 $ hg bundle -a --config devel.bundle.delta=full ./full.hg
1040 3 changesets found
1020 3 changesets found
1041
1021
1042
1022
1043 Test the debug statistic when building a bundle
1023 Test the debug statistic when building a bundle
1044 -----------------------------------------------
1024 -----------------------------------------------
1045
1025
1046 $ hg bundle -a ./default.hg --config debug.bundling-stats=yes
1026 $ hg bundle -a ./default.hg --config debug.bundling-stats=yes
1047 3 changesets found
1027 3 changesets found
1048 DEBUG-BUNDLING: revisions: 9
1028 DEBUG-BUNDLING: revisions: 9
1049 DEBUG-BUNDLING: changelog: 3
1029 DEBUG-BUNDLING: changelog: 3
1050 DEBUG-BUNDLING: manifest: 3
1030 DEBUG-BUNDLING: manifest: 3
1051 DEBUG-BUNDLING: files: 3 (for 3 revlogs)
1031 DEBUG-BUNDLING: files: 3 (for 3 revlogs)
1052 DEBUG-BUNDLING: deltas:
1032 DEBUG-BUNDLING: deltas:
1053 DEBUG-BUNDLING: from-storage: 2 (100% of available 2)
1033 DEBUG-BUNDLING: from-storage: 2 (100% of available 2)
1054 DEBUG-BUNDLING: computed: 7
1034 DEBUG-BUNDLING: computed: 7
1055 DEBUG-BUNDLING: full: 7 (100% of native 7)
1035 DEBUG-BUNDLING: full: 7 (100% of native 7)
1056 DEBUG-BUNDLING: changelog: 3 (100% of native 3)
1036 DEBUG-BUNDLING: changelog: 3 (100% of native 3)
1057 DEBUG-BUNDLING: manifests: 1 (100% of native 1)
1037 DEBUG-BUNDLING: manifests: 1 (100% of native 1)
1058 DEBUG-BUNDLING: files: 3 (100% of native 3)
1038 DEBUG-BUNDLING: files: 3 (100% of native 3)
1059
1039
1060 Test the debug output when applying delta
1040 Test the debug output when applying delta
1061 -----------------------------------------
1041 -----------------------------------------
1062
1042
1063 $ hg init foo
1043 $ hg init foo
1064 $ hg -R foo unbundle ./slim.hg \
1044 $ hg -R foo unbundle ./slim.hg \
1065 > --config debug.revlog.debug-delta=yes \
1045 > --config debug.revlog.debug-delta=yes \
1066 > --config storage.revlog.reuse-external-delta=no \
1046 > --config storage.revlog.reuse-external-delta=no \
1067 > --config storage.revlog.reuse-external-delta-parent=no
1047 > --config storage.revlog.reuse-external-delta-parent=no
1068 adding changesets
1048 adding changesets
1069 DBG-DELTAS: CHANGELOG: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1049 DBG-DELTAS: CHANGELOG: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1070 DBG-DELTAS: CHANGELOG: rev=1: delta-base=1 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1050 DBG-DELTAS: CHANGELOG: rev=1: delta-base=1 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1071 DBG-DELTAS: CHANGELOG: rev=2: delta-base=2 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1051 DBG-DELTAS: CHANGELOG: rev=2: delta-base=2 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1072 adding manifests
1052 adding manifests
1073 DBG-DELTAS: MANIFESTLOG: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1053 DBG-DELTAS: MANIFESTLOG: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1074 DBG-DELTAS: MANIFESTLOG: rev=1: delta-base=0 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1054 DBG-DELTAS: MANIFESTLOG: rev=1: delta-base=0 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1075 DBG-DELTAS: MANIFESTLOG: rev=2: delta-base=1 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=0 - p1-chain-length=1 p2-chain-length=-1 - duration=* (glob)
1055 DBG-DELTAS: MANIFESTLOG: rev=2: delta-base=1 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=0 - p1-chain-length=1 p2-chain-length=-1 - duration=* (glob)
1076 adding file changes
1056 adding file changes
1077 DBG-DELTAS: FILELOG:a: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1057 DBG-DELTAS: FILELOG:a: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1078 DBG-DELTAS: FILELOG:b: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1058 DBG-DELTAS: FILELOG:b: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1079 DBG-DELTAS: FILELOG:c: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1059 DBG-DELTAS: FILELOG:c: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1080 added 3 changesets with 3 changes to 3 files
1060 added 3 changesets with 3 changes to 3 files
1081 new changesets 4fe08cd4693e:4652c276ac4f (3 drafts)
1061 new changesets 4fe08cd4693e:4652c276ac4f (3 drafts)
1082 (run 'hg update' to get a working copy)
1062 (run 'hg update' to get a working copy)
1083
1063
1084
1064
1085 Test the debug statistic when applying a bundle
1065 Test the debug statistic when applying a bundle
1086 -----------------------------------------------
1066 -----------------------------------------------
1087
1067
1088 $ hg init bar
1068 $ hg init bar
1089 $ hg -R bar unbundle ./default.hg --config debug.unbundling-stats=yes
1069 $ hg -R bar unbundle ./default.hg --config debug.unbundling-stats=yes
1090 adding changesets
1070 adding changesets
1091 adding manifests
1071 adding manifests
1092 adding file changes
1072 adding file changes
1093 DEBUG-UNBUNDLING: revisions: 9
1073 DEBUG-UNBUNDLING: revisions: 9
1094 DEBUG-UNBUNDLING: changelog: 3 ( 33%)
1074 DEBUG-UNBUNDLING: changelog: 3 ( 33%)
1095 DEBUG-UNBUNDLING: manifests: 3 ( 33%)
1075 DEBUG-UNBUNDLING: manifests: 3 ( 33%)
1096 DEBUG-UNBUNDLING: files: 3 ( 33%)
1076 DEBUG-UNBUNDLING: files: 3 ( 33%)
1097 DEBUG-UNBUNDLING: total-time: ?????????????? seconds (glob)
1077 DEBUG-UNBUNDLING: total-time: ?????????????? seconds (glob)
1098 DEBUG-UNBUNDLING: changelog: ?????????????? seconds (???%) (glob)
1078 DEBUG-UNBUNDLING: changelog: ?????????????? seconds (???%) (glob)
1099 DEBUG-UNBUNDLING: manifests: ?????????????? seconds (???%) (glob)
1079 DEBUG-UNBUNDLING: manifests: ?????????????? seconds (???%) (glob)
1100 DEBUG-UNBUNDLING: files: ?????????????? seconds (???%) (glob)
1080 DEBUG-UNBUNDLING: files: ?????????????? seconds (???%) (glob)
1101 DEBUG-UNBUNDLING: type-count:
1081 DEBUG-UNBUNDLING: type-count:
1102 DEBUG-UNBUNDLING: changelog:
1082 DEBUG-UNBUNDLING: changelog:
1103 DEBUG-UNBUNDLING: full: 3
1083 DEBUG-UNBUNDLING: full: 3
1104 DEBUG-UNBUNDLING: cached: 3 (100%)
1084 DEBUG-UNBUNDLING: cached: 3 (100%)
1105 DEBUG-UNBUNDLING: manifests:
1085 DEBUG-UNBUNDLING: manifests:
1106 DEBUG-UNBUNDLING: full: 1
1086 DEBUG-UNBUNDLING: full: 1
1107 DEBUG-UNBUNDLING: cached: 1 (100%)
1087 DEBUG-UNBUNDLING: cached: 1 (100%)
1108 DEBUG-UNBUNDLING: delta: 2
1088 DEBUG-UNBUNDLING: delta: 2
1109 DEBUG-UNBUNDLING: cached: 2 (100%)
1089 DEBUG-UNBUNDLING: cached: 2 (100%)
1110 DEBUG-UNBUNDLING: files:
1090 DEBUG-UNBUNDLING: files:
1111 DEBUG-UNBUNDLING: full: 3
1091 DEBUG-UNBUNDLING: full: 3
1112 DEBUG-UNBUNDLING: cached: 3 (100%)
1092 DEBUG-UNBUNDLING: cached: 3 (100%)
1113 DEBUG-UNBUNDLING: type-time:
1093 DEBUG-UNBUNDLING: type-time:
1114 DEBUG-UNBUNDLING: changelog:
1094 DEBUG-UNBUNDLING: changelog:
1115 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1095 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1116 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1096 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1117 DEBUG-UNBUNDLING: manifests:
1097 DEBUG-UNBUNDLING: manifests:
1118 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1098 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1119 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1099 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1120 DEBUG-UNBUNDLING: delta: ?????????????? seconds (???% of total) (glob)
1100 DEBUG-UNBUNDLING: delta: ?????????????? seconds (???% of total) (glob)
1121 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1101 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1122 DEBUG-UNBUNDLING: files:
1102 DEBUG-UNBUNDLING: files:
1123 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1103 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1124 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1104 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1125 added 3 changesets with 3 changes to 3 files
1105 added 3 changesets with 3 changes to 3 files
1126 new changesets 4fe08cd4693e:4652c276ac4f (3 drafts)
1106 new changesets 4fe08cd4693e:4652c276ac4f (3 drafts)
1127 (run 'hg update' to get a working copy)
1107 (run 'hg update' to get a working copy)
@@ -1,561 +1,531
1 #require no-reposimplestore
1 #require no-reposimplestore
2 #testcases revlogv1 revlogv2
2 #testcases revlogv1 revlogv2
3
3
4 #if revlogv2
4 #if revlogv2
5
5
6 $ cat >> $HGRCPATH <<EOF
6 $ cat >> $HGRCPATH <<EOF
7 > [experimental]
7 > [experimental]
8 > revlogv2=enable-unstable-format-and-corrupt-my-data
8 > revlogv2=enable-unstable-format-and-corrupt-my-data
9 > EOF
9 > EOF
10
10
11 #endif
11 #endif
12
12
13 $ cp $HGRCPATH $HGRCPATH.orig
13 $ cp $HGRCPATH $HGRCPATH.orig
14
14
15 Create repo with unimpeachable content
15 Create repo with unimpeachable content
16
16
17 $ hg init r
17 $ hg init r
18 $ cd r
18 $ cd r
19 $ echo 'Initially untainted file' > target
19 $ echo 'Initially untainted file' > target
20 $ echo 'Normal file here' > bystander
20 $ echo 'Normal file here' > bystander
21 $ hg add target bystander
21 $ hg add target bystander
22 $ hg ci -m init
22 $ hg ci -m init
23
23
24 Clone repo so we can test pull later
24 Clone repo so we can test pull later
25
25
26 $ cd ..
26 $ cd ..
27 $ hg clone r rpull
27 $ hg clone r rpull
28 updating to branch default
28 updating to branch default
29 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 $ cd r
30 $ cd r
31
31
32 Introduce content which will ultimately require censorship. Name the first
32 Introduce content which will ultimately require censorship. Name the first
33 censored node C1, second C2, and so on
33 censored node C1, second C2, and so on
34
34
35 $ echo 'Tainted file' > target
35 $ echo 'Tainted file' > target
36 $ echo 'Passwords: hunter2' >> target
36 $ echo 'Passwords: hunter2' >> target
37 $ hg ci -m taint target
37 $ hg ci -m taint target
38 $ C1=`hg id --debug -i`
38 $ C1=`hg id --debug -i`
39
39
40 $ echo 'hunter3' >> target
40 $ echo 'hunter3' >> target
41 $ echo 'Normal file v2' > bystander
41 $ echo 'Normal file v2' > bystander
42 $ hg ci -m moretaint target bystander
42 $ hg ci -m moretaint target bystander
43 $ C2=`hg id --debug -i`
43 $ C2=`hg id --debug -i`
44
44
45 Add a new sanitized versions to correct our mistake. Name the first head H1,
45 Add a new sanitized versions to correct our mistake. Name the first head H1,
46 the second head H2, and so on
46 the second head H2, and so on
47
47
48 $ echo 'Tainted file is now sanitized' > target
48 $ echo 'Tainted file is now sanitized' > target
49 $ hg ci -m sanitized target
49 $ hg ci -m sanitized target
50 $ H1=`hg id --debug -i`
50 $ H1=`hg id --debug -i`
51
51
52 $ hg update -r $C2
52 $ hg update -r $C2
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 $ echo 'Tainted file now super sanitized' > target
54 $ echo 'Tainted file now super sanitized' > target
55 $ hg ci -m 'super sanitized' target
55 $ hg ci -m 'super sanitized' target
56 created new head
56 created new head
57 $ H2=`hg id --debug -i`
57 $ H2=`hg id --debug -i`
58
58
59 Verify target contents before censorship at each revision
59 Verify target contents before censorship at each revision
60
60
61 $ hg cat -r $H1 target | head -n 10
61 $ hg cat -r $H1 target | head -n 10
62 Tainted file is now sanitized
62 Tainted file is now sanitized
63 $ hg cat -r $H2 target | head -n 10
63 $ hg cat -r $H2 target | head -n 10
64 Tainted file now super sanitized
64 Tainted file now super sanitized
65 $ hg cat -r $C2 target | head -n 10
65 $ hg cat -r $C2 target | head -n 10
66 Tainted file
66 Tainted file
67 Passwords: hunter2
67 Passwords: hunter2
68 hunter3
68 hunter3
69 $ hg cat -r $C1 target | head -n 10
69 $ hg cat -r $C1 target | head -n 10
70 Tainted file
70 Tainted file
71 Passwords: hunter2
71 Passwords: hunter2
72 $ hg cat -r 0 target | head -n 10
72 $ hg cat -r 0 target | head -n 10
73 Initially untainted file
73 Initially untainted file
74
74
75 Censor revision with 2 offenses
75 Censor revision with 2 offenses
76
76
77 (this also tests file pattern matching: path relative to cwd case)
77 (this also tests file pattern matching: path relative to cwd case)
78
78
79 $ mkdir -p foo/bar/baz
79 $ mkdir -p foo/bar/baz
80 $ hg --config extensions.censor= --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target
80 $ hg --config extensions.censor= --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target
81 $ hg cat -r $H1 target | head -n 10
81 $ hg cat -r $H1 target | head -n 10
82 Tainted file is now sanitized
82 Tainted file is now sanitized
83 $ hg cat -r $H2 target | head -n 10
83 $ hg cat -r $H2 target | head -n 10
84 Tainted file now super sanitized
84 Tainted file now super sanitized
85 $ hg cat -r $C2 target | head -n 10
85 $ hg cat -r $C2 target | head -n 10
86 abort: censored node: 1e0247a9a4b7
86 abort: censored node: 1e0247a9a4b7
87 (set censor.policy to ignore errors)
87 (set censor.policy to ignore errors)
88 $ hg cat -r $C1 target | head -n 10
88 $ hg cat -r $C1 target | head -n 10
89 Tainted file
89 Tainted file
90 Passwords: hunter2
90 Passwords: hunter2
91 $ hg cat -r 0 target | head -n 10
91 $ hg cat -r 0 target | head -n 10
92 Initially untainted file
92 Initially untainted file
93
93
94 Censor revision with 1 offense
94 Censor revision with 1 offense
95
95
96 (this also tests file pattern matching: with 'path:' scheme)
96 (this also tests file pattern matching: with 'path:' scheme)
97
97
98 $ hg --config extensions.censor= --cwd foo/bar/baz censor -r $C1 path:target
98 $ hg --config extensions.censor= --cwd foo/bar/baz censor -r $C1 path:target
99 $ hg cat -r $H1 target | head -n 10
99 $ hg cat -r $H1 target | head -n 10
100 Tainted file is now sanitized
100 Tainted file is now sanitized
101 $ hg cat -r $H2 target | head -n 10
101 $ hg cat -r $H2 target | head -n 10
102 Tainted file now super sanitized
102 Tainted file now super sanitized
103 $ hg cat -r $C2 target | head -n 10
103 $ hg cat -r $C2 target | head -n 10
104 abort: censored node: 1e0247a9a4b7
104 abort: censored node: 1e0247a9a4b7
105 (set censor.policy to ignore errors)
105 (set censor.policy to ignore errors)
106 $ hg cat -r $C1 target | head -n 10
106 $ hg cat -r $C1 target | head -n 10
107 abort: censored node: 613bc869fceb
107 abort: censored node: 613bc869fceb
108 (set censor.policy to ignore errors)
108 (set censor.policy to ignore errors)
109 $ hg cat -r 0 target | head -n 10
109 $ hg cat -r 0 target | head -n 10
110 Initially untainted file
110 Initially untainted file
111
111
112 Can only checkout target at uncensored revisions, -X is workaround for --all
112 Can only checkout target at uncensored revisions, -X is workaround for --all
113
113
114 $ hg revert -r $C2 target | head -n 10
114 $ hg revert -r $C2 target | head -n 10
115 abort: censored node: 1e0247a9a4b7
115 abort: censored node: 1e0247a9a4b7
116 (set censor.policy to ignore errors)
116 (set censor.policy to ignore errors)
117 $ hg revert -r $C1 target | head -n 10
117 $ hg revert -r $C1 target | head -n 10
118 abort: censored node: 613bc869fceb
118 abort: censored node: 613bc869fceb
119 (set censor.policy to ignore errors)
119 (set censor.policy to ignore errors)
120 $ hg revert -r $C1 --all
120 $ hg revert -r $C1 --all
121 reverting bystander
121 reverting bystander
122 reverting target
122 reverting target
123 abort: censored node: 613bc869fceb
123 abort: censored node: 613bc869fceb
124 (set censor.policy to ignore errors)
124 (set censor.policy to ignore errors)
125 [255]
125 [255]
126 $ hg revert -r $C1 --all -X target
126 $ hg revert -r $C1 --all -X target
127 $ cat target | head -n 10
127 $ cat target | head -n 10
128 Tainted file now super sanitized
128 Tainted file now super sanitized
129 $ hg revert -r 0 --all
129 $ hg revert -r 0 --all
130 reverting target
130 reverting target
131 $ cat target | head -n 10
131 $ cat target | head -n 10
132 Initially untainted file
132 Initially untainted file
133 $ hg revert -r $H2 --all
133 $ hg revert -r $H2 --all
134 reverting bystander
134 reverting bystander
135 reverting target
135 reverting target
136 $ cat target | head -n 10
136 $ cat target | head -n 10
137 Tainted file now super sanitized
137 Tainted file now super sanitized
138
138
139 Uncensored file can be viewed at any revision
139 Uncensored file can be viewed at any revision
140
140
141 $ hg cat -r $H1 bystander | head -n 10
141 $ hg cat -r $H1 bystander | head -n 10
142 Normal file v2
142 Normal file v2
143 $ hg cat -r $C2 bystander | head -n 10
143 $ hg cat -r $C2 bystander | head -n 10
144 Normal file v2
144 Normal file v2
145 $ hg cat -r $C1 bystander | head -n 10
145 $ hg cat -r $C1 bystander | head -n 10
146 Normal file here
146 Normal file here
147 $ hg cat -r 0 bystander | head -n 10
147 $ hg cat -r 0 bystander | head -n 10
148 Normal file here
148 Normal file here
149
149
150 Can update to children of censored revision
150 Can update to children of censored revision
151
151
152 $ hg update -r $H1
152 $ hg update -r $H1
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 $ cat target | head -n 10
154 $ cat target | head -n 10
155 Tainted file is now sanitized
155 Tainted file is now sanitized
156 $ hg update -r $H2
156 $ hg update -r $H2
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 $ cat target | head -n 10
158 $ cat target | head -n 10
159 Tainted file now super sanitized
159 Tainted file now super sanitized
160
160
161 Set censor policy to abort in trusted $HGRC so hg verify fails
161 Set censor policy to abort in trusted $HGRC so hg verify fails
162
162
163 $ cp $HGRCPATH.orig $HGRCPATH
163 $ cp $HGRCPATH.orig $HGRCPATH
164 $ cat >> $HGRCPATH <<EOF
164 $ cat >> $HGRCPATH <<EOF
165 > [censor]
165 > [censor]
166 > policy = abort
166 > policy = abort
167 > EOF
167 > EOF
168
168
169 Repo fails verification due to censorship
169 Repo fails verification due to censorship
170
170
171 $ hg verify
171 $ hg verify
172 checking changesets
172 checking changesets
173 checking manifests
173 checking manifests
174 crosschecking files in changesets and manifests
174 crosschecking files in changesets and manifests
175 checking files
175 checking files
176 target@1: censored file data
176 target@1: censored file data
177 target@2: censored file data
177 target@2: censored file data
178 checked 5 changesets with 7 changes to 2 files
178 checked 5 changesets with 7 changes to 2 files
179 2 integrity errors encountered!
179 2 integrity errors encountered!
180 (first damaged changeset appears to be 1)
180 (first damaged changeset appears to be 1)
181 [1]
181 [1]
182
182
183 Cannot update to revision with censored data
183 Cannot update to revision with censored data
184
184
185 $ hg update -r $C2
185 $ hg update -r $C2
186 abort: censored node: 1e0247a9a4b7
186 abort: censored node: 1e0247a9a4b7
187 (set censor.policy to ignore errors)
187 (set censor.policy to ignore errors)
188 [255]
188 [255]
189 $ hg update -r $C1
189 $ hg update -r $C1
190 abort: censored node: 613bc869fceb
190 abort: censored node: 613bc869fceb
191 (set censor.policy to ignore errors)
191 (set censor.policy to ignore errors)
192 [255]
192 [255]
193 $ hg update -r 0
193 $ hg update -r 0
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 $ hg update -r $H2
195 $ hg update -r $H2
196 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
196 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
197
197
198 Set censor policy to ignore in trusted $HGRC so hg verify passes
198 Set censor policy to ignore in trusted $HGRC so hg verify passes
199
199
200 $ cp $HGRCPATH.orig $HGRCPATH
200 $ cp $HGRCPATH.orig $HGRCPATH
201 $ cat >> $HGRCPATH <<EOF
201 $ cat >> $HGRCPATH <<EOF
202 > [censor]
202 > [censor]
203 > policy = ignore
203 > policy = ignore
204 > EOF
204 > EOF
205
205
206 Repo passes verification with warnings with explicit config
206 Repo passes verification with warnings with explicit config
207
207
208 $ hg verify
208 $ hg verify -q
209 checking changesets
210 checking manifests
211 crosschecking files in changesets and manifests
212 checking files
213 checked 5 changesets with 7 changes to 2 files
214
209
215 May update to revision with censored data with explicit config
210 May update to revision with censored data with explicit config
216
211
217 $ hg update -r $C2
212 $ hg update -r $C2
218 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 $ cat target | head -n 10
214 $ cat target | head -n 10
220 $ hg update -r $C1
215 $ hg update -r $C1
221 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 $ cat target | head -n 10
217 $ cat target | head -n 10
223 $ hg update -r 0
218 $ hg update -r 0
224 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
225 $ cat target | head -n 10
220 $ cat target | head -n 10
226 Initially untainted file
221 Initially untainted file
227 $ hg update -r $H2
222 $ hg update -r $H2
228 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
229 $ cat target | head -n 10
224 $ cat target | head -n 10
230 Tainted file now super sanitized
225 Tainted file now super sanitized
231
226
232 Can merge in revision with censored data. Test requires one branch of history
227 Can merge in revision with censored data. Test requires one branch of history
233 with the file censored, but we can't censor at a head, so advance H1.
228 with the file censored, but we can't censor at a head, so advance H1.
234
229
235 $ hg update -r $H1
230 $ hg update -r $H1
236 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 $ C3=$H1
232 $ C3=$H1
238 $ echo 'advanced head H1' > target
233 $ echo 'advanced head H1' > target
239 $ hg ci -m 'advance head H1' target
234 $ hg ci -m 'advance head H1' target
240 $ H1=`hg id --debug -i`
235 $ H1=`hg id --debug -i`
241 $ hg --config extensions.censor= censor -r $C3 target
236 $ hg --config extensions.censor= censor -r $C3 target
242 $ hg update -r $H2
237 $ hg update -r $H2
243 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 $ hg merge -r $C3
239 $ hg merge -r $C3
245 merging target
240 merging target
246 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
241 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
247 (branch merge, don't forget to commit)
242 (branch merge, don't forget to commit)
248
243
249 Revisions present in repository heads may not be censored
244 Revisions present in repository heads may not be censored
250
245
251 $ hg update -C -r $H2
246 $ hg update -C -r $H2
252 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 $ hg --config extensions.censor= censor -r $H2 target
248 $ hg --config extensions.censor= censor -r $H2 target
254 abort: cannot censor file in heads (78a8fc215e79)
249 abort: cannot censor file in heads (78a8fc215e79)
255 (clean/delete and commit first)
250 (clean/delete and commit first)
256 [255]
251 [255]
257 $ echo 'twiddling thumbs' > bystander
252 $ echo 'twiddling thumbs' > bystander
258 $ hg ci -m 'bystander commit'
253 $ hg ci -m 'bystander commit'
259 $ H2=`hg id --debug -i`
254 $ H2=`hg id --debug -i`
260 $ hg --config extensions.censor= censor -r "$H2^" target
255 $ hg --config extensions.censor= censor -r "$H2^" target
261 abort: cannot censor file in heads (efbe78065929)
256 abort: cannot censor file in heads (efbe78065929)
262 (clean/delete and commit first)
257 (clean/delete and commit first)
263 [255]
258 [255]
264
259
265 Cannot censor working directory
260 Cannot censor working directory
266
261
267 $ echo 'seriously no passwords' > target
262 $ echo 'seriously no passwords' > target
268 $ hg ci -m 'extend second head arbitrarily' target
263 $ hg ci -m 'extend second head arbitrarily' target
269 $ H2=`hg id --debug -i`
264 $ H2=`hg id --debug -i`
270 $ hg update -r "$H2^"
265 $ hg update -r "$H2^"
271 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 $ hg --config extensions.censor= censor -r . target
267 $ hg --config extensions.censor= censor -r . target
273 abort: cannot censor working directory
268 abort: cannot censor working directory
274 (clean/delete/update first)
269 (clean/delete/update first)
275 [255]
270 [255]
276 $ hg update -r $H2
271 $ hg update -r $H2
277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
278
273
279 Can re-add file after being deleted + censored
274 Can re-add file after being deleted + censored
280
275
281 $ C4=$H2
276 $ C4=$H2
282 $ hg rm target
277 $ hg rm target
283 $ hg ci -m 'delete target so it may be censored'
278 $ hg ci -m 'delete target so it may be censored'
284 $ H2=`hg id --debug -i`
279 $ H2=`hg id --debug -i`
285 $ hg --config extensions.censor= censor -r $C4 target
280 $ hg --config extensions.censor= censor -r $C4 target
286 $ hg cat -r $C4 target | head -n 10
281 $ hg cat -r $C4 target | head -n 10
287 $ hg cat -r "$H2^^" target | head -n 10
282 $ hg cat -r "$H2^^" target | head -n 10
288 Tainted file now super sanitized
283 Tainted file now super sanitized
289 $ echo 'fresh start' > target
284 $ echo 'fresh start' > target
290 $ hg add target
285 $ hg add target
291 $ hg ci -m reincarnated target
286 $ hg ci -m reincarnated target
292 $ H2=`hg id --debug -i`
287 $ H2=`hg id --debug -i`
293 $ hg cat -r $H2 target | head -n 10
288 $ hg cat -r $H2 target | head -n 10
294 fresh start
289 fresh start
295 $ hg cat -r "$H2^" target | head -n 10
290 $ hg cat -r "$H2^" target | head -n 10
296 target: no such file in rev 452ec1762369
291 target: no such file in rev 452ec1762369
297 $ hg cat -r $C4 target | head -n 10
292 $ hg cat -r $C4 target | head -n 10
298 $ hg cat -r "$H2^^^" target | head -n 10
293 $ hg cat -r "$H2^^^" target | head -n 10
299 Tainted file now super sanitized
294 Tainted file now super sanitized
300
295
301 Can censor after revlog has expanded to no longer permit inline storage
296 Can censor after revlog has expanded to no longer permit inline storage
302
297
303 $ for x in `"$PYTHON" $TESTDIR/seq.py 0 50000`
298 $ for x in `"$PYTHON" $TESTDIR/seq.py 0 50000`
304 > do
299 > do
305 > echo "Password: hunter$x" >> target
300 > echo "Password: hunter$x" >> target
306 > done
301 > done
307 $ hg ci -m 'add 100k passwords'
302 $ hg ci -m 'add 100k passwords'
308 $ H2=`hg id --debug -i`
303 $ H2=`hg id --debug -i`
309 $ C5=$H2
304 $ C5=$H2
310 $ hg revert -r "$H2^" target
305 $ hg revert -r "$H2^" target
311 $ hg ci -m 'cleaned 100k passwords'
306 $ hg ci -m 'cleaned 100k passwords'
312 $ H2=`hg id --debug -i`
307 $ H2=`hg id --debug -i`
313 $ hg --config extensions.censor= censor -r $C5 target
308 $ hg --config extensions.censor= censor -r $C5 target
314 $ hg cat -r $C5 target | head -n 10
309 $ hg cat -r $C5 target | head -n 10
315 $ hg cat -r $H2 target | head -n 10
310 $ hg cat -r $H2 target | head -n 10
316 fresh start
311 fresh start
317
312
318 Repo with censored nodes can be cloned and cloned nodes are censored
313 Repo with censored nodes can be cloned and cloned nodes are censored
319
314
320 $ cd ..
315 $ cd ..
321 $ hg clone r rclone
316 $ hg clone r rclone
322 updating to branch default
317 updating to branch default
323 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
318 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
324 $ cd rclone
319 $ cd rclone
325 $ hg cat -r $H1 target | head -n 10
320 $ hg cat -r $H1 target | head -n 10
326 advanced head H1
321 advanced head H1
327 $ hg cat -r $H2~5 target | head -n 10
322 $ hg cat -r $H2~5 target | head -n 10
328 Tainted file now super sanitized
323 Tainted file now super sanitized
329 $ hg cat -r $C2 target | head -n 10
324 $ hg cat -r $C2 target | head -n 10
330 $ hg cat -r $C1 target | head -n 10
325 $ hg cat -r $C1 target | head -n 10
331 $ hg cat -r 0 target | head -n 10
326 $ hg cat -r 0 target | head -n 10
332 Initially untainted file
327 Initially untainted file
333 $ hg verify
328 $ hg verify -q
334 checking changesets
335 checking manifests
336 crosschecking files in changesets and manifests
337 checking files
338 checked 12 changesets with 13 changes to 2 files
339
329
340 Repo cloned before tainted content introduced can pull censored nodes
330 Repo cloned before tainted content introduced can pull censored nodes
341
331
342 $ cd ../rpull
332 $ cd ../rpull
343 $ hg cat -r tip target | head -n 10
333 $ hg cat -r tip target | head -n 10
344 Initially untainted file
334 Initially untainted file
345 $ hg verify
335 $ hg verify -q
346 checking changesets
347 checking manifests
348 crosschecking files in changesets and manifests
349 checking files
350 checked 1 changesets with 2 changes to 2 files
351 $ hg pull -r $H1 -r $H2
336 $ hg pull -r $H1 -r $H2
352 pulling from $TESTTMP/r
337 pulling from $TESTTMP/r
353 searching for changes
338 searching for changes
354 adding changesets
339 adding changesets
355 adding manifests
340 adding manifests
356 adding file changes
341 adding file changes
357 added 11 changesets with 11 changes to 2 files (+1 heads)
342 added 11 changesets with 11 changes to 2 files (+1 heads)
358 new changesets 186fb27560c3:683e4645fded
343 new changesets 186fb27560c3:683e4645fded
359 (run 'hg heads' to see heads, 'hg merge' to merge)
344 (run 'hg heads' to see heads, 'hg merge' to merge)
360 $ hg update 4
345 $ hg update 4
361 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 $ cat target | head -n 10
347 $ cat target | head -n 10
363 Tainted file now super sanitized
348 Tainted file now super sanitized
364 $ hg cat -r $H1 target | head -n 10
349 $ hg cat -r $H1 target | head -n 10
365 advanced head H1
350 advanced head H1
366 $ hg cat -r $H2~5 target | head -n 10
351 $ hg cat -r $H2~5 target | head -n 10
367 Tainted file now super sanitized
352 Tainted file now super sanitized
368 $ hg cat -r $C2 target | head -n 10
353 $ hg cat -r $C2 target | head -n 10
369 $ hg cat -r $C1 target | head -n 10
354 $ hg cat -r $C1 target | head -n 10
370 $ hg cat -r 0 target | head -n 10
355 $ hg cat -r 0 target | head -n 10
371 Initially untainted file
356 Initially untainted file
372 $ hg verify
357 $ hg verify -q
373 checking changesets
374 checking manifests
375 crosschecking files in changesets and manifests
376 checking files
377 checked 12 changesets with 13 changes to 2 files
378
358
379 Censored nodes can be pushed if they censor previously unexchanged nodes
359 Censored nodes can be pushed if they censor previously unexchanged nodes
380
360
381 $ echo 'Passwords: hunter2hunter2' > target
361 $ echo 'Passwords: hunter2hunter2' > target
382 $ hg ci -m 're-add password from clone' target
362 $ hg ci -m 're-add password from clone' target
383 created new head
363 created new head
384 $ H3=`hg id --debug -i`
364 $ H3=`hg id --debug -i`
385 $ REV=$H3
365 $ REV=$H3
386 $ echo 'Re-sanitized; nothing to see here' > target
366 $ echo 'Re-sanitized; nothing to see here' > target
387 $ hg ci -m 're-sanitized' target
367 $ hg ci -m 're-sanitized' target
388 $ H2=`hg id --debug -i`
368 $ H2=`hg id --debug -i`
389 $ CLEANREV=$H2
369 $ CLEANREV=$H2
390 $ hg cat -r $REV target | head -n 10
370 $ hg cat -r $REV target | head -n 10
391 Passwords: hunter2hunter2
371 Passwords: hunter2hunter2
392 $ hg --config extensions.censor= censor -r $REV target
372 $ hg --config extensions.censor= censor -r $REV target
393 $ hg cat -r $REV target | head -n 10
373 $ hg cat -r $REV target | head -n 10
394 $ hg cat -r $CLEANREV target | head -n 10
374 $ hg cat -r $CLEANREV target | head -n 10
395 Re-sanitized; nothing to see here
375 Re-sanitized; nothing to see here
396 $ hg push -f -r $H2
376 $ hg push -f -r $H2
397 pushing to $TESTTMP/r
377 pushing to $TESTTMP/r
398 searching for changes
378 searching for changes
399 adding changesets
379 adding changesets
400 adding manifests
380 adding manifests
401 adding file changes
381 adding file changes
402 added 2 changesets with 2 changes to 1 files (+1 heads)
382 added 2 changesets with 2 changes to 1 files (+1 heads)
403
383
404 $ cd ../r
384 $ cd ../r
405 $ hg cat -r $REV target | head -n 10
385 $ hg cat -r $REV target | head -n 10
406 $ hg cat -r $CLEANREV target | head -n 10
386 $ hg cat -r $CLEANREV target | head -n 10
407 Re-sanitized; nothing to see here
387 Re-sanitized; nothing to see here
408 $ hg update $CLEANREV
388 $ hg update $CLEANREV
409 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
389 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
410 $ cat target | head -n 10
390 $ cat target | head -n 10
411 Re-sanitized; nothing to see here
391 Re-sanitized; nothing to see here
412
392
413 Censored nodes can be bundled up and unbundled in another repo
393 Censored nodes can be bundled up and unbundled in another repo
414
394
415 $ hg bundle --base 0 ../pwbundle
395 $ hg bundle --base 0 ../pwbundle
416 13 changesets found
396 13 changesets found
417 $ cd ../rclone
397 $ cd ../rclone
418 $ hg unbundle ../pwbundle
398 $ hg unbundle ../pwbundle
419 adding changesets
399 adding changesets
420 adding manifests
400 adding manifests
421 adding file changes
401 adding file changes
422 added 2 changesets with 2 changes to 2 files (+1 heads)
402 added 2 changesets with 2 changes to 2 files (+1 heads)
423 new changesets 075be80ac777:dcbaf17bf3a1 (2 drafts)
403 new changesets 075be80ac777:dcbaf17bf3a1 (2 drafts)
424 (run 'hg heads .' to see heads, 'hg merge' to merge)
404 (run 'hg heads .' to see heads, 'hg merge' to merge)
425 $ hg cat -r $REV target | head -n 10
405 $ hg cat -r $REV target | head -n 10
426 $ hg cat -r $CLEANREV target | head -n 10
406 $ hg cat -r $CLEANREV target | head -n 10
427 Re-sanitized; nothing to see here
407 Re-sanitized; nothing to see here
428 $ hg update $CLEANREV
408 $ hg update $CLEANREV
429 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
409 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
430 $ cat target | head -n 10
410 $ cat target | head -n 10
431 Re-sanitized; nothing to see here
411 Re-sanitized; nothing to see here
432 $ hg verify
412 $ hg verify -q
433 checking changesets
434 checking manifests
435 crosschecking files in changesets and manifests
436 checking files
437 checked 14 changesets with 15 changes to 2 files
438
413
439 Grepping only warns, doesn't error out
414 Grepping only warns, doesn't error out
440
415
441 $ cd ../rpull
416 $ cd ../rpull
442 $ hg grep 'Normal file'
417 $ hg grep 'Normal file'
443 bystander:Normal file v2
418 bystander:Normal file v2
444 $ hg grep nothing
419 $ hg grep nothing
445 target:Re-sanitized; nothing to see here
420 target:Re-sanitized; nothing to see here
446 $ hg grep --diff 'Normal file'
421 $ hg grep --diff 'Normal file'
447 cannot search in censored file: target:7
422 cannot search in censored file: target:7
448 cannot search in censored file: target:10
423 cannot search in censored file: target:10
449 cannot search in censored file: target:12
424 cannot search in censored file: target:12
450 bystander:6:-:Normal file v2
425 bystander:6:-:Normal file v2
451 cannot search in censored file: target:1
426 cannot search in censored file: target:1
452 cannot search in censored file: target:2
427 cannot search in censored file: target:2
453 cannot search in censored file: target:3
428 cannot search in censored file: target:3
454 bystander:2:-:Normal file here
429 bystander:2:-:Normal file here
455 bystander:2:+:Normal file v2
430 bystander:2:+:Normal file v2
456 bystander:0:+:Normal file here
431 bystander:0:+:Normal file here
457 $ hg grep --diff nothing
432 $ hg grep --diff nothing
458 cannot search in censored file: target:7
433 cannot search in censored file: target:7
459 cannot search in censored file: target:10
434 cannot search in censored file: target:10
460 cannot search in censored file: target:12
435 cannot search in censored file: target:12
461 target:13:+:Re-sanitized; nothing to see here
436 target:13:+:Re-sanitized; nothing to see here
462 cannot search in censored file: target:1
437 cannot search in censored file: target:1
463 cannot search in censored file: target:2
438 cannot search in censored file: target:2
464 cannot search in censored file: target:3
439 cannot search in censored file: target:3
465
440
466 Censored nodes can be imported on top of censored nodes, consecutively
441 Censored nodes can be imported on top of censored nodes, consecutively
467
442
468 $ hg init ../rimport
443 $ hg init ../rimport
469 $ hg bundle --base 1 ../rimport/splitbundle
444 $ hg bundle --base 1 ../rimport/splitbundle
470 12 changesets found
445 12 changesets found
471 $ cd ../rimport
446 $ cd ../rimport
472 $ hg pull -r $H1 -r $H2 ../r
447 $ hg pull -r $H1 -r $H2 ../r
473 pulling from ../r
448 pulling from ../r
474 adding changesets
449 adding changesets
475 adding manifests
450 adding manifests
476 adding file changes
451 adding file changes
477 added 8 changesets with 10 changes to 2 files (+1 heads)
452 added 8 changesets with 10 changes to 2 files (+1 heads)
478 new changesets e97f55b2665a:dcbaf17bf3a1
453 new changesets e97f55b2665a:dcbaf17bf3a1
479 (run 'hg heads' to see heads, 'hg merge' to merge)
454 (run 'hg heads' to see heads, 'hg merge' to merge)
480 $ hg unbundle splitbundle
455 $ hg unbundle splitbundle
481 adding changesets
456 adding changesets
482 adding manifests
457 adding manifests
483 adding file changes
458 adding file changes
484 added 6 changesets with 5 changes to 2 files (+1 heads)
459 added 6 changesets with 5 changes to 2 files (+1 heads)
485 new changesets efbe78065929:683e4645fded (6 drafts)
460 new changesets efbe78065929:683e4645fded (6 drafts)
486 (run 'hg heads .' to see heads, 'hg merge' to merge)
461 (run 'hg heads .' to see heads, 'hg merge' to merge)
487 $ hg update $H2
462 $ hg update $H2
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 $ cat target | head -n 10
464 $ cat target | head -n 10
490 Re-sanitized; nothing to see here
465 Re-sanitized; nothing to see here
491 $ hg verify
466 $ hg verify -q
492 checking changesets
493 checking manifests
494 crosschecking files in changesets and manifests
495 checking files
496 checked 14 changesets with 15 changes to 2 files
497 $ cd ../r
467 $ cd ../r
498
468
499 Can import bundle where first revision of a file is censored
469 Can import bundle where first revision of a file is censored
500
470
501 $ hg init ../rinit
471 $ hg init ../rinit
502 $ hg --config extensions.censor= censor -r 0 target
472 $ hg --config extensions.censor= censor -r 0 target
503 $ hg bundle -r 0 --base null ../rinit/initbundle
473 $ hg bundle -r 0 --base null ../rinit/initbundle
504 1 changesets found
474 1 changesets found
505 $ cd ../rinit
475 $ cd ../rinit
506 $ hg unbundle initbundle
476 $ hg unbundle initbundle
507 adding changesets
477 adding changesets
508 adding manifests
478 adding manifests
509 adding file changes
479 adding file changes
510 added 1 changesets with 2 changes to 2 files
480 added 1 changesets with 2 changes to 2 files
511 new changesets e97f55b2665a (1 drafts)
481 new changesets e97f55b2665a (1 drafts)
512 (run 'hg update' to get a working copy)
482 (run 'hg update' to get a working copy)
513 $ hg cat -r 0 target | head -n 10
483 $ hg cat -r 0 target | head -n 10
514
484
515 #if revlogv2
485 #if revlogv2
516
486
517 Testing feature that does not work in revlog v1
487 Testing feature that does not work in revlog v1
518 ===============================================
488 ===============================================
519
489
520 Censoring a revision that is used as delta base
490 Censoring a revision that is used as delta base
521 -----------------------------------------------
491 -----------------------------------------------
522
492
523 $ cd ..
493 $ cd ..
524 $ hg init censor-with-delta
494 $ hg init censor-with-delta
525 $ cd censor-with-delta
495 $ cd censor-with-delta
526 $ echo root > target
496 $ echo root > target
527 $ hg add target
497 $ hg add target
528 $ hg commit -m root
498 $ hg commit -m root
529 $ B0=`hg id --debug -i`
499 $ B0=`hg id --debug -i`
530 $ for x in `"$PYTHON" $TESTDIR/seq.py 0 50000`
500 $ for x in `"$PYTHON" $TESTDIR/seq.py 0 50000`
531 > do
501 > do
532 > echo "Password: hunter$x" >> target
502 > echo "Password: hunter$x" >> target
533 > done
503 > done
534 $ hg ci -m 'write a long file'
504 $ hg ci -m 'write a long file'
535 $ B1=`hg id --debug -i`
505 $ B1=`hg id --debug -i`
536 $ echo 'small change (should create a delta)' >> target
506 $ echo 'small change (should create a delta)' >> target
537 $ hg ci -m 'create a delta over the password'
507 $ hg ci -m 'create a delta over the password'
538 (should show that the last revision is a delta, not a snapshot)
508 (should show that the last revision is a delta, not a snapshot)
539 $ B2=`hg id --debug -i`
509 $ B2=`hg id --debug -i`
540
510
541 Make sure the last revision is a delta against the revision we will censor
511 Make sure the last revision is a delta against the revision we will censor
542
512
543 $ hg debugdeltachain target -T '{rev} {chainid} {chainlen} {prevrev}\n'
513 $ hg debugdeltachain target -T '{rev} {chainid} {chainlen} {prevrev}\n'
544 0 1 1 -1
514 0 1 1 -1
545 1 2 1 -1
515 1 2 1 -1
546 2 2 2 1
516 2 2 2 1
547
517
548 Censor the file
518 Censor the file
549
519
550 $ hg cat -r $B1 target | wc -l
520 $ hg cat -r $B1 target | wc -l
551 *50002 (re)
521 *50002 (re)
552 $ hg --config extensions.censor= censor -r $B1 target
522 $ hg --config extensions.censor= censor -r $B1 target
553 $ hg cat -r $B1 target | wc -l
523 $ hg cat -r $B1 target | wc -l
554 *0 (re)
524 *0 (re)
555
525
556 Check the children is fine
526 Check the children is fine
557
527
558 $ hg cat -r $B2 target | wc -l
528 $ hg cat -r $B2 target | wc -l
559 *50003 (re)
529 *50003 (re)
560
530
561 #endif
531 #endif
@@ -1,53 +1,48
1 Corrupt an hg repo with a pull started during an aborted commit
1 Corrupt an hg repo with a pull started during an aborted commit
2 Create two repos, so that one of them can pull from the other one.
2 Create two repos, so that one of them can pull from the other one.
3
3
4 $ hg init source
4 $ hg init source
5 $ cd source
5 $ cd source
6 $ touch foo
6 $ touch foo
7 $ hg add foo
7 $ hg add foo
8 $ hg ci -m 'add foo'
8 $ hg ci -m 'add foo'
9 $ hg clone . ../corrupted
9 $ hg clone . ../corrupted
10 updating to branch default
10 updating to branch default
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 $ echo >> foo
12 $ echo >> foo
13 $ hg ci -m 'change foo'
13 $ hg ci -m 'change foo'
14
14
15 Add a hook to wait 5 seconds and then abort the commit
15 Add a hook to wait 5 seconds and then abort the commit
16
16
17 $ cd ../corrupted
17 $ cd ../corrupted
18 $ echo "[hooks]" >> .hg/hgrc
18 $ echo "[hooks]" >> .hg/hgrc
19 $ echo 'pretxncommit = sh -c "sleep 5; exit 1"' >> .hg/hgrc
19 $ echo 'pretxncommit = sh -c "sleep 5; exit 1"' >> .hg/hgrc
20
20
21 start a commit...
21 start a commit...
22
22
23 $ touch bar
23 $ touch bar
24 $ hg add bar
24 $ hg add bar
25 $ hg ci -m 'add bar' &
25 $ hg ci -m 'add bar' &
26
26
27 ... and start a pull while the commit is still running
27 ... and start a pull while the commit is still running
28
28
29 $ sleep 1
29 $ sleep 1
30 $ hg pull ../source 2>/dev/null
30 $ hg pull ../source 2>/dev/null
31 pulling from ../source
31 pulling from ../source
32 transaction abort!
32 transaction abort!
33 rollback completed
33 rollback completed
34 abort: pretxncommit hook exited with status 1
34 abort: pretxncommit hook exited with status 1
35 searching for changes
35 searching for changes
36 adding changesets
36 adding changesets
37 adding manifests
37 adding manifests
38 adding file changes
38 adding file changes
39 added 1 changesets with 1 changes to 1 files
39 added 1 changesets with 1 changes to 1 files
40 new changesets 52998019f625
40 new changesets 52998019f625
41 (run 'hg update' to get a working copy)
41 (run 'hg update' to get a working copy)
42
42
43 see what happened
43 see what happened
44
44
45 $ wait
45 $ wait
46 $ hg verify
46 $ hg verify -q
47 checking changesets
48 checking manifests
49 crosschecking files in changesets and manifests
50 checking files
51 checked 2 changesets with 2 changes to 1 files
52
47
53 $ cd ..
48 $ cd ..
@@ -1,254 +1,199
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3
3
4 $ echo 0 >> afile
4 $ echo 0 >> afile
5 $ hg add afile
5 $ hg add afile
6 $ hg commit -m "0.0"
6 $ hg commit -m "0.0"
7
7
8 $ echo 1 >> afile
8 $ echo 1 >> afile
9 $ hg commit -m "0.1"
9 $ hg commit -m "0.1"
10
10
11 $ echo 2 >> afile
11 $ echo 2 >> afile
12 $ hg commit -m "0.2"
12 $ hg commit -m "0.2"
13
13
14 $ echo 3 >> afile
14 $ echo 3 >> afile
15 $ hg commit -m "0.3"
15 $ hg commit -m "0.3"
16
16
17 $ hg update -C 0
17 $ hg update -C 0
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19
19
20 $ echo 1 >> afile
20 $ echo 1 >> afile
21 $ hg commit -m "1.1"
21 $ hg commit -m "1.1"
22 created new head
22 created new head
23
23
24 $ echo 2 >> afile
24 $ echo 2 >> afile
25 $ hg commit -m "1.2"
25 $ hg commit -m "1.2"
26
26
27 $ echo a line > fred
27 $ echo a line > fred
28 $ echo 3 >> afile
28 $ echo 3 >> afile
29 $ hg add fred
29 $ hg add fred
30 $ hg commit -m "1.3"
30 $ hg commit -m "1.3"
31 $ hg mv afile adifferentfile
31 $ hg mv afile adifferentfile
32 $ hg commit -m "1.3m"
32 $ hg commit -m "1.3m"
33
33
34 $ hg update -C 3
34 $ hg update -C 3
35 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
35 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
36
36
37 $ hg mv afile anotherfile
37 $ hg mv afile anotherfile
38 $ hg commit -m "0.3m"
38 $ hg commit -m "0.3m"
39
39
40 $ hg debugrevlogindex -f 1 afile
40 $ hg debugrevlogindex -f 1 afile
41 rev flag size link p1 p2 nodeid
41 rev flag size link p1 p2 nodeid
42 0 0000 2 0 -1 -1 362fef284ce2
42 0 0000 2 0 -1 -1 362fef284ce2
43 1 0000 4 1 0 -1 125144f7e028
43 1 0000 4 1 0 -1 125144f7e028
44 2 0000 6 2 1 -1 4c982badb186
44 2 0000 6 2 1 -1 4c982badb186
45 3 0000 8 3 2 -1 19b1fc555737
45 3 0000 8 3 2 -1 19b1fc555737
46
46
47 $ hg debugindex adifferentfile
47 $ hg debugindex adifferentfile
48 rev linkrev nodeid p1-nodeid p2-nodeid
48 rev linkrev nodeid p1-nodeid p2-nodeid
49 0 7 2565f3199a74 000000000000 000000000000
49 0 7 2565f3199a74 000000000000 000000000000
50
50
51 $ hg debugindex anotherfile
51 $ hg debugindex anotherfile
52 rev linkrev nodeid p1-nodeid p2-nodeid
52 rev linkrev nodeid p1-nodeid p2-nodeid
53 0 8 2565f3199a74 000000000000 000000000000
53 0 8 2565f3199a74 000000000000 000000000000
54
54
55 $ hg debugindex fred
55 $ hg debugindex fred
56 rev linkrev nodeid p1-nodeid p2-nodeid
56 rev linkrev nodeid p1-nodeid p2-nodeid
57 0 6 12ab3bcc5ea4 000000000000 000000000000
57 0 6 12ab3bcc5ea4 000000000000 000000000000
58
58
59 $ hg debugindex --manifest
59 $ hg debugindex --manifest
60 rev linkrev nodeid p1-nodeid p2-nodeid
60 rev linkrev nodeid p1-nodeid p2-nodeid
61 0 0 43eadb1d2d06 000000000000 000000000000
61 0 0 43eadb1d2d06 000000000000 000000000000
62 1 1 8b89697eba2c 43eadb1d2d06 000000000000
62 1 1 8b89697eba2c 43eadb1d2d06 000000000000
63 2 2 626a32663c2f 8b89697eba2c 000000000000
63 2 2 626a32663c2f 8b89697eba2c 000000000000
64 3 3 f54c32f13478 626a32663c2f 000000000000
64 3 3 f54c32f13478 626a32663c2f 000000000000
65 4 6 de68e904d169 626a32663c2f 000000000000
65 4 6 de68e904d169 626a32663c2f 000000000000
66 5 7 09bb521d218d de68e904d169 000000000000
66 5 7 09bb521d218d de68e904d169 000000000000
67 6 8 1fde233dfb0f f54c32f13478 000000000000
67 6 8 1fde233dfb0f f54c32f13478 000000000000
68
68
69 $ hg verify
69 $ hg verify -q
70 checking changesets
71 checking manifests
72 crosschecking files in changesets and manifests
73 checking files
74 checked 9 changesets with 7 changes to 4 files
75
70
76 $ cd ..
71 $ cd ..
77
72
78 $ for i in 0 1 2 3 4 5 6 7 8; do
73 $ for i in 0 1 2 3 4 5 6 7 8; do
79 > echo
74 > echo
80 > echo ---- hg clone -r "$i" test test-"$i"
75 > echo ---- hg clone -r "$i" test test-"$i"
81 > hg clone -r "$i" test test-"$i"
76 > hg clone -r "$i" test test-"$i"
82 > cd test-"$i"
77 > cd test-"$i"
83 > hg verify
78 > hg verify -q
84 > cd ..
79 > cd ..
85 > done
80 > done
86
81
87 ---- hg clone -r 0 test test-0
82 ---- hg clone -r 0 test test-0
88 adding changesets
83 adding changesets
89 adding manifests
84 adding manifests
90 adding file changes
85 adding file changes
91 added 1 changesets with 1 changes to 1 files
86 added 1 changesets with 1 changes to 1 files
92 new changesets f9ee2f85a263
87 new changesets f9ee2f85a263
93 updating to branch default
88 updating to branch default
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 checking changesets
96 checking manifests
97 crosschecking files in changesets and manifests
98 checking files
99 checked 1 changesets with 1 changes to 1 files
100
90
101 ---- hg clone -r 1 test test-1
91 ---- hg clone -r 1 test test-1
102 adding changesets
92 adding changesets
103 adding manifests
93 adding manifests
104 adding file changes
94 adding file changes
105 added 2 changesets with 2 changes to 1 files
95 added 2 changesets with 2 changes to 1 files
106 new changesets f9ee2f85a263:34c2bf6b0626
96 new changesets f9ee2f85a263:34c2bf6b0626
107 updating to branch default
97 updating to branch default
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 checking changesets
110 checking manifests
111 crosschecking files in changesets and manifests
112 checking files
113 checked 2 changesets with 2 changes to 1 files
114
99
115 ---- hg clone -r 2 test test-2
100 ---- hg clone -r 2 test test-2
116 adding changesets
101 adding changesets
117 adding manifests
102 adding manifests
118 adding file changes
103 adding file changes
119 added 3 changesets with 3 changes to 1 files
104 added 3 changesets with 3 changes to 1 files
120 new changesets f9ee2f85a263:e38ba6f5b7e0
105 new changesets f9ee2f85a263:e38ba6f5b7e0
121 updating to branch default
106 updating to branch default
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 checking changesets
124 checking manifests
125 crosschecking files in changesets and manifests
126 checking files
127 checked 3 changesets with 3 changes to 1 files
128
108
129 ---- hg clone -r 3 test test-3
109 ---- hg clone -r 3 test test-3
130 adding changesets
110 adding changesets
131 adding manifests
111 adding manifests
132 adding file changes
112 adding file changes
133 added 4 changesets with 4 changes to 1 files
113 added 4 changesets with 4 changes to 1 files
134 new changesets f9ee2f85a263:eebf5a27f8ca
114 new changesets f9ee2f85a263:eebf5a27f8ca
135 updating to branch default
115 updating to branch default
136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 checking changesets
138 checking manifests
139 crosschecking files in changesets and manifests
140 checking files
141 checked 4 changesets with 4 changes to 1 files
142
117
143 ---- hg clone -r 4 test test-4
118 ---- hg clone -r 4 test test-4
144 adding changesets
119 adding changesets
145 adding manifests
120 adding manifests
146 adding file changes
121 adding file changes
147 added 2 changesets with 2 changes to 1 files
122 added 2 changesets with 2 changes to 1 files
148 new changesets f9ee2f85a263:095197eb4973
123 new changesets f9ee2f85a263:095197eb4973
149 updating to branch default
124 updating to branch default
150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 checking changesets
152 checking manifests
153 crosschecking files in changesets and manifests
154 checking files
155 checked 2 changesets with 2 changes to 1 files
156
126
157 ---- hg clone -r 5 test test-5
127 ---- hg clone -r 5 test test-5
158 adding changesets
128 adding changesets
159 adding manifests
129 adding manifests
160 adding file changes
130 adding file changes
161 added 3 changesets with 3 changes to 1 files
131 added 3 changesets with 3 changes to 1 files
162 new changesets f9ee2f85a263:1bb50a9436a7
132 new changesets f9ee2f85a263:1bb50a9436a7
163 updating to branch default
133 updating to branch default
164 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 checking changesets
166 checking manifests
167 crosschecking files in changesets and manifests
168 checking files
169 checked 3 changesets with 3 changes to 1 files
170
135
171 ---- hg clone -r 6 test test-6
136 ---- hg clone -r 6 test test-6
172 adding changesets
137 adding changesets
173 adding manifests
138 adding manifests
174 adding file changes
139 adding file changes
175 added 4 changesets with 5 changes to 2 files
140 added 4 changesets with 5 changes to 2 files
176 new changesets f9ee2f85a263:7373c1169842
141 new changesets f9ee2f85a263:7373c1169842
177 updating to branch default
142 updating to branch default
178 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 checking changesets
180 checking manifests
181 crosschecking files in changesets and manifests
182 checking files
183 checked 4 changesets with 5 changes to 2 files
184
144
185 ---- hg clone -r 7 test test-7
145 ---- hg clone -r 7 test test-7
186 adding changesets
146 adding changesets
187 adding manifests
147 adding manifests
188 adding file changes
148 adding file changes
189 added 5 changesets with 6 changes to 3 files
149 added 5 changesets with 6 changes to 3 files
190 new changesets f9ee2f85a263:a6a34bfa0076
150 new changesets f9ee2f85a263:a6a34bfa0076
191 updating to branch default
151 updating to branch default
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 checking changesets
194 checking manifests
195 crosschecking files in changesets and manifests
196 checking files
197 checked 5 changesets with 6 changes to 3 files
198
153
199 ---- hg clone -r 8 test test-8
154 ---- hg clone -r 8 test test-8
200 adding changesets
155 adding changesets
201 adding manifests
156 adding manifests
202 adding file changes
157 adding file changes
203 added 5 changesets with 5 changes to 2 files
158 added 5 changesets with 5 changes to 2 files
204 new changesets f9ee2f85a263:aa35859c02ea
159 new changesets f9ee2f85a263:aa35859c02ea
205 updating to branch default
160 updating to branch default
206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
207 checking changesets
208 checking manifests
209 crosschecking files in changesets and manifests
210 checking files
211 checked 5 changesets with 5 changes to 2 files
212
162
213 $ cd test-8
163 $ cd test-8
214 $ hg pull ../test-7
164 $ hg pull ../test-7
215 pulling from ../test-7
165 pulling from ../test-7
216 searching for changes
166 searching for changes
217 adding changesets
167 adding changesets
218 adding manifests
168 adding manifests
219 adding file changes
169 adding file changes
220 added 4 changesets with 2 changes to 3 files (+1 heads)
170 added 4 changesets with 2 changes to 3 files (+1 heads)
221 new changesets 095197eb4973:a6a34bfa0076
171 new changesets 095197eb4973:a6a34bfa0076
222 (run 'hg heads' to see heads, 'hg merge' to merge)
172 (run 'hg heads' to see heads, 'hg merge' to merge)
223 $ hg verify
173 $ hg verify -q
224 checking changesets
225 checking manifests
226 crosschecking files in changesets and manifests
227 checking files
228 checked 9 changesets with 7 changes to 4 files
229 $ cd ..
174 $ cd ..
230
175
231 $ hg clone test test-9
176 $ hg clone test test-9
232 updating to branch default
177 updating to branch default
233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
178 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ cd test-9
179 $ cd test-9
235 $ hg branch foobar
180 $ hg branch foobar
236 marked working directory as branch foobar
181 marked working directory as branch foobar
237 (branches are permanent and global, did you want a bookmark?)
182 (branches are permanent and global, did you want a bookmark?)
238 $ echo file2 >> file2
183 $ echo file2 >> file2
239 $ hg add file2
184 $ hg add file2
240 $ hg commit -m "changeset9"
185 $ hg commit -m "changeset9"
241 $ echo file3 >> file3
186 $ echo file3 >> file3
242 $ hg add file3
187 $ hg add file3
243 $ hg commit -m "changeset10"
188 $ hg commit -m "changeset10"
244 $ cd ..
189 $ cd ..
245 $ hg clone -r 9 -u foobar test-9 test-10
190 $ hg clone -r 9 -u foobar test-9 test-10
246 adding changesets
191 adding changesets
247 adding manifests
192 adding manifests
248 adding file changes
193 adding file changes
249 added 6 changesets with 6 changes to 3 files
194 added 6 changesets with 6 changes to 3 files
250 new changesets f9ee2f85a263:7100abb79635
195 new changesets f9ee2f85a263:7100abb79635
251 updating to branch foobar
196 updating to branch foobar
252 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
253
198
254
199
@@ -1,442 +1,362
1 This file contains tests case that deal with format change accross stream clone
1 This file contains tests case that deal with format change accross stream clone
2
2
3 #require serve no-reposimplestore no-chg
3 #require serve no-reposimplestore no-chg
4
4
5 #testcases stream-legacy stream-bundle2
5 #testcases stream-legacy stream-bundle2
6
6
7 $ cat << EOF >> $HGRCPATH
7 $ cat << EOF >> $HGRCPATH
8 > [storage]
8 > [storage]
9 > revlog.persistent-nodemap.slow-path=allow
9 > revlog.persistent-nodemap.slow-path=allow
10 > EOF
10 > EOF
11
11
12 #if stream-legacy
12 #if stream-legacy
13 $ cat << EOF >> $HGRCPATH
13 $ cat << EOF >> $HGRCPATH
14 > [server]
14 > [server]
15 > bundle2.stream = no
15 > bundle2.stream = no
16 > EOF
16 > EOF
17 #endif
17 #endif
18
18
19 Initialize repository
19 Initialize repository
20
20
21 $ hg init server --config format.use-share-safe=yes --config format.use-persistent-nodemap=yes
21 $ hg init server --config format.use-share-safe=yes --config format.use-persistent-nodemap=yes
22 $ cd server
22 $ cd server
23 $ sh $TESTDIR/testlib/stream_clone_setup.sh
23 $ sh $TESTDIR/testlib/stream_clone_setup.sh
24 adding 00changelog-ab349180a0405010.nd
24 adding 00changelog-ab349180a0405010.nd
25 adding 00changelog.d
25 adding 00changelog.d
26 adding 00changelog.i
26 adding 00changelog.i
27 adding 00changelog.n
27 adding 00changelog.n
28 adding 00manifest.d
28 adding 00manifest.d
29 adding 00manifest.i
29 adding 00manifest.i
30 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
30 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
31 adding data/foo.d
31 adding data/foo.d
32 adding data/foo.i
32 adding data/foo.i
33 adding data/foo.n
33 adding data/foo.n
34 adding data/undo.babar
34 adding data/undo.babar
35 adding data/undo.d
35 adding data/undo.d
36 adding data/undo.foo.d
36 adding data/undo.foo.d
37 adding data/undo.foo.i
37 adding data/undo.foo.i
38 adding data/undo.foo.n
38 adding data/undo.foo.n
39 adding data/undo.i
39 adding data/undo.i
40 adding data/undo.n
40 adding data/undo.n
41 adding data/undo.py
41 adding data/undo.py
42 adding foo.d
42 adding foo.d
43 adding foo.i
43 adding foo.i
44 adding foo.n
44 adding foo.n
45 adding meta/foo.d
45 adding meta/foo.d
46 adding meta/foo.i
46 adding meta/foo.i
47 adding meta/foo.n
47 adding meta/foo.n
48 adding meta/undo.babar
48 adding meta/undo.babar
49 adding meta/undo.d
49 adding meta/undo.d
50 adding meta/undo.foo.d
50 adding meta/undo.foo.d
51 adding meta/undo.foo.i
51 adding meta/undo.foo.i
52 adding meta/undo.foo.n
52 adding meta/undo.foo.n
53 adding meta/undo.i
53 adding meta/undo.i
54 adding meta/undo.n
54 adding meta/undo.n
55 adding meta/undo.py
55 adding meta/undo.py
56 adding savanah/foo.d
56 adding savanah/foo.d
57 adding savanah/foo.i
57 adding savanah/foo.i
58 adding savanah/foo.n
58 adding savanah/foo.n
59 adding savanah/undo.babar
59 adding savanah/undo.babar
60 adding savanah/undo.d
60 adding savanah/undo.d
61 adding savanah/undo.foo.d
61 adding savanah/undo.foo.d
62 adding savanah/undo.foo.i
62 adding savanah/undo.foo.i
63 adding savanah/undo.foo.n
63 adding savanah/undo.foo.n
64 adding savanah/undo.i
64 adding savanah/undo.i
65 adding savanah/undo.n
65 adding savanah/undo.n
66 adding savanah/undo.py
66 adding savanah/undo.py
67 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
67 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
68 adding store/foo.d
68 adding store/foo.d
69 adding store/foo.i
69 adding store/foo.i
70 adding store/foo.n
70 adding store/foo.n
71 adding store/undo.babar
71 adding store/undo.babar
72 adding store/undo.d
72 adding store/undo.d
73 adding store/undo.foo.d
73 adding store/undo.foo.d
74 adding store/undo.foo.i
74 adding store/undo.foo.i
75 adding store/undo.foo.n
75 adding store/undo.foo.n
76 adding store/undo.i
76 adding store/undo.i
77 adding store/undo.n
77 adding store/undo.n
78 adding store/undo.py
78 adding store/undo.py
79 adding undo.babar
79 adding undo.babar
80 adding undo.d
80 adding undo.d
81 adding undo.foo.d
81 adding undo.foo.d
82 adding undo.foo.i
82 adding undo.foo.i
83 adding undo.foo.n
83 adding undo.foo.n
84 adding undo.i
84 adding undo.i
85 adding undo.n
85 adding undo.n
86 adding undo.py
86 adding undo.py
87 $ hg debugbuilddag .+5000 --from-existing
87 $ hg debugbuilddag .+5000 --from-existing
88 $ ls -1 .hg/store/00changelog*
88 $ ls -1 .hg/store/00changelog*
89 .hg/store/00changelog-*.nd (glob)
89 .hg/store/00changelog-*.nd (glob)
90 .hg/store/00changelog.d
90 .hg/store/00changelog.d
91 .hg/store/00changelog.i
91 .hg/store/00changelog.i
92 .hg/store/00changelog.n
92 .hg/store/00changelog.n
93 $ cd ..
93 $ cd ..
94
94
95
95
96 #if no-windows
96 #if no-windows
97
97
98 Test streaming from/to repository without a store:
98 Test streaming from/to repository without a store:
99 ==================================================
99 ==================================================
100
100
101 This is skipped Windows needs dot-encode to handle some of the file in this
101 This is skipped Windows needs dot-encode to handle some of the file in this
102 tests, and dot-encode need the store enabled.
102 tests, and dot-encode need the store enabled.
103
103
104 $ hg clone --pull --config format.usestore=no server server-no-store
104 $ hg clone --pull --config format.usestore=no server server-no-store
105 requesting all changes
105 requesting all changes
106 adding changesets
106 adding changesets
107 adding manifests
107 adding manifests
108 adding file changes
108 adding file changes
109 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
109 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
110 new changesets 96ee1d7354c4:06ddac466af5
110 new changesets 96ee1d7354c4:06ddac466af5
111 updating to branch default
111 updating to branch default
112 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
112 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 $ hg verify -R server-no-store
113 $ hg verify -R server-no-store -q
114 checking changesets
115 checking manifests
116 crosschecking files in changesets and manifests
117 checking files
118 checked 5004 changesets with 1088 changes to 1088 files
119 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
114 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
120 $ cat hg-1.pid > $DAEMON_PIDS
115 $ cat hg-1.pid > $DAEMON_PIDS
121 $ hg -R server-no-store serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
116 $ hg -R server-no-store serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
122 $ cat hg-2.pid >> $DAEMON_PIDS
117 $ cat hg-2.pid >> $DAEMON_PIDS
123 $ hg debugrequires -R server | grep store
118 $ hg debugrequires -R server | grep store
124 store
119 store
125 $ hg debugrequires -R server-no-store | grep store
120 $ hg debugrequires -R server-no-store | grep store
126 [1]
121 [1]
127
122
128 store no-store cloning
123 store no-store cloning
129
124
130 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-store --config format.usestore=no
125 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-store --config format.usestore=no
131 $ cat errors-1.txt
126 $ cat errors-1.txt
132 $ hg -R clone-remove-store verify
127 $ hg -R clone-remove-store verify -q
133 checking changesets
134 checking manifests
135 crosschecking files in changesets and manifests
136 checking files
137 checked 5004 changesets with 1088 changes to 1088 files
138 $ hg debugrequires -R clone-remove-store | grep store
128 $ hg debugrequires -R clone-remove-store | grep store
139 [1]
129 [1]
140
130
141
131
142 no-store store cloning
132 no-store store cloning
143
133
144 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-store --config format.usestore=yes
134 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-store --config format.usestore=yes
145 $ cat errors-2.txt
135 $ cat errors-2.txt
146 $ hg -R clone-add-store verify
136 $ hg -R clone-add-store verify -q
147 checking changesets
148 checking manifests
149 crosschecking files in changesets and manifests
150 checking files
151 checked 5004 changesets with 1088 changes to 1088 files
152 $ hg debugrequires -R clone-add-store | grep store
137 $ hg debugrequires -R clone-add-store | grep store
153 store
138 store
154
139
155
140
156 $ killdaemons.py
141 $ killdaemons.py
157 $ rm hg-*.pid errors-*.txt
142 $ rm hg-*.pid errors-*.txt
158
143
159 #endif
144 #endif
160
145
161
146
162 Test streaming from/to repository without a fncache
147 Test streaming from/to repository without a fncache
163 ===================================================
148 ===================================================
164
149
165 $ hg clone --pull --config format.usefncache=no server server-no-fncache
150 $ hg clone --pull --config format.usefncache=no server server-no-fncache
166 requesting all changes
151 requesting all changes
167 adding changesets
152 adding changesets
168 adding manifests
153 adding manifests
169 adding file changes
154 adding file changes
170 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
155 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
171 new changesets 96ee1d7354c4:06ddac466af5
156 new changesets 96ee1d7354c4:06ddac466af5
172 updating to branch default
157 updating to branch default
173 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 $ hg verify -R server-no-fncache
159 $ hg verify -R server-no-fncache -q
175 checking changesets
176 checking manifests
177 crosschecking files in changesets and manifests
178 checking files
179 checked 5004 changesets with 1088 changes to 1088 files
180 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
160 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
181 $ cat hg-1.pid > $DAEMON_PIDS
161 $ cat hg-1.pid > $DAEMON_PIDS
182 $ hg -R server-no-fncache serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
162 $ hg -R server-no-fncache serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
183 $ cat hg-2.pid >> $DAEMON_PIDS
163 $ cat hg-2.pid >> $DAEMON_PIDS
184 $ hg debugrequires -R server | grep fncache
164 $ hg debugrequires -R server | grep fncache
185 fncache
165 fncache
186 $ hg debugrequires -R server-no-fncache | grep fncache
166 $ hg debugrequires -R server-no-fncache | grep fncache
187 [1]
167 [1]
188
168
189 fncache no-fncache cloning
169 fncache no-fncache cloning
190
170
191 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-fncache --config format.usefncache=no
171 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-fncache --config format.usefncache=no
192 $ cat errors-1.txt
172 $ cat errors-1.txt
193 $ hg -R clone-remove-fncache verify
173 $ hg -R clone-remove-fncache verify -q
194 checking changesets
195 checking manifests
196 crosschecking files in changesets and manifests
197 checking files
198 checked 5004 changesets with 1088 changes to 1088 files
199 $ hg debugrequires -R clone-remove-fncache | grep fncache
174 $ hg debugrequires -R clone-remove-fncache | grep fncache
200 [1]
175 [1]
201
176
202
177
203 no-fncache fncache cloning
178 no-fncache fncache cloning
204
179
205 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-fncache --config format.usefncache=yes
180 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-fncache --config format.usefncache=yes
206 $ cat errors-2.txt
181 $ cat errors-2.txt
207 $ hg -R clone-add-fncache verify
182 $ hg -R clone-add-fncache verify -q
208 checking changesets
209 checking manifests
210 crosschecking files in changesets and manifests
211 checking files
212 checked 5004 changesets with 1088 changes to 1088 files
213 $ hg debugrequires -R clone-add-fncache | grep fncache
183 $ hg debugrequires -R clone-add-fncache | grep fncache
214 fncache
184 fncache
215
185
216
186
217 $ killdaemons.py
187 $ killdaemons.py
218
188
219
189
220
190
221 Test streaming from/to repository without a dotencode
191 Test streaming from/to repository without a dotencode
222 ===================================================
192 ===================================================
223
193
224 $ rm hg-*.pid errors-*.txt
194 $ rm hg-*.pid errors-*.txt
225 $ hg clone --pull --config format.dotencode=no server server-no-dotencode
195 $ hg clone --pull --config format.dotencode=no server server-no-dotencode
226 requesting all changes
196 requesting all changes
227 adding changesets
197 adding changesets
228 adding manifests
198 adding manifests
229 adding file changes
199 adding file changes
230 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
200 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
231 new changesets 96ee1d7354c4:06ddac466af5
201 new changesets 96ee1d7354c4:06ddac466af5
232 updating to branch default
202 updating to branch default
233 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ hg verify -R server-no-dotencode
204 $ hg verify -R server-no-dotencode -q
235 checking changesets
236 checking manifests
237 crosschecking files in changesets and manifests
238 checking files
239 checked 5004 changesets with 1088 changes to 1088 files
240 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
205 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
241 $ cat hg-1.pid > $DAEMON_PIDS
206 $ cat hg-1.pid > $DAEMON_PIDS
242 $ hg -R server-no-dotencode serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
207 $ hg -R server-no-dotencode serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
243 $ cat hg-2.pid >> $DAEMON_PIDS
208 $ cat hg-2.pid >> $DAEMON_PIDS
244 $ hg debugrequires -R server | grep dotencode
209 $ hg debugrequires -R server | grep dotencode
245 dotencode
210 dotencode
246 $ hg debugrequires -R server-no-dotencode | grep dotencode
211 $ hg debugrequires -R server-no-dotencode | grep dotencode
247 [1]
212 [1]
248
213
249 dotencode no-dotencode cloning
214 dotencode no-dotencode cloning
250
215
251 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-dotencode --config format.dotencode=no
216 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-dotencode --config format.dotencode=no
252 $ cat errors-1.txt
217 $ cat errors-1.txt
253 $ hg -R clone-remove-dotencode verify
218 $ hg -R clone-remove-dotencode verify -q
254 checking changesets
255 checking manifests
256 crosschecking files in changesets and manifests
257 checking files
258 checked 5004 changesets with 1088 changes to 1088 files
259 $ hg debugrequires -R clone-remove-dotencode | grep dotencode
219 $ hg debugrequires -R clone-remove-dotencode | grep dotencode
260 [1]
220 [1]
261
221
262
222
263 no-dotencode dotencode cloning
223 no-dotencode dotencode cloning
264
224
265 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-dotencode --config format.dotencode=yes
225 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-dotencode --config format.dotencode=yes
266 $ cat errors-2.txt
226 $ cat errors-2.txt
267 $ hg -R clone-add-dotencode verify
227 $ hg -R clone-add-dotencode verify -q
268 checking changesets
269 checking manifests
270 crosschecking files in changesets and manifests
271 checking files
272 checked 5004 changesets with 1088 changes to 1088 files
273 $ hg debugrequires -R clone-add-dotencode | grep dotencode
228 $ hg debugrequires -R clone-add-dotencode | grep dotencode
274 dotencode
229 dotencode
275
230
276
231
277 $ killdaemons.py
232 $ killdaemons.py
278
233
279 Cloning from a share
234 Cloning from a share
280 --------------------
235 --------------------
281
236
282 We should be able to clone from a "share" repository, it will use the source store for streaming.
237 We should be able to clone from a "share" repository, it will use the source store for streaming.
283
238
284 The resulting clone should not use share.
239 The resulting clone should not use share.
285
240
286 $ rm hg-*.pid errors-*.txt
241 $ rm hg-*.pid errors-*.txt
287 $ hg share --config extensions.share= server server-share -U
242 $ hg share --config extensions.share= server server-share -U
288 $ hg -R server-share serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
243 $ hg -R server-share serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
289 $ cat hg-1.pid > $DAEMON_PIDS
244 $ cat hg-1.pid > $DAEMON_PIDS
290
245
291 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-from-share
246 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-from-share
292 $ hg -R clone-from-share verify
247 $ hg -R clone-from-share verify -q
293 checking changesets
294 checking manifests
295 crosschecking files in changesets and manifests
296 checking files
297 checked 5004 changesets with 1088 changes to 1088 files
298 $ hg debugrequires -R clone-from-share | egrep 'share$'
248 $ hg debugrequires -R clone-from-share | egrep 'share$'
299 [1]
249 [1]
300
250
301 $ killdaemons.py
251 $ killdaemons.py
302
252
303 Test streaming from/to repository without a share-safe
253 Test streaming from/to repository without a share-safe
304 ======================================================
254 ======================================================
305
255
306 $ rm hg-*.pid errors-*.txt
256 $ rm hg-*.pid errors-*.txt
307 $ hg clone --pull --config format.use-share-safe=no server server-no-share-safe
257 $ hg clone --pull --config format.use-share-safe=no server server-no-share-safe
308 requesting all changes
258 requesting all changes
309 adding changesets
259 adding changesets
310 adding manifests
260 adding manifests
311 adding file changes
261 adding file changes
312 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
262 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
313 new changesets 96ee1d7354c4:06ddac466af5
263 new changesets 96ee1d7354c4:06ddac466af5
314 updating to branch default
264 updating to branch default
315 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
316 $ hg verify -R server-no-share-safe
266 $ hg verify -R server-no-share-safe -q
317 checking changesets
318 checking manifests
319 crosschecking files in changesets and manifests
320 checking files
321 checked 5004 changesets with 1088 changes to 1088 files
322 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
267 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
323 $ cat hg-1.pid > $DAEMON_PIDS
268 $ cat hg-1.pid > $DAEMON_PIDS
324 $ hg -R server-no-share-safe serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
269 $ hg -R server-no-share-safe serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
325 $ cat hg-2.pid >> $DAEMON_PIDS
270 $ cat hg-2.pid >> $DAEMON_PIDS
326 $ hg debugrequires -R server | grep share-safe
271 $ hg debugrequires -R server | grep share-safe
327 share-safe
272 share-safe
328 $ hg debugrequires -R server-no-share-safe | grep share-safe
273 $ hg debugrequires -R server-no-share-safe | grep share-safe
329 [1]
274 [1]
330
275
331 share-safe no-share-safe cloning
276 share-safe no-share-safe cloning
332
277
333 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-share-safe --config format.use-share-safe=no
278 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-share-safe --config format.use-share-safe=no
334 $ cat errors-1.txt
279 $ cat errors-1.txt
335 $ hg -R clone-remove-share-safe verify
280 $ hg -R clone-remove-share-safe verify -q
336 checking changesets
337 checking manifests
338 crosschecking files in changesets and manifests
339 checking files
340 checked 5004 changesets with 1088 changes to 1088 files
341 $ hg debugrequires -R clone-remove-share-safe | grep share-safe
281 $ hg debugrequires -R clone-remove-share-safe | grep share-safe
342 [1]
282 [1]
343
283
344
284
345 no-share-safe share-safe cloning
285 no-share-safe share-safe cloning
346
286
347 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-share-safe --config format.use-share-safe=yes
287 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-share-safe --config format.use-share-safe=yes
348 $ cat errors-2.txt
288 $ cat errors-2.txt
349 $ hg -R clone-add-share-safe verify
289 $ hg -R clone-add-share-safe verify -q
350 checking changesets
351 checking manifests
352 crosschecking files in changesets and manifests
353 checking files
354 checked 5004 changesets with 1088 changes to 1088 files
355 $ hg debugrequires -R clone-add-share-safe | grep share-safe
290 $ hg debugrequires -R clone-add-share-safe | grep share-safe
356 share-safe
291 share-safe
357
292
358
293
359 $ killdaemons.py
294 $ killdaemons.py
360
295
361
296
362 Test streaming from/to repository without a persistent-nodemap
297 Test streaming from/to repository without a persistent-nodemap
363 ==============================================================
298 ==============================================================
364
299
365 persistent nodemap affects revlog, but they are easy to generate locally, so we allow it to be changed over a stream clone
300 persistent nodemap affects revlog, but they are easy to generate locally, so we allow it to be changed over a stream clone
366
301
367 $ rm hg-*.pid errors-*.txt
302 $ rm hg-*.pid errors-*.txt
368 $ hg clone --pull --config format.use-persistent-nodemap=no server server-no-persistent-nodemap
303 $ hg clone --pull --config format.use-persistent-nodemap=no server server-no-persistent-nodemap
369 requesting all changes
304 requesting all changes
370 adding changesets
305 adding changesets
371 adding manifests
306 adding manifests
372 adding file changes
307 adding file changes
373 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
308 added 5004 changesets with 1088 changes to 1088 files (+1 heads)
374 new changesets 96ee1d7354c4:06ddac466af5
309 new changesets 96ee1d7354c4:06ddac466af5
375 updating to branch default
310 updating to branch default
376 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
311 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 $ hg verify -R server-no-persistent-nodemap
312 $ hg verify -R server-no-persistent-nodemap -q
378 checking changesets
379 checking manifests
380 crosschecking files in changesets and manifests
381 checking files
382 checked 5004 changesets with 1088 changes to 1088 files
383 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
313 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
384 $ cat hg-1.pid > $DAEMON_PIDS
314 $ cat hg-1.pid > $DAEMON_PIDS
385 $ hg -R server-no-persistent-nodemap serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
315 $ hg -R server-no-persistent-nodemap serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
386 $ cat hg-2.pid >> $DAEMON_PIDS
316 $ cat hg-2.pid >> $DAEMON_PIDS
387 $ hg debugrequires -R server | grep persistent-nodemap
317 $ hg debugrequires -R server | grep persistent-nodemap
388 persistent-nodemap
318 persistent-nodemap
389 $ hg debugrequires -R server-no-persistent-nodemap | grep persistent-nodemap
319 $ hg debugrequires -R server-no-persistent-nodemap | grep persistent-nodemap
390 [1]
320 [1]
391 $ ls -1 server/.hg/store/00changelog*
321 $ ls -1 server/.hg/store/00changelog*
392 server/.hg/store/00changelog-*.nd (glob)
322 server/.hg/store/00changelog-*.nd (glob)
393 server/.hg/store/00changelog.d
323 server/.hg/store/00changelog.d
394 server/.hg/store/00changelog.i
324 server/.hg/store/00changelog.i
395 server/.hg/store/00changelog.n
325 server/.hg/store/00changelog.n
396 $ ls -1 server-no-persistent-nodemap/.hg/store/00changelog*
326 $ ls -1 server-no-persistent-nodemap/.hg/store/00changelog*
397 server-no-persistent-nodemap/.hg/store/00changelog.d
327 server-no-persistent-nodemap/.hg/store/00changelog.d
398 server-no-persistent-nodemap/.hg/store/00changelog.i
328 server-no-persistent-nodemap/.hg/store/00changelog.i
399
329
400 persistent-nodemap no-persistent-nodemap cloning
330 persistent-nodemap no-persistent-nodemap cloning
401
331
402 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-persistent-nodemap --config format.use-persistent-nodemap=no
332 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-persistent-nodemap --config format.use-persistent-nodemap=no
403 $ cat errors-1.txt
333 $ cat errors-1.txt
404 $ hg -R clone-remove-persistent-nodemap verify
334 $ hg -R clone-remove-persistent-nodemap verify -q
405 checking changesets
406 checking manifests
407 crosschecking files in changesets and manifests
408 checking files
409 checked 5004 changesets with 1088 changes to 1088 files
410 $ hg debugrequires -R clone-remove-persistent-nodemap | grep persistent-nodemap
335 $ hg debugrequires -R clone-remove-persistent-nodemap | grep persistent-nodemap
411 [1]
336 [1]
412
337
413 The persistent-nodemap files should no longer exists
338 The persistent-nodemap files should no longer exists
414
339
415 $ ls -1 clone-remove-persistent-nodemap/.hg/store/00changelog*
340 $ ls -1 clone-remove-persistent-nodemap/.hg/store/00changelog*
416 clone-remove-persistent-nodemap/.hg/store/00changelog.d
341 clone-remove-persistent-nodemap/.hg/store/00changelog.d
417 clone-remove-persistent-nodemap/.hg/store/00changelog.i
342 clone-remove-persistent-nodemap/.hg/store/00changelog.i
418
343
419
344
420 no-persistent-nodemap persistent-nodemap cloning
345 no-persistent-nodemap persistent-nodemap cloning
421
346
422 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-persistent-nodemap --config format.use-persistent-nodemap=yes
347 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-persistent-nodemap --config format.use-persistent-nodemap=yes
423 $ cat errors-2.txt
348 $ cat errors-2.txt
424 $ hg -R clone-add-persistent-nodemap verify
349 $ hg -R clone-add-persistent-nodemap verify -q
425 checking changesets
426 checking manifests
427 crosschecking files in changesets and manifests
428 checking files
429 checked 5004 changesets with 1088 changes to 1088 files
430 $ hg debugrequires -R clone-add-persistent-nodemap | grep persistent-nodemap
350 $ hg debugrequires -R clone-add-persistent-nodemap | grep persistent-nodemap
431 persistent-nodemap
351 persistent-nodemap
432
352
433 The persistent-nodemap files should exists
353 The persistent-nodemap files should exists
434
354
435 $ ls -1 clone-add-persistent-nodemap/.hg/store/00changelog*
355 $ ls -1 clone-add-persistent-nodemap/.hg/store/00changelog*
436 clone-add-persistent-nodemap/.hg/store/00changelog-*.nd (glob)
356 clone-add-persistent-nodemap/.hg/store/00changelog-*.nd (glob)
437 clone-add-persistent-nodemap/.hg/store/00changelog.d
357 clone-add-persistent-nodemap/.hg/store/00changelog.d
438 clone-add-persistent-nodemap/.hg/store/00changelog.i
358 clone-add-persistent-nodemap/.hg/store/00changelog.i
439 clone-add-persistent-nodemap/.hg/store/00changelog.n
359 clone-add-persistent-nodemap/.hg/store/00changelog.n
440
360
441
361
442 $ killdaemons.py
362 $ killdaemons.py
@@ -1,825 +1,800
1 #require serve no-reposimplestore no-chg
1 #require serve no-reposimplestore no-chg
2
2
3 #testcases stream-legacy stream-bundle2
3 #testcases stream-legacy stream-bundle2
4
4
5 #if stream-legacy
5 #if stream-legacy
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [server]
7 > [server]
8 > bundle2.stream = no
8 > bundle2.stream = no
9 > EOF
9 > EOF
10 #endif
10 #endif
11
11
12 Initialize repository
12 Initialize repository
13
13
14 $ hg init server
14 $ hg init server
15 $ cd server
15 $ cd server
16 $ sh $TESTDIR/testlib/stream_clone_setup.sh
16 $ sh $TESTDIR/testlib/stream_clone_setup.sh
17 adding 00changelog-ab349180a0405010.nd
17 adding 00changelog-ab349180a0405010.nd
18 adding 00changelog.d
18 adding 00changelog.d
19 adding 00changelog.i
19 adding 00changelog.i
20 adding 00changelog.n
20 adding 00changelog.n
21 adding 00manifest.d
21 adding 00manifest.d
22 adding 00manifest.i
22 adding 00manifest.i
23 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
23 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
24 adding data/foo.d
24 adding data/foo.d
25 adding data/foo.i
25 adding data/foo.i
26 adding data/foo.n
26 adding data/foo.n
27 adding data/undo.babar
27 adding data/undo.babar
28 adding data/undo.d
28 adding data/undo.d
29 adding data/undo.foo.d
29 adding data/undo.foo.d
30 adding data/undo.foo.i
30 adding data/undo.foo.i
31 adding data/undo.foo.n
31 adding data/undo.foo.n
32 adding data/undo.i
32 adding data/undo.i
33 adding data/undo.n
33 adding data/undo.n
34 adding data/undo.py
34 adding data/undo.py
35 adding foo.d
35 adding foo.d
36 adding foo.i
36 adding foo.i
37 adding foo.n
37 adding foo.n
38 adding meta/foo.d
38 adding meta/foo.d
39 adding meta/foo.i
39 adding meta/foo.i
40 adding meta/foo.n
40 adding meta/foo.n
41 adding meta/undo.babar
41 adding meta/undo.babar
42 adding meta/undo.d
42 adding meta/undo.d
43 adding meta/undo.foo.d
43 adding meta/undo.foo.d
44 adding meta/undo.foo.i
44 adding meta/undo.foo.i
45 adding meta/undo.foo.n
45 adding meta/undo.foo.n
46 adding meta/undo.i
46 adding meta/undo.i
47 adding meta/undo.n
47 adding meta/undo.n
48 adding meta/undo.py
48 adding meta/undo.py
49 adding savanah/foo.d
49 adding savanah/foo.d
50 adding savanah/foo.i
50 adding savanah/foo.i
51 adding savanah/foo.n
51 adding savanah/foo.n
52 adding savanah/undo.babar
52 adding savanah/undo.babar
53 adding savanah/undo.d
53 adding savanah/undo.d
54 adding savanah/undo.foo.d
54 adding savanah/undo.foo.d
55 adding savanah/undo.foo.i
55 adding savanah/undo.foo.i
56 adding savanah/undo.foo.n
56 adding savanah/undo.foo.n
57 adding savanah/undo.i
57 adding savanah/undo.i
58 adding savanah/undo.n
58 adding savanah/undo.n
59 adding savanah/undo.py
59 adding savanah/undo.py
60 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
60 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
61 adding store/foo.d
61 adding store/foo.d
62 adding store/foo.i
62 adding store/foo.i
63 adding store/foo.n
63 adding store/foo.n
64 adding store/undo.babar
64 adding store/undo.babar
65 adding store/undo.d
65 adding store/undo.d
66 adding store/undo.foo.d
66 adding store/undo.foo.d
67 adding store/undo.foo.i
67 adding store/undo.foo.i
68 adding store/undo.foo.n
68 adding store/undo.foo.n
69 adding store/undo.i
69 adding store/undo.i
70 adding store/undo.n
70 adding store/undo.n
71 adding store/undo.py
71 adding store/undo.py
72 adding undo.babar
72 adding undo.babar
73 adding undo.d
73 adding undo.d
74 adding undo.foo.d
74 adding undo.foo.d
75 adding undo.foo.i
75 adding undo.foo.i
76 adding undo.foo.n
76 adding undo.foo.n
77 adding undo.i
77 adding undo.i
78 adding undo.n
78 adding undo.n
79 adding undo.py
79 adding undo.py
80
80
81 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
81 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
82 $ cat hg.pid > $DAEMON_PIDS
82 $ cat hg.pid > $DAEMON_PIDS
83 $ cd ..
83 $ cd ..
84
84
85 Check local clone
85 Check local clone
86 ==================
86 ==================
87
87
88 The logic is close enough of uncompressed.
88 The logic is close enough of uncompressed.
89 This is present here to reuse the testing around file with "special" names.
89 This is present here to reuse the testing around file with "special" names.
90
90
91 $ hg clone server local-clone
91 $ hg clone server local-clone
92 updating to branch default
92 updating to branch default
93 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
94
94
95 Check that the clone went well
95 Check that the clone went well
96
96
97 $ hg verify -R local-clone
97 $ hg verify -R local-clone -q
98 checking changesets
99 checking manifests
100 crosschecking files in changesets and manifests
101 checking files
102 checked 3 changesets with 1088 changes to 1088 files
103
98
104 Check uncompressed
99 Check uncompressed
105 ==================
100 ==================
106
101
107 Cannot stream clone when server.uncompressed is set
102 Cannot stream clone when server.uncompressed is set
108
103
109 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
104 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
110 200 Script output follows
105 200 Script output follows
111
106
112 1
107 1
113
108
114 #if stream-legacy
109 #if stream-legacy
115 $ hg debugcapabilities http://localhost:$HGPORT
110 $ hg debugcapabilities http://localhost:$HGPORT
116 Main capabilities:
111 Main capabilities:
117 batch
112 batch
118 branchmap
113 branchmap
119 $USUAL_BUNDLE2_CAPS_SERVER$
114 $USUAL_BUNDLE2_CAPS_SERVER$
120 changegroupsubset
115 changegroupsubset
121 compression=$BUNDLE2_COMPRESSIONS$
116 compression=$BUNDLE2_COMPRESSIONS$
122 getbundle
117 getbundle
123 httpheader=1024
118 httpheader=1024
124 httpmediatype=0.1rx,0.1tx,0.2tx
119 httpmediatype=0.1rx,0.1tx,0.2tx
125 known
120 known
126 lookup
121 lookup
127 pushkey
122 pushkey
128 unbundle=HG10GZ,HG10BZ,HG10UN
123 unbundle=HG10GZ,HG10BZ,HG10UN
129 unbundlehash
124 unbundlehash
130 Bundle2 capabilities:
125 Bundle2 capabilities:
131 HG20
126 HG20
132 bookmarks
127 bookmarks
133 changegroup
128 changegroup
134 01
129 01
135 02
130 02
136 checkheads
131 checkheads
137 related
132 related
138 digests
133 digests
139 md5
134 md5
140 sha1
135 sha1
141 sha512
136 sha512
142 error
137 error
143 abort
138 abort
144 unsupportedcontent
139 unsupportedcontent
145 pushraced
140 pushraced
146 pushkey
141 pushkey
147 hgtagsfnodes
142 hgtagsfnodes
148 listkeys
143 listkeys
149 phases
144 phases
150 heads
145 heads
151 pushkey
146 pushkey
152 remote-changegroup
147 remote-changegroup
153 http
148 http
154 https
149 https
155
150
156 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
151 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
157 warning: stream clone requested but server has them disabled
152 warning: stream clone requested but server has them disabled
158 requesting all changes
153 requesting all changes
159 adding changesets
154 adding changesets
160 adding manifests
155 adding manifests
161 adding file changes
156 adding file changes
162 added 3 changesets with 1088 changes to 1088 files
157 added 3 changesets with 1088 changes to 1088 files
163 new changesets 96ee1d7354c4:5223b5e3265f
158 new changesets 96ee1d7354c4:5223b5e3265f
164
159
165 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
160 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
166 200 Script output follows
161 200 Script output follows
167 content-type: application/mercurial-0.2
162 content-type: application/mercurial-0.2
168
163
169
164
170 $ f --size body --hexdump --bytes 100
165 $ f --size body --hexdump --bytes 100
171 body: size=232
166 body: size=232
172 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
167 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
173 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
168 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
174 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
169 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
175 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
170 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
176 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
171 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
177 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
172 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
178 0060: 69 73 20 66 |is f|
173 0060: 69 73 20 66 |is f|
179
174
180 #endif
175 #endif
181 #if stream-bundle2
176 #if stream-bundle2
182 $ hg debugcapabilities http://localhost:$HGPORT
177 $ hg debugcapabilities http://localhost:$HGPORT
183 Main capabilities:
178 Main capabilities:
184 batch
179 batch
185 branchmap
180 branchmap
186 $USUAL_BUNDLE2_CAPS_SERVER$
181 $USUAL_BUNDLE2_CAPS_SERVER$
187 changegroupsubset
182 changegroupsubset
188 compression=$BUNDLE2_COMPRESSIONS$
183 compression=$BUNDLE2_COMPRESSIONS$
189 getbundle
184 getbundle
190 httpheader=1024
185 httpheader=1024
191 httpmediatype=0.1rx,0.1tx,0.2tx
186 httpmediatype=0.1rx,0.1tx,0.2tx
192 known
187 known
193 lookup
188 lookup
194 pushkey
189 pushkey
195 unbundle=HG10GZ,HG10BZ,HG10UN
190 unbundle=HG10GZ,HG10BZ,HG10UN
196 unbundlehash
191 unbundlehash
197 Bundle2 capabilities:
192 Bundle2 capabilities:
198 HG20
193 HG20
199 bookmarks
194 bookmarks
200 changegroup
195 changegroup
201 01
196 01
202 02
197 02
203 checkheads
198 checkheads
204 related
199 related
205 digests
200 digests
206 md5
201 md5
207 sha1
202 sha1
208 sha512
203 sha512
209 error
204 error
210 abort
205 abort
211 unsupportedcontent
206 unsupportedcontent
212 pushraced
207 pushraced
213 pushkey
208 pushkey
214 hgtagsfnodes
209 hgtagsfnodes
215 listkeys
210 listkeys
216 phases
211 phases
217 heads
212 heads
218 pushkey
213 pushkey
219 remote-changegroup
214 remote-changegroup
220 http
215 http
221 https
216 https
222
217
223 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
218 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
224 warning: stream clone requested but server has them disabled
219 warning: stream clone requested but server has them disabled
225 requesting all changes
220 requesting all changes
226 adding changesets
221 adding changesets
227 adding manifests
222 adding manifests
228 adding file changes
223 adding file changes
229 added 3 changesets with 1088 changes to 1088 files
224 added 3 changesets with 1088 changes to 1088 files
230 new changesets 96ee1d7354c4:5223b5e3265f
225 new changesets 96ee1d7354c4:5223b5e3265f
231
226
232 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
227 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
233 200 Script output follows
228 200 Script output follows
234 content-type: application/mercurial-0.2
229 content-type: application/mercurial-0.2
235
230
236
231
237 $ f --size body --hexdump --bytes 100
232 $ f --size body --hexdump --bytes 100
238 body: size=232
233 body: size=232
239 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
234 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
240 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
235 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
241 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
236 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
242 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
237 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
243 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
238 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
244 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
239 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
245 0060: 69 73 20 66 |is f|
240 0060: 69 73 20 66 |is f|
246
241
247 #endif
242 #endif
248
243
249 $ killdaemons.py
244 $ killdaemons.py
250 $ cd server
245 $ cd server
251 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt
246 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt
252 $ cat hg.pid > $DAEMON_PIDS
247 $ cat hg.pid > $DAEMON_PIDS
253 $ cd ..
248 $ cd ..
254
249
255 Basic clone
250 Basic clone
256
251
257 #if stream-legacy
252 #if stream-legacy
258 $ hg clone --stream -U http://localhost:$HGPORT clone1
253 $ hg clone --stream -U http://localhost:$HGPORT clone1
259 streaming all changes
254 streaming all changes
260 1090 files to transfer, 102 KB of data (no-zstd !)
255 1090 files to transfer, 102 KB of data (no-zstd !)
261 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
256 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
262 1090 files to transfer, 98.8 KB of data (zstd !)
257 1090 files to transfer, 98.8 KB of data (zstd !)
263 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
258 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
264 searching for changes
259 searching for changes
265 no changes found
260 no changes found
266 $ cat server/errors.txt
261 $ cat server/errors.txt
267 #endif
262 #endif
268 #if stream-bundle2
263 #if stream-bundle2
269 $ hg clone --stream -U http://localhost:$HGPORT clone1
264 $ hg clone --stream -U http://localhost:$HGPORT clone1
270 streaming all changes
265 streaming all changes
271 1093 files to transfer, 102 KB of data (no-zstd !)
266 1093 files to transfer, 102 KB of data (no-zstd !)
272 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
267 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
273 1093 files to transfer, 98.9 KB of data (zstd !)
268 1093 files to transfer, 98.9 KB of data (zstd !)
274 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
269 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
275
270
276 $ ls -1 clone1/.hg/cache
271 $ ls -1 clone1/.hg/cache
277 branch2-base
272 branch2-base
278 branch2-immutable
273 branch2-immutable
279 branch2-served
274 branch2-served
280 branch2-served.hidden
275 branch2-served.hidden
281 branch2-visible
276 branch2-visible
282 branch2-visible-hidden
277 branch2-visible-hidden
283 rbc-names-v1
278 rbc-names-v1
284 rbc-revs-v1
279 rbc-revs-v1
285 tags2
280 tags2
286 tags2-served
281 tags2-served
287 $ cat server/errors.txt
282 $ cat server/errors.txt
288 #endif
283 #endif
289
284
290 getbundle requests with stream=1 are uncompressed
285 getbundle requests with stream=1 are uncompressed
291
286
292 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
287 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
293 200 Script output follows
288 200 Script output follows
294 content-type: application/mercurial-0.2
289 content-type: application/mercurial-0.2
295
290
296
291
297 #if no-zstd no-rust
292 #if no-zstd no-rust
298 $ f --size --hex --bytes 256 body
293 $ f --size --hex --bytes 256 body
299 body: size=119123
294 body: size=119123
300 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
295 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
301 0010: 62 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |b.STREAM2.......|
296 0010: 62 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |b.STREAM2.......|
302 0020: 06 09 04 0c 26 62 79 74 65 63 6f 75 6e 74 31 30 |....&bytecount10|
297 0020: 06 09 04 0c 26 62 79 74 65 63 6f 75 6e 74 31 30 |....&bytecount10|
303 0030: 34 31 31 35 66 69 6c 65 63 6f 75 6e 74 31 30 39 |4115filecount109|
298 0030: 34 31 31 35 66 69 6c 65 63 6f 75 6e 74 31 30 39 |4115filecount109|
304 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
299 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
305 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
300 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
306 0060: 6f 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 |ogv1%2Csparserev|
301 0060: 6f 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 |ogv1%2Csparserev|
307 0070: 6c 6f 67 00 00 80 00 73 08 42 64 61 74 61 2f 30 |log....s.Bdata/0|
302 0070: 6c 6f 67 00 00 80 00 73 08 42 64 61 74 61 2f 30 |log....s.Bdata/0|
308 0080: 2e 69 00 03 00 01 00 00 00 00 00 00 00 02 00 00 |.i..............|
303 0080: 2e 69 00 03 00 01 00 00 00 00 00 00 00 02 00 00 |.i..............|
309 0090: 00 01 00 00 00 00 00 00 00 01 ff ff ff ff ff ff |................|
304 0090: 00 01 00 00 00 00 00 00 00 01 ff ff ff ff ff ff |................|
310 00a0: ff ff 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 |...)c.I.#....Vg.|
305 00a0: ff ff 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 |...)c.I.#....Vg.|
311 00b0: 67 2c 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 |g,i..9..........|
306 00b0: 67 2c 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 |g,i..9..........|
312 00c0: 00 00 75 30 73 26 45 64 61 74 61 2f 30 30 63 68 |..u0s&Edata/00ch|
307 00c0: 00 00 75 30 73 26 45 64 61 74 61 2f 30 30 63 68 |..u0s&Edata/00ch|
313 00d0: 61 6e 67 65 6c 6f 67 2d 61 62 33 34 39 31 38 30 |angelog-ab349180|
308 00d0: 61 6e 67 65 6c 6f 67 2d 61 62 33 34 39 31 38 30 |angelog-ab349180|
314 00e0: 61 30 34 30 35 30 31 30 2e 6e 64 2e 69 00 03 00 |a0405010.nd.i...|
309 00e0: 61 30 34 30 35 30 31 30 2e 6e 64 2e 69 00 03 00 |a0405010.nd.i...|
315 00f0: 01 00 00 00 00 00 00 00 05 00 00 00 04 00 00 00 |................|
310 00f0: 01 00 00 00 00 00 00 00 05 00 00 00 04 00 00 00 |................|
316 #endif
311 #endif
317 #if zstd no-rust
312 #if zstd no-rust
318 $ f --size --hex --bytes 256 body
313 $ f --size --hex --bytes 256 body
319 body: size=116310 (no-bigendian !)
314 body: size=116310 (no-bigendian !)
320 body: size=116305 (bigendian !)
315 body: size=116305 (bigendian !)
321 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
316 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
322 0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
317 0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
323 0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
318 0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
324 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| (no-bigendian !)
319 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| (no-bigendian !)
325 0030: 31 32 37 31 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1271filecount109| (bigendian !)
320 0030: 31 32 37 31 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1271filecount109| (bigendian !)
326 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
321 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
327 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
322 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
328 0060: 6f 67 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a |og-compression-z|
323 0060: 6f 67 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a |og-compression-z|
329 0070: 73 74 64 25 32 43 72 65 76 6c 6f 67 76 31 25 32 |std%2Crevlogv1%2|
324 0070: 73 74 64 25 32 43 72 65 76 6c 6f 67 76 31 25 32 |std%2Crevlogv1%2|
330 0080: 43 73 70 61 72 73 65 72 65 76 6c 6f 67 00 00 80 |Csparserevlog...|
325 0080: 43 73 70 61 72 73 65 72 65 76 6c 6f 67 00 00 80 |Csparserevlog...|
331 0090: 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 |.s.Bdata/0.i....|
326 0090: 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 |.s.Bdata/0.i....|
332 00a0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
327 00a0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
333 00b0: 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 |.............)c.|
328 00b0: 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 |.............)c.|
334 00c0: 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 |I.#....Vg.g,i..9|
329 00c0: 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 |I.#....Vg.g,i..9|
335 00d0: 00 00 00 00 00 00 00 00 00 00 00 00 75 30 73 26 |............u0s&|
330 00d0: 00 00 00 00 00 00 00 00 00 00 00 00 75 30 73 26 |............u0s&|
336 00e0: 45 64 61 74 61 2f 30 30 63 68 61 6e 67 65 6c 6f |Edata/00changelo|
331 00e0: 45 64 61 74 61 2f 30 30 63 68 61 6e 67 65 6c 6f |Edata/00changelo|
337 00f0: 67 2d 61 62 33 34 39 31 38 30 61 30 34 30 35 30 |g-ab349180a04050|
332 00f0: 67 2d 61 62 33 34 39 31 38 30 61 30 34 30 35 30 |g-ab349180a04050|
338 #endif
333 #endif
339 #if zstd rust no-dirstate-v2
334 #if zstd rust no-dirstate-v2
340 $ f --size --hex --bytes 256 body
335 $ f --size --hex --bytes 256 body
341 body: size=116310
336 body: size=116310
342 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
337 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
343 0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
338 0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
344 0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
339 0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
345 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109|
340 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109|
346 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
341 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
347 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
342 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
348 0060: 6f 67 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a |og-compression-z|
343 0060: 6f 67 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a |og-compression-z|
349 0070: 73 74 64 25 32 43 72 65 76 6c 6f 67 76 31 25 32 |std%2Crevlogv1%2|
344 0070: 73 74 64 25 32 43 72 65 76 6c 6f 67 76 31 25 32 |std%2Crevlogv1%2|
350 0080: 43 73 70 61 72 73 65 72 65 76 6c 6f 67 00 00 80 |Csparserevlog...|
345 0080: 43 73 70 61 72 73 65 72 65 76 6c 6f 67 00 00 80 |Csparserevlog...|
351 0090: 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 |.s.Bdata/0.i....|
346 0090: 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 |.s.Bdata/0.i....|
352 00a0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
347 00a0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
353 00b0: 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 |.............)c.|
348 00b0: 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 |.............)c.|
354 00c0: 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 |I.#....Vg.g,i..9|
349 00c0: 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 |I.#....Vg.g,i..9|
355 00d0: 00 00 00 00 00 00 00 00 00 00 00 00 75 30 73 26 |............u0s&|
350 00d0: 00 00 00 00 00 00 00 00 00 00 00 00 75 30 73 26 |............u0s&|
356 00e0: 45 64 61 74 61 2f 30 30 63 68 61 6e 67 65 6c 6f |Edata/00changelo|
351 00e0: 45 64 61 74 61 2f 30 30 63 68 61 6e 67 65 6c 6f |Edata/00changelo|
357 00f0: 67 2d 61 62 33 34 39 31 38 30 61 30 34 30 35 30 |g-ab349180a04050|
352 00f0: 67 2d 61 62 33 34 39 31 38 30 61 30 34 30 35 30 |g-ab349180a04050|
358 #endif
353 #endif
359 #if zstd dirstate-v2
354 #if zstd dirstate-v2
360 $ f --size --hex --bytes 256 body
355 $ f --size --hex --bytes 256 body
361 body: size=109549
356 body: size=109549
362 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
357 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
363 0010: c0 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
358 0010: c0 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
364 0020: 05 09 04 0c 85 62 79 74 65 63 6f 75 6e 74 39 35 |.....bytecount95|
359 0020: 05 09 04 0c 85 62 79 74 65 63 6f 75 6e 74 39 35 |.....bytecount95|
365 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030|
360 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030|
366 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
361 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
367 0050: 6e 63 6f 64 65 25 32 43 65 78 70 2d 64 69 72 73 |ncode%2Cexp-dirs|
362 0050: 6e 63 6f 64 65 25 32 43 65 78 70 2d 64 69 72 73 |ncode%2Cexp-dirs|
368 0060: 74 61 74 65 2d 76 32 25 32 43 66 6e 63 61 63 68 |tate-v2%2Cfncach|
363 0060: 74 61 74 65 2d 76 32 25 32 43 66 6e 63 61 63 68 |tate-v2%2Cfncach|
369 0070: 65 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 |e%2Cgeneraldelta|
364 0070: 65 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 |e%2Cgeneraldelta|
370 0080: 25 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f |%2Cpersistent-no|
365 0080: 25 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f |%2Cpersistent-no|
371 0090: 64 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 |demap%2Crevlog-c|
366 0090: 64 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 |demap%2Crevlog-c|
372 00a0: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 |ompression-zstd%|
367 00a0: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 |ompression-zstd%|
373 00b0: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa|
368 00b0: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa|
374 00c0: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor|
369 00c0: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor|
375 00d0: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i|
370 00d0: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i|
376 00e0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................|
371 00e0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................|
377 00f0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................|
372 00f0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................|
378 #endif
373 #endif
379
374
380 --uncompressed is an alias to --stream
375 --uncompressed is an alias to --stream
381
376
382 #if stream-legacy
377 #if stream-legacy
383 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
378 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
384 streaming all changes
379 streaming all changes
385 1090 files to transfer, 102 KB of data (no-zstd !)
380 1090 files to transfer, 102 KB of data (no-zstd !)
386 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
381 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
387 1090 files to transfer, 98.8 KB of data (zstd !)
382 1090 files to transfer, 98.8 KB of data (zstd !)
388 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
383 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
389 searching for changes
384 searching for changes
390 no changes found
385 no changes found
391 #endif
386 #endif
392 #if stream-bundle2
387 #if stream-bundle2
393 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
388 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
394 streaming all changes
389 streaming all changes
395 1093 files to transfer, 102 KB of data (no-zstd !)
390 1093 files to transfer, 102 KB of data (no-zstd !)
396 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
391 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
397 1093 files to transfer, 98.9 KB of data (zstd !)
392 1093 files to transfer, 98.9 KB of data (zstd !)
398 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
393 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
399 #endif
394 #endif
400
395
401 Clone with background file closing enabled
396 Clone with background file closing enabled
402
397
403 #if stream-legacy
398 #if stream-legacy
404 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
399 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
405 using http://localhost:$HGPORT/
400 using http://localhost:$HGPORT/
406 sending capabilities command
401 sending capabilities command
407 sending branchmap command
402 sending branchmap command
408 streaming all changes
403 streaming all changes
409 sending stream_out command
404 sending stream_out command
410 1090 files to transfer, 102 KB of data (no-zstd !)
405 1090 files to transfer, 102 KB of data (no-zstd !)
411 1090 files to transfer, 98.8 KB of data (zstd !)
406 1090 files to transfer, 98.8 KB of data (zstd !)
412 starting 4 threads for background file closing
407 starting 4 threads for background file closing
413 updating the branch cache
408 updating the branch cache
414 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
409 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
415 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
410 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
416 query 1; heads
411 query 1; heads
417 sending batch command
412 sending batch command
418 searching for changes
413 searching for changes
419 all remote heads known locally
414 all remote heads known locally
420 no changes found
415 no changes found
421 sending getbundle command
416 sending getbundle command
422 bundle2-input-bundle: with-transaction
417 bundle2-input-bundle: with-transaction
423 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
418 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
424 bundle2-input-part: "phase-heads" supported
419 bundle2-input-part: "phase-heads" supported
425 bundle2-input-part: total payload size 24
420 bundle2-input-part: total payload size 24
426 bundle2-input-bundle: 2 parts total
421 bundle2-input-bundle: 2 parts total
427 checking for updated bookmarks
422 checking for updated bookmarks
428 updating the branch cache
423 updating the branch cache
429 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
424 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
430 #endif
425 #endif
431 #if stream-bundle2
426 #if stream-bundle2
432 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
427 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
433 using http://localhost:$HGPORT/
428 using http://localhost:$HGPORT/
434 sending capabilities command
429 sending capabilities command
435 query 1; heads
430 query 1; heads
436 sending batch command
431 sending batch command
437 streaming all changes
432 streaming all changes
438 sending getbundle command
433 sending getbundle command
439 bundle2-input-bundle: with-transaction
434 bundle2-input-bundle: with-transaction
440 bundle2-input-part: "stream2" (params: 3 mandatory) supported
435 bundle2-input-part: "stream2" (params: 3 mandatory) supported
441 applying stream bundle
436 applying stream bundle
442 1093 files to transfer, 102 KB of data (no-zstd !)
437 1093 files to transfer, 102 KB of data (no-zstd !)
443 1093 files to transfer, 98.9 KB of data (zstd !)
438 1093 files to transfer, 98.9 KB of data (zstd !)
444 starting 4 threads for background file closing
439 starting 4 threads for background file closing
445 starting 4 threads for background file closing
440 starting 4 threads for background file closing
446 updating the branch cache
441 updating the branch cache
447 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
442 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
448 bundle2-input-part: total payload size 118984 (no-zstd !)
443 bundle2-input-part: total payload size 118984 (no-zstd !)
449 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
444 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
450 bundle2-input-part: total payload size 116145 (zstd no-bigendian !)
445 bundle2-input-part: total payload size 116145 (zstd no-bigendian !)
451 bundle2-input-part: total payload size 116140 (zstd bigendian !)
446 bundle2-input-part: total payload size 116140 (zstd bigendian !)
452 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
447 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
453 bundle2-input-bundle: 2 parts total
448 bundle2-input-bundle: 2 parts total
454 checking for updated bookmarks
449 checking for updated bookmarks
455 updating the branch cache
450 updating the branch cache
456 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
451 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
457 #endif
452 #endif
458
453
459 Cannot stream clone when there are secret changesets
454 Cannot stream clone when there are secret changesets
460
455
461 $ hg -R server phase --force --secret -r tip
456 $ hg -R server phase --force --secret -r tip
462 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
457 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
463 warning: stream clone requested but server has them disabled
458 warning: stream clone requested but server has them disabled
464 requesting all changes
459 requesting all changes
465 adding changesets
460 adding changesets
466 adding manifests
461 adding manifests
467 adding file changes
462 adding file changes
468 added 2 changesets with 1025 changes to 1025 files
463 added 2 changesets with 1025 changes to 1025 files
469 new changesets 96ee1d7354c4:c17445101a72
464 new changesets 96ee1d7354c4:c17445101a72
470
465
471 $ killdaemons.py
466 $ killdaemons.py
472
467
473 Streaming of secrets can be overridden by server config
468 Streaming of secrets can be overridden by server config
474
469
475 $ cd server
470 $ cd server
476 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
471 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
477 $ cat hg.pid > $DAEMON_PIDS
472 $ cat hg.pid > $DAEMON_PIDS
478 $ cd ..
473 $ cd ..
479
474
480 #if stream-legacy
475 #if stream-legacy
481 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
476 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
482 streaming all changes
477 streaming all changes
483 1090 files to transfer, 102 KB of data (no-zstd !)
478 1090 files to transfer, 102 KB of data (no-zstd !)
484 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
479 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
485 1090 files to transfer, 98.8 KB of data (zstd !)
480 1090 files to transfer, 98.8 KB of data (zstd !)
486 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
481 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
487 searching for changes
482 searching for changes
488 no changes found
483 no changes found
489 #endif
484 #endif
490 #if stream-bundle2
485 #if stream-bundle2
491 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
486 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
492 streaming all changes
487 streaming all changes
493 1093 files to transfer, 102 KB of data (no-zstd !)
488 1093 files to transfer, 102 KB of data (no-zstd !)
494 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
489 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
495 1093 files to transfer, 98.9 KB of data (zstd !)
490 1093 files to transfer, 98.9 KB of data (zstd !)
496 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
491 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
497 #endif
492 #endif
498
493
499 $ killdaemons.py
494 $ killdaemons.py
500
495
501 Verify interaction between preferuncompressed and secret presence
496 Verify interaction between preferuncompressed and secret presence
502
497
503 $ cd server
498 $ cd server
504 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
499 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
505 $ cat hg.pid > $DAEMON_PIDS
500 $ cat hg.pid > $DAEMON_PIDS
506 $ cd ..
501 $ cd ..
507
502
508 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
503 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
509 requesting all changes
504 requesting all changes
510 adding changesets
505 adding changesets
511 adding manifests
506 adding manifests
512 adding file changes
507 adding file changes
513 added 2 changesets with 1025 changes to 1025 files
508 added 2 changesets with 1025 changes to 1025 files
514 new changesets 96ee1d7354c4:c17445101a72
509 new changesets 96ee1d7354c4:c17445101a72
515
510
516 $ killdaemons.py
511 $ killdaemons.py
517
512
518 Clone not allowed when full bundles disabled and can't serve secrets
513 Clone not allowed when full bundles disabled and can't serve secrets
519
514
520 $ cd server
515 $ cd server
521 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
516 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
522 $ cat hg.pid > $DAEMON_PIDS
517 $ cat hg.pid > $DAEMON_PIDS
523 $ cd ..
518 $ cd ..
524
519
525 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
520 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
526 warning: stream clone requested but server has them disabled
521 warning: stream clone requested but server has them disabled
527 requesting all changes
522 requesting all changes
528 remote: abort: server has pull-based clones disabled
523 remote: abort: server has pull-based clones disabled
529 abort: pull failed on remote
524 abort: pull failed on remote
530 (remove --pull if specified or upgrade Mercurial)
525 (remove --pull if specified or upgrade Mercurial)
531 [100]
526 [100]
532
527
533 Local stream clone with secrets involved
528 Local stream clone with secrets involved
534 (This is just a test over behavior: if you have access to the repo's files,
529 (This is just a test over behavior: if you have access to the repo's files,
535 there is no security so it isn't important to prevent a clone here.)
530 there is no security so it isn't important to prevent a clone here.)
536
531
537 $ hg clone -U --stream server local-secret
532 $ hg clone -U --stream server local-secret
538 warning: stream clone requested but server has them disabled
533 warning: stream clone requested but server has them disabled
539 requesting all changes
534 requesting all changes
540 adding changesets
535 adding changesets
541 adding manifests
536 adding manifests
542 adding file changes
537 adding file changes
543 added 2 changesets with 1025 changes to 1025 files
538 added 2 changesets with 1025 changes to 1025 files
544 new changesets 96ee1d7354c4:c17445101a72
539 new changesets 96ee1d7354c4:c17445101a72
545
540
546 Stream clone while repo is changing:
541 Stream clone while repo is changing:
547
542
548 $ mkdir changing
543 $ mkdir changing
549 $ cd changing
544 $ cd changing
550
545
551 extension for delaying the server process so we reliably can modify the repo
546 extension for delaying the server process so we reliably can modify the repo
552 while cloning
547 while cloning
553
548
554 $ cat > stream_steps.py <<EOF
549 $ cat > stream_steps.py <<EOF
555 > import os
550 > import os
556 > import sys
551 > import sys
557 > from mercurial import (
552 > from mercurial import (
558 > encoding,
553 > encoding,
559 > extensions,
554 > extensions,
560 > streamclone,
555 > streamclone,
561 > testing,
556 > testing,
562 > )
557 > )
563 > WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1']
558 > WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1']
564 > WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2']
559 > WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2']
565 >
560 >
566 > def _test_sync_point_walk_1(orig, repo):
561 > def _test_sync_point_walk_1(orig, repo):
567 > testing.write_file(WALKED_FILE_1)
562 > testing.write_file(WALKED_FILE_1)
568 >
563 >
569 > def _test_sync_point_walk_2(orig, repo):
564 > def _test_sync_point_walk_2(orig, repo):
570 > assert repo._currentlock(repo._lockref) is None
565 > assert repo._currentlock(repo._lockref) is None
571 > testing.wait_file(WALKED_FILE_2)
566 > testing.wait_file(WALKED_FILE_2)
572 >
567 >
573 > extensions.wrapfunction(
568 > extensions.wrapfunction(
574 > streamclone,
569 > streamclone,
575 > '_test_sync_point_walk_1',
570 > '_test_sync_point_walk_1',
576 > _test_sync_point_walk_1
571 > _test_sync_point_walk_1
577 > )
572 > )
578 > extensions.wrapfunction(
573 > extensions.wrapfunction(
579 > streamclone,
574 > streamclone,
580 > '_test_sync_point_walk_2',
575 > '_test_sync_point_walk_2',
581 > _test_sync_point_walk_2
576 > _test_sync_point_walk_2
582 > )
577 > )
583 > EOF
578 > EOF
584
579
585 prepare repo with small and big file to cover both code paths in emitrevlogdata
580 prepare repo with small and big file to cover both code paths in emitrevlogdata
586
581
587 $ hg init repo
582 $ hg init repo
588 $ touch repo/f1
583 $ touch repo/f1
589 $ $TESTDIR/seq.py 50000 > repo/f2
584 $ $TESTDIR/seq.py 50000 > repo/f2
590 $ hg -R repo ci -Aqm "0"
585 $ hg -R repo ci -Aqm "0"
591 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
586 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
592 $ export HG_TEST_STREAM_WALKED_FILE_1
587 $ export HG_TEST_STREAM_WALKED_FILE_1
593 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
588 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
594 $ export HG_TEST_STREAM_WALKED_FILE_2
589 $ export HG_TEST_STREAM_WALKED_FILE_2
595 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
590 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
596 $ export HG_TEST_STREAM_WALKED_FILE_3
591 $ export HG_TEST_STREAM_WALKED_FILE_3
597 # $ cat << EOF >> $HGRCPATH
592 # $ cat << EOF >> $HGRCPATH
598 # > [hooks]
593 # > [hooks]
599 # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*"
594 # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*"
600 # > EOF
595 # > EOF
601 $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
596 $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
602 $ cat hg.pid >> $DAEMON_PIDS
597 $ cat hg.pid >> $DAEMON_PIDS
603
598
604 clone while modifying the repo between stating file with write lock and
599 clone while modifying the repo between stating file with write lock and
605 actually serving file content
600 actually serving file content
606
601
607 $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") &
602 $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") &
608 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
603 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
609 $ echo >> repo/f1
604 $ echo >> repo/f1
610 $ echo >> repo/f2
605 $ echo >> repo/f2
611 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
606 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
612 $ touch $HG_TEST_STREAM_WALKED_FILE_2
607 $ touch $HG_TEST_STREAM_WALKED_FILE_2
613 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
608 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
614 $ hg -R clone id
609 $ hg -R clone id
615 000000000000
610 000000000000
616 $ cat errors.log
611 $ cat errors.log
617 $ cd ..
612 $ cd ..
618
613
619 Stream repository with bookmarks
614 Stream repository with bookmarks
620 --------------------------------
615 --------------------------------
621
616
622 (revert introduction of secret changeset)
617 (revert introduction of secret changeset)
623
618
624 $ hg -R server phase --draft 'secret()'
619 $ hg -R server phase --draft 'secret()'
625
620
626 add a bookmark
621 add a bookmark
627
622
628 $ hg -R server bookmark -r tip some-bookmark
623 $ hg -R server bookmark -r tip some-bookmark
629
624
630 clone it
625 clone it
631
626
632 #if stream-legacy
627 #if stream-legacy
633 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
628 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
634 streaming all changes
629 streaming all changes
635 1090 files to transfer, 102 KB of data (no-zstd !)
630 1090 files to transfer, 102 KB of data (no-zstd !)
636 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
631 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
637 1090 files to transfer, 98.8 KB of data (zstd !)
632 1090 files to transfer, 98.8 KB of data (zstd !)
638 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
633 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
639 searching for changes
634 searching for changes
640 no changes found
635 no changes found
641 updating to branch default
636 updating to branch default
642 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
637 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
643 #endif
638 #endif
644 #if stream-bundle2
639 #if stream-bundle2
645 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
640 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
646 streaming all changes
641 streaming all changes
647 1096 files to transfer, 102 KB of data (no-zstd !)
642 1096 files to transfer, 102 KB of data (no-zstd !)
648 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
643 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
649 1096 files to transfer, 99.1 KB of data (zstd !)
644 1096 files to transfer, 99.1 KB of data (zstd !)
650 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
645 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
651 updating to branch default
646 updating to branch default
652 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
647 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
653 #endif
648 #endif
654 $ hg verify -R with-bookmarks
649 $ hg verify -R with-bookmarks -q
655 checking changesets
656 checking manifests
657 crosschecking files in changesets and manifests
658 checking files
659 checked 3 changesets with 1088 changes to 1088 files
660 $ hg -R with-bookmarks bookmarks
650 $ hg -R with-bookmarks bookmarks
661 some-bookmark 2:5223b5e3265f
651 some-bookmark 2:5223b5e3265f
662
652
663 Stream repository with phases
653 Stream repository with phases
664 -----------------------------
654 -----------------------------
665
655
666 Clone as publishing
656 Clone as publishing
667
657
668 $ hg -R server phase -r 'all()'
658 $ hg -R server phase -r 'all()'
669 0: draft
659 0: draft
670 1: draft
660 1: draft
671 2: draft
661 2: draft
672
662
673 #if stream-legacy
663 #if stream-legacy
674 $ hg clone --stream http://localhost:$HGPORT phase-publish
664 $ hg clone --stream http://localhost:$HGPORT phase-publish
675 streaming all changes
665 streaming all changes
676 1090 files to transfer, 102 KB of data (no-zstd !)
666 1090 files to transfer, 102 KB of data (no-zstd !)
677 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
667 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
678 1090 files to transfer, 98.8 KB of data (zstd !)
668 1090 files to transfer, 98.8 KB of data (zstd !)
679 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
669 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
680 searching for changes
670 searching for changes
681 no changes found
671 no changes found
682 updating to branch default
672 updating to branch default
683 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
673 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
684 #endif
674 #endif
685 #if stream-bundle2
675 #if stream-bundle2
686 $ hg clone --stream http://localhost:$HGPORT phase-publish
676 $ hg clone --stream http://localhost:$HGPORT phase-publish
687 streaming all changes
677 streaming all changes
688 1096 files to transfer, 102 KB of data (no-zstd !)
678 1096 files to transfer, 102 KB of data (no-zstd !)
689 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
679 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
690 1096 files to transfer, 99.1 KB of data (zstd !)
680 1096 files to transfer, 99.1 KB of data (zstd !)
691 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
681 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
692 updating to branch default
682 updating to branch default
693 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
683 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 #endif
684 #endif
695 $ hg verify -R phase-publish
685 $ hg verify -R phase-publish -q
696 checking changesets
697 checking manifests
698 crosschecking files in changesets and manifests
699 checking files
700 checked 3 changesets with 1088 changes to 1088 files
701 $ hg -R phase-publish phase -r 'all()'
686 $ hg -R phase-publish phase -r 'all()'
702 0: public
687 0: public
703 1: public
688 1: public
704 2: public
689 2: public
705
690
706 Clone as non publishing
691 Clone as non publishing
707
692
708 $ cat << EOF >> server/.hg/hgrc
693 $ cat << EOF >> server/.hg/hgrc
709 > [phases]
694 > [phases]
710 > publish = False
695 > publish = False
711 > EOF
696 > EOF
712 $ killdaemons.py
697 $ killdaemons.py
713 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
698 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
714 $ cat hg.pid > $DAEMON_PIDS
699 $ cat hg.pid > $DAEMON_PIDS
715
700
716 #if stream-legacy
701 #if stream-legacy
717
702
718 With v1 of the stream protocol, changeset are always cloned as public. It make
703 With v1 of the stream protocol, changeset are always cloned as public. It make
719 stream v1 unsuitable for non-publishing repository.
704 stream v1 unsuitable for non-publishing repository.
720
705
721 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
706 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
722 streaming all changes
707 streaming all changes
723 1090 files to transfer, 102 KB of data (no-zstd !)
708 1090 files to transfer, 102 KB of data (no-zstd !)
724 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
709 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
725 1090 files to transfer, 98.8 KB of data (zstd !)
710 1090 files to transfer, 98.8 KB of data (zstd !)
726 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
711 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
727 searching for changes
712 searching for changes
728 no changes found
713 no changes found
729 updating to branch default
714 updating to branch default
730 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
715 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
731 $ hg -R phase-no-publish phase -r 'all()'
716 $ hg -R phase-no-publish phase -r 'all()'
732 0: public
717 0: public
733 1: public
718 1: public
734 2: public
719 2: public
735 #endif
720 #endif
736 #if stream-bundle2
721 #if stream-bundle2
737 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
722 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
738 streaming all changes
723 streaming all changes
739 1097 files to transfer, 102 KB of data (no-zstd !)
724 1097 files to transfer, 102 KB of data (no-zstd !)
740 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
725 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
741 1097 files to transfer, 99.1 KB of data (zstd !)
726 1097 files to transfer, 99.1 KB of data (zstd !)
742 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
727 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
743 updating to branch default
728 updating to branch default
744 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
729 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
745 $ hg -R phase-no-publish phase -r 'all()'
730 $ hg -R phase-no-publish phase -r 'all()'
746 0: draft
731 0: draft
747 1: draft
732 1: draft
748 2: draft
733 2: draft
749 #endif
734 #endif
750 $ hg verify -R phase-no-publish
735 $ hg verify -R phase-no-publish -q
751 checking changesets
752 checking manifests
753 crosschecking files in changesets and manifests
754 checking files
755 checked 3 changesets with 1088 changes to 1088 files
756
736
757 $ killdaemons.py
737 $ killdaemons.py
758
738
759 #if stream-legacy
739 #if stream-legacy
760
740
761 With v1 of the stream protocol, changeset are always cloned as public. There's
741 With v1 of the stream protocol, changeset are always cloned as public. There's
762 no obsolescence markers exchange in stream v1.
742 no obsolescence markers exchange in stream v1.
763
743
764 #endif
744 #endif
765 #if stream-bundle2
745 #if stream-bundle2
766
746
767 Stream repository with obsolescence
747 Stream repository with obsolescence
768 -----------------------------------
748 -----------------------------------
769
749
770 Clone non-publishing with obsolescence
750 Clone non-publishing with obsolescence
771
751
772 $ cat >> $HGRCPATH << EOF
752 $ cat >> $HGRCPATH << EOF
773 > [experimental]
753 > [experimental]
774 > evolution=all
754 > evolution=all
775 > EOF
755 > EOF
776
756
777 $ cd server
757 $ cd server
778 $ echo foo > foo
758 $ echo foo > foo
779 $ hg -q commit -m 'about to be pruned'
759 $ hg -q commit -m 'about to be pruned'
780 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
760 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
781 1 new obsolescence markers
761 1 new obsolescence markers
782 obsoleted 1 changesets
762 obsoleted 1 changesets
783 $ hg up null -q
763 $ hg up null -q
784 $ hg log -T '{rev}: {phase}\n'
764 $ hg log -T '{rev}: {phase}\n'
785 2: draft
765 2: draft
786 1: draft
766 1: draft
787 0: draft
767 0: draft
788 $ hg serve -p $HGPORT -d --pid-file=hg.pid
768 $ hg serve -p $HGPORT -d --pid-file=hg.pid
789 $ cat hg.pid > $DAEMON_PIDS
769 $ cat hg.pid > $DAEMON_PIDS
790 $ cd ..
770 $ cd ..
791
771
792 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
772 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
793 streaming all changes
773 streaming all changes
794 1098 files to transfer, 102 KB of data (no-zstd !)
774 1098 files to transfer, 102 KB of data (no-zstd !)
795 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
775 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
796 1098 files to transfer, 99.5 KB of data (zstd !)
776 1098 files to transfer, 99.5 KB of data (zstd !)
797 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd !)
777 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd !)
798 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
778 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
799 2: draft
779 2: draft
800 1: draft
780 1: draft
801 0: draft
781 0: draft
802 $ hg debugobsolete -R with-obsolescence
782 $ hg debugobsolete -R with-obsolescence
803 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
783 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
804 $ hg verify -R with-obsolescence
784 $ hg verify -R with-obsolescence -q
805 checking changesets
806 checking manifests
807 crosschecking files in changesets and manifests
808 checking files
809 checked 4 changesets with 1089 changes to 1088 files
810
785
811 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
786 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
812 streaming all changes
787 streaming all changes
813 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
788 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
814 abort: pull failed on remote
789 abort: pull failed on remote
815 [100]
790 [100]
816
791
817 $ killdaemons.py
792 $ killdaemons.py
818
793
819 #endif
794 #endif
820
795
821 Cloning a repo with no requirements doesn't give some obscure error
796 Cloning a repo with no requirements doesn't give some obscure error
822
797
823 $ mkdir -p empty-repo/.hg
798 $ mkdir -p empty-repo/.hg
824 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2
799 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2
825 $ hg --cwd empty-repo2 verify -q
800 $ hg --cwd empty-repo2 verify -q
@@ -1,1311 +1,1296
1 Prepare repo a:
1 Prepare repo a:
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ hg add a
6 $ hg add a
7 $ hg commit -m test
7 $ hg commit -m test
8 $ echo first line > b
8 $ echo first line > b
9 $ hg add b
9 $ hg add b
10
10
11 Create a non-inlined filelog:
11 Create a non-inlined filelog:
12
12
13 $ "$PYTHON" -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
13 $ "$PYTHON" -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
15 > cat data1 >> b
15 > cat data1 >> b
16 > hg commit -m test
16 > hg commit -m test
17 > done
17 > done
18
18
19 List files in store/data (should show a 'b.d'):
19 List files in store/data (should show a 'b.d'):
20
20
21 #if reporevlogstore
21 #if reporevlogstore
22 $ for i in .hg/store/data/*; do
22 $ for i in .hg/store/data/*; do
23 > echo $i
23 > echo $i
24 > done
24 > done
25 .hg/store/data/a.i
25 .hg/store/data/a.i
26 .hg/store/data/b.d
26 .hg/store/data/b.d
27 .hg/store/data/b.i
27 .hg/store/data/b.i
28 #endif
28 #endif
29
29
30 Trigger branchcache creation:
30 Trigger branchcache creation:
31
31
32 $ hg branches
32 $ hg branches
33 default 10:a7949464abda
33 default 10:a7949464abda
34 $ ls .hg/cache
34 $ ls .hg/cache
35 branch2-served
35 branch2-served
36 rbc-names-v1
36 rbc-names-v1
37 rbc-revs-v1
37 rbc-revs-v1
38
38
39 Default operation:
39 Default operation:
40
40
41 $ hg clone . ../b
41 $ hg clone . ../b
42 updating to branch default
42 updating to branch default
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ cd ../b
44 $ cd ../b
45
45
46 Ensure branchcache got copied over:
46 Ensure branchcache got copied over:
47
47
48 $ ls .hg/cache
48 $ ls .hg/cache
49 branch2-base
49 branch2-base
50 branch2-immutable
50 branch2-immutable
51 branch2-served
51 branch2-served
52 branch2-served.hidden
52 branch2-served.hidden
53 branch2-visible
53 branch2-visible
54 branch2-visible-hidden
54 branch2-visible-hidden
55 rbc-names-v1
55 rbc-names-v1
56 rbc-revs-v1
56 rbc-revs-v1
57 tags2
57 tags2
58 tags2-served
58 tags2-served
59
59
60 $ cat a
60 $ cat a
61 a
61 a
62 $ hg verify
62 $ hg verify -q
63 checking changesets
64 checking manifests
65 crosschecking files in changesets and manifests
66 checking files
67 checked 11 changesets with 11 changes to 2 files
68
63
69 Invalid dest '' must abort:
64 Invalid dest '' must abort:
70
65
71 $ hg clone . ''
66 $ hg clone . ''
72 abort: empty destination path is not valid
67 abort: empty destination path is not valid
73 [10]
68 [10]
74
69
75 No update, with debug option:
70 No update, with debug option:
76
71
77 #if hardlink
72 #if hardlink
78 $ hg --debug clone -U . ../c --config progress.debug=true
73 $ hg --debug clone -U . ../c --config progress.debug=true
79 linking: 1/15 files (6.67%)
74 linking: 1/15 files (6.67%)
80 linking: 2/15 files (13.33%)
75 linking: 2/15 files (13.33%)
81 linking: 3/15 files (20.00%)
76 linking: 3/15 files (20.00%)
82 linking: 4/15 files (26.67%)
77 linking: 4/15 files (26.67%)
83 linking: 5/15 files (33.33%)
78 linking: 5/15 files (33.33%)
84 linking: 6/15 files (40.00%)
79 linking: 6/15 files (40.00%)
85 linking: 7/15 files (46.67%)
80 linking: 7/15 files (46.67%)
86 linking: 8/15 files (53.33%)
81 linking: 8/15 files (53.33%)
87 linking: 9/15 files (60.00%)
82 linking: 9/15 files (60.00%)
88 linking: 10/15 files (66.67%)
83 linking: 10/15 files (66.67%)
89 linking: 11/15 files (73.33%)
84 linking: 11/15 files (73.33%)
90 linking: 12/15 files (80.00%)
85 linking: 12/15 files (80.00%)
91 linking: 13/15 files (86.67%)
86 linking: 13/15 files (86.67%)
92 linking: 14/15 files (93.33%)
87 linking: 14/15 files (93.33%)
93 linking: 15/15 files (100.00%)
88 linking: 15/15 files (100.00%)
94 linked 15 files
89 linked 15 files
95 updating the branch cache
90 updating the branch cache
96 #else
91 #else
97 $ hg --debug clone -U . ../c --config progress.debug=true
92 $ hg --debug clone -U . ../c --config progress.debug=true
98 linking: 1 files
93 linking: 1 files
99 copying: 2 files
94 copying: 2 files
100 copying: 3 files
95 copying: 3 files
101 copying: 4 files
96 copying: 4 files
102 copying: 5 files
97 copying: 5 files
103 copying: 6 files
98 copying: 6 files
104 copying: 7 files
99 copying: 7 files
105 copying: 8 files
100 copying: 8 files
106 #endif
101 #endif
107 $ cd ../c
102 $ cd ../c
108
103
109 Ensure branchcache got copied over:
104 Ensure branchcache got copied over:
110
105
111 $ ls .hg/cache
106 $ ls .hg/cache
112 branch2-base
107 branch2-base
113 branch2-immutable
108 branch2-immutable
114 branch2-served
109 branch2-served
115 branch2-served.hidden
110 branch2-served.hidden
116 branch2-visible
111 branch2-visible
117 branch2-visible-hidden
112 branch2-visible-hidden
118 rbc-names-v1
113 rbc-names-v1
119 rbc-revs-v1
114 rbc-revs-v1
120 tags2
115 tags2
121 tags2-served
116 tags2-served
122
117
123 $ cat a 2>/dev/null || echo "a not present"
118 $ cat a 2>/dev/null || echo "a not present"
124 a not present
119 a not present
125 $ hg verify
120 $ hg verify -q
126 checking changesets
127 checking manifests
128 crosschecking files in changesets and manifests
129 checking files
130 checked 11 changesets with 11 changes to 2 files
131
121
132 Default destination:
122 Default destination:
133
123
134 $ mkdir ../d
124 $ mkdir ../d
135 $ cd ../d
125 $ cd ../d
136 $ hg clone ../a
126 $ hg clone ../a
137 destination directory: a
127 destination directory: a
138 updating to branch default
128 updating to branch default
139 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
129 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 $ cd a
130 $ cd a
141 $ hg cat a
131 $ hg cat a
142 a
132 a
143 $ cd ../..
133 $ cd ../..
144
134
145 Check that we drop the 'file:' from the path before writing the .hgrc:
135 Check that we drop the 'file:' from the path before writing the .hgrc:
146
136
147 $ hg clone file:a e
137 $ hg clone file:a e
148 updating to branch default
138 updating to branch default
149 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 $ grep 'file:' e/.hg/hgrc
140 $ grep 'file:' e/.hg/hgrc
151 [1]
141 [1]
152
142
153 Check that path aliases are expanded:
143 Check that path aliases are expanded:
154
144
155 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
145 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
156 $ hg -R f showconfig paths.default
146 $ hg -R f showconfig paths.default
157 $TESTTMP/a#0
147 $TESTTMP/a#0
158
148
159 Use --pull:
149 Use --pull:
160
150
161 $ hg clone --pull a g
151 $ hg clone --pull a g
162 requesting all changes
152 requesting all changes
163 adding changesets
153 adding changesets
164 adding manifests
154 adding manifests
165 adding file changes
155 adding file changes
166 added 11 changesets with 11 changes to 2 files
156 added 11 changesets with 11 changes to 2 files
167 new changesets acb14030fe0a:a7949464abda
157 new changesets acb14030fe0a:a7949464abda
168 updating to branch default
158 updating to branch default
169 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 $ hg -R g verify
160 $ hg -R g verify -q
171 checking changesets
172 checking manifests
173 crosschecking files in changesets and manifests
174 checking files
175 checked 11 changesets with 11 changes to 2 files
176
161
177 Invalid dest '' with --pull must abort (issue2528):
162 Invalid dest '' with --pull must abort (issue2528):
178
163
179 $ hg clone --pull a ''
164 $ hg clone --pull a ''
180 abort: empty destination path is not valid
165 abort: empty destination path is not valid
181 [10]
166 [10]
182
167
183 Clone to '.':
168 Clone to '.':
184
169
185 $ mkdir h
170 $ mkdir h
186 $ cd h
171 $ cd h
187 $ hg clone ../a .
172 $ hg clone ../a .
188 updating to branch default
173 updating to branch default
189 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 $ cd ..
175 $ cd ..
191
176
192
177
193 *** Tests for option -u ***
178 *** Tests for option -u ***
194
179
195 Adding some more history to repo a:
180 Adding some more history to repo a:
196
181
197 $ cd a
182 $ cd a
198 $ hg tag ref1
183 $ hg tag ref1
199 $ echo the quick brown fox >a
184 $ echo the quick brown fox >a
200 $ hg ci -m "hacked default"
185 $ hg ci -m "hacked default"
201 $ hg up ref1
186 $ hg up ref1
202 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
187 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
203 $ hg branch stable
188 $ hg branch stable
204 marked working directory as branch stable
189 marked working directory as branch stable
205 (branches are permanent and global, did you want a bookmark?)
190 (branches are permanent and global, did you want a bookmark?)
206 $ echo some text >a
191 $ echo some text >a
207 $ hg ci -m "starting branch stable"
192 $ hg ci -m "starting branch stable"
208 $ hg tag ref2
193 $ hg tag ref2
209 $ echo some more text >a
194 $ echo some more text >a
210 $ hg ci -m "another change for branch stable"
195 $ hg ci -m "another change for branch stable"
211 $ hg up ref2
196 $ hg up ref2
212 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
197 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
213 $ hg parents
198 $ hg parents
214 changeset: 13:e8ece76546a6
199 changeset: 13:e8ece76546a6
215 branch: stable
200 branch: stable
216 tag: ref2
201 tag: ref2
217 parent: 10:a7949464abda
202 parent: 10:a7949464abda
218 user: test
203 user: test
219 date: Thu Jan 01 00:00:00 1970 +0000
204 date: Thu Jan 01 00:00:00 1970 +0000
220 summary: starting branch stable
205 summary: starting branch stable
221
206
222
207
223 Repo a has two heads:
208 Repo a has two heads:
224
209
225 $ hg heads
210 $ hg heads
226 changeset: 15:0aae7cf88f0d
211 changeset: 15:0aae7cf88f0d
227 branch: stable
212 branch: stable
228 tag: tip
213 tag: tip
229 user: test
214 user: test
230 date: Thu Jan 01 00:00:00 1970 +0000
215 date: Thu Jan 01 00:00:00 1970 +0000
231 summary: another change for branch stable
216 summary: another change for branch stable
232
217
233 changeset: 12:f21241060d6a
218 changeset: 12:f21241060d6a
234 user: test
219 user: test
235 date: Thu Jan 01 00:00:00 1970 +0000
220 date: Thu Jan 01 00:00:00 1970 +0000
236 summary: hacked default
221 summary: hacked default
237
222
238
223
239 $ cd ..
224 $ cd ..
240
225
241
226
242 Testing --noupdate with --updaterev (must abort):
227 Testing --noupdate with --updaterev (must abort):
243
228
244 $ hg clone --noupdate --updaterev 1 a ua
229 $ hg clone --noupdate --updaterev 1 a ua
245 abort: cannot specify both --noupdate and --updaterev
230 abort: cannot specify both --noupdate and --updaterev
246 [10]
231 [10]
247
232
248
233
249 Testing clone -u:
234 Testing clone -u:
250
235
251 $ hg clone -u . a ua
236 $ hg clone -u . a ua
252 updating to branch stable
237 updating to branch stable
253 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
254
239
255 Repo ua has both heads:
240 Repo ua has both heads:
256
241
257 $ hg -R ua heads
242 $ hg -R ua heads
258 changeset: 15:0aae7cf88f0d
243 changeset: 15:0aae7cf88f0d
259 branch: stable
244 branch: stable
260 tag: tip
245 tag: tip
261 user: test
246 user: test
262 date: Thu Jan 01 00:00:00 1970 +0000
247 date: Thu Jan 01 00:00:00 1970 +0000
263 summary: another change for branch stable
248 summary: another change for branch stable
264
249
265 changeset: 12:f21241060d6a
250 changeset: 12:f21241060d6a
266 user: test
251 user: test
267 date: Thu Jan 01 00:00:00 1970 +0000
252 date: Thu Jan 01 00:00:00 1970 +0000
268 summary: hacked default
253 summary: hacked default
269
254
270
255
271 Same revision checked out in repo a and ua:
256 Same revision checked out in repo a and ua:
272
257
273 $ hg -R a parents --template "{node|short}\n"
258 $ hg -R a parents --template "{node|short}\n"
274 e8ece76546a6
259 e8ece76546a6
275 $ hg -R ua parents --template "{node|short}\n"
260 $ hg -R ua parents --template "{node|short}\n"
276 e8ece76546a6
261 e8ece76546a6
277
262
278 $ rm -r ua
263 $ rm -r ua
279
264
280
265
281 Testing clone --pull -u:
266 Testing clone --pull -u:
282
267
283 $ hg clone --pull -u . a ua
268 $ hg clone --pull -u . a ua
284 requesting all changes
269 requesting all changes
285 adding changesets
270 adding changesets
286 adding manifests
271 adding manifests
287 adding file changes
272 adding file changes
288 added 16 changesets with 16 changes to 3 files (+1 heads)
273 added 16 changesets with 16 changes to 3 files (+1 heads)
289 new changesets acb14030fe0a:0aae7cf88f0d
274 new changesets acb14030fe0a:0aae7cf88f0d
290 updating to branch stable
275 updating to branch stable
291 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
292
277
293 Repo ua has both heads:
278 Repo ua has both heads:
294
279
295 $ hg -R ua heads
280 $ hg -R ua heads
296 changeset: 15:0aae7cf88f0d
281 changeset: 15:0aae7cf88f0d
297 branch: stable
282 branch: stable
298 tag: tip
283 tag: tip
299 user: test
284 user: test
300 date: Thu Jan 01 00:00:00 1970 +0000
285 date: Thu Jan 01 00:00:00 1970 +0000
301 summary: another change for branch stable
286 summary: another change for branch stable
302
287
303 changeset: 12:f21241060d6a
288 changeset: 12:f21241060d6a
304 user: test
289 user: test
305 date: Thu Jan 01 00:00:00 1970 +0000
290 date: Thu Jan 01 00:00:00 1970 +0000
306 summary: hacked default
291 summary: hacked default
307
292
308
293
309 Same revision checked out in repo a and ua:
294 Same revision checked out in repo a and ua:
310
295
311 $ hg -R a parents --template "{node|short}\n"
296 $ hg -R a parents --template "{node|short}\n"
312 e8ece76546a6
297 e8ece76546a6
313 $ hg -R ua parents --template "{node|short}\n"
298 $ hg -R ua parents --template "{node|short}\n"
314 e8ece76546a6
299 e8ece76546a6
315
300
316 $ rm -r ua
301 $ rm -r ua
317
302
318
303
319 Testing clone -u <branch>:
304 Testing clone -u <branch>:
320
305
321 $ hg clone -u stable a ua
306 $ hg clone -u stable a ua
322 updating to branch stable
307 updating to branch stable
323 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
324
309
325 Repo ua has both heads:
310 Repo ua has both heads:
326
311
327 $ hg -R ua heads
312 $ hg -R ua heads
328 changeset: 15:0aae7cf88f0d
313 changeset: 15:0aae7cf88f0d
329 branch: stable
314 branch: stable
330 tag: tip
315 tag: tip
331 user: test
316 user: test
332 date: Thu Jan 01 00:00:00 1970 +0000
317 date: Thu Jan 01 00:00:00 1970 +0000
333 summary: another change for branch stable
318 summary: another change for branch stable
334
319
335 changeset: 12:f21241060d6a
320 changeset: 12:f21241060d6a
336 user: test
321 user: test
337 date: Thu Jan 01 00:00:00 1970 +0000
322 date: Thu Jan 01 00:00:00 1970 +0000
338 summary: hacked default
323 summary: hacked default
339
324
340
325
341 Branch 'stable' is checked out:
326 Branch 'stable' is checked out:
342
327
343 $ hg -R ua parents
328 $ hg -R ua parents
344 changeset: 15:0aae7cf88f0d
329 changeset: 15:0aae7cf88f0d
345 branch: stable
330 branch: stable
346 tag: tip
331 tag: tip
347 user: test
332 user: test
348 date: Thu Jan 01 00:00:00 1970 +0000
333 date: Thu Jan 01 00:00:00 1970 +0000
349 summary: another change for branch stable
334 summary: another change for branch stable
350
335
351
336
352 $ rm -r ua
337 $ rm -r ua
353
338
354
339
355 Testing default checkout:
340 Testing default checkout:
356
341
357 $ hg clone a ua
342 $ hg clone a ua
358 updating to branch default
343 updating to branch default
359 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
344 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
360
345
361 Repo ua has both heads:
346 Repo ua has both heads:
362
347
363 $ hg -R ua heads
348 $ hg -R ua heads
364 changeset: 15:0aae7cf88f0d
349 changeset: 15:0aae7cf88f0d
365 branch: stable
350 branch: stable
366 tag: tip
351 tag: tip
367 user: test
352 user: test
368 date: Thu Jan 01 00:00:00 1970 +0000
353 date: Thu Jan 01 00:00:00 1970 +0000
369 summary: another change for branch stable
354 summary: another change for branch stable
370
355
371 changeset: 12:f21241060d6a
356 changeset: 12:f21241060d6a
372 user: test
357 user: test
373 date: Thu Jan 01 00:00:00 1970 +0000
358 date: Thu Jan 01 00:00:00 1970 +0000
374 summary: hacked default
359 summary: hacked default
375
360
376
361
377 Branch 'default' is checked out:
362 Branch 'default' is checked out:
378
363
379 $ hg -R ua parents
364 $ hg -R ua parents
380 changeset: 12:f21241060d6a
365 changeset: 12:f21241060d6a
381 user: test
366 user: test
382 date: Thu Jan 01 00:00:00 1970 +0000
367 date: Thu Jan 01 00:00:00 1970 +0000
383 summary: hacked default
368 summary: hacked default
384
369
385 Test clone with a branch named "@" (issue3677)
370 Test clone with a branch named "@" (issue3677)
386
371
387 $ hg -R ua branch @
372 $ hg -R ua branch @
388 marked working directory as branch @
373 marked working directory as branch @
389 $ hg -R ua commit -m 'created branch @'
374 $ hg -R ua commit -m 'created branch @'
390 $ hg clone ua atbranch
375 $ hg clone ua atbranch
391 updating to branch default
376 updating to branch default
392 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
393 $ hg -R atbranch heads
378 $ hg -R atbranch heads
394 changeset: 16:798b6d97153e
379 changeset: 16:798b6d97153e
395 branch: @
380 branch: @
396 tag: tip
381 tag: tip
397 parent: 12:f21241060d6a
382 parent: 12:f21241060d6a
398 user: test
383 user: test
399 date: Thu Jan 01 00:00:00 1970 +0000
384 date: Thu Jan 01 00:00:00 1970 +0000
400 summary: created branch @
385 summary: created branch @
401
386
402 changeset: 15:0aae7cf88f0d
387 changeset: 15:0aae7cf88f0d
403 branch: stable
388 branch: stable
404 user: test
389 user: test
405 date: Thu Jan 01 00:00:00 1970 +0000
390 date: Thu Jan 01 00:00:00 1970 +0000
406 summary: another change for branch stable
391 summary: another change for branch stable
407
392
408 changeset: 12:f21241060d6a
393 changeset: 12:f21241060d6a
409 user: test
394 user: test
410 date: Thu Jan 01 00:00:00 1970 +0000
395 date: Thu Jan 01 00:00:00 1970 +0000
411 summary: hacked default
396 summary: hacked default
412
397
413 $ hg -R atbranch parents
398 $ hg -R atbranch parents
414 changeset: 12:f21241060d6a
399 changeset: 12:f21241060d6a
415 user: test
400 user: test
416 date: Thu Jan 01 00:00:00 1970 +0000
401 date: Thu Jan 01 00:00:00 1970 +0000
417 summary: hacked default
402 summary: hacked default
418
403
419
404
420 $ rm -r ua atbranch
405 $ rm -r ua atbranch
421
406
422
407
423 Testing #<branch>:
408 Testing #<branch>:
424
409
425 $ hg clone -u . a#stable ua
410 $ hg clone -u . a#stable ua
426 adding changesets
411 adding changesets
427 adding manifests
412 adding manifests
428 adding file changes
413 adding file changes
429 added 14 changesets with 14 changes to 3 files
414 added 14 changesets with 14 changes to 3 files
430 new changesets acb14030fe0a:0aae7cf88f0d
415 new changesets acb14030fe0a:0aae7cf88f0d
431 updating to branch stable
416 updating to branch stable
432 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
417 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
433
418
434 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
419 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
435
420
436 $ hg -R ua heads
421 $ hg -R ua heads
437 changeset: 13:0aae7cf88f0d
422 changeset: 13:0aae7cf88f0d
438 branch: stable
423 branch: stable
439 tag: tip
424 tag: tip
440 user: test
425 user: test
441 date: Thu Jan 01 00:00:00 1970 +0000
426 date: Thu Jan 01 00:00:00 1970 +0000
442 summary: another change for branch stable
427 summary: another change for branch stable
443
428
444 changeset: 10:a7949464abda
429 changeset: 10:a7949464abda
445 user: test
430 user: test
446 date: Thu Jan 01 00:00:00 1970 +0000
431 date: Thu Jan 01 00:00:00 1970 +0000
447 summary: test
432 summary: test
448
433
449
434
450 Same revision checked out in repo a and ua:
435 Same revision checked out in repo a and ua:
451
436
452 $ hg -R a parents --template "{node|short}\n"
437 $ hg -R a parents --template "{node|short}\n"
453 e8ece76546a6
438 e8ece76546a6
454 $ hg -R ua parents --template "{node|short}\n"
439 $ hg -R ua parents --template "{node|short}\n"
455 e8ece76546a6
440 e8ece76546a6
456
441
457 $ rm -r ua
442 $ rm -r ua
458
443
459
444
460 Testing -u -r <branch>:
445 Testing -u -r <branch>:
461
446
462 $ hg clone -u . -r stable a ua
447 $ hg clone -u . -r stable a ua
463 adding changesets
448 adding changesets
464 adding manifests
449 adding manifests
465 adding file changes
450 adding file changes
466 added 14 changesets with 14 changes to 3 files
451 added 14 changesets with 14 changes to 3 files
467 new changesets acb14030fe0a:0aae7cf88f0d
452 new changesets acb14030fe0a:0aae7cf88f0d
468 updating to branch stable
453 updating to branch stable
469 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
454 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
470
455
471 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
456 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
472
457
473 $ hg -R ua heads
458 $ hg -R ua heads
474 changeset: 13:0aae7cf88f0d
459 changeset: 13:0aae7cf88f0d
475 branch: stable
460 branch: stable
476 tag: tip
461 tag: tip
477 user: test
462 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
463 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: another change for branch stable
464 summary: another change for branch stable
480
465
481 changeset: 10:a7949464abda
466 changeset: 10:a7949464abda
482 user: test
467 user: test
483 date: Thu Jan 01 00:00:00 1970 +0000
468 date: Thu Jan 01 00:00:00 1970 +0000
484 summary: test
469 summary: test
485
470
486
471
487 Same revision checked out in repo a and ua:
472 Same revision checked out in repo a and ua:
488
473
489 $ hg -R a parents --template "{node|short}\n"
474 $ hg -R a parents --template "{node|short}\n"
490 e8ece76546a6
475 e8ece76546a6
491 $ hg -R ua parents --template "{node|short}\n"
476 $ hg -R ua parents --template "{node|short}\n"
492 e8ece76546a6
477 e8ece76546a6
493
478
494 $ rm -r ua
479 $ rm -r ua
495
480
496
481
497 Testing -r <branch>:
482 Testing -r <branch>:
498
483
499 $ hg clone -r stable a ua
484 $ hg clone -r stable a ua
500 adding changesets
485 adding changesets
501 adding manifests
486 adding manifests
502 adding file changes
487 adding file changes
503 added 14 changesets with 14 changes to 3 files
488 added 14 changesets with 14 changes to 3 files
504 new changesets acb14030fe0a:0aae7cf88f0d
489 new changesets acb14030fe0a:0aae7cf88f0d
505 updating to branch stable
490 updating to branch stable
506 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
491 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
507
492
508 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
493 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
509
494
510 $ hg -R ua heads
495 $ hg -R ua heads
511 changeset: 13:0aae7cf88f0d
496 changeset: 13:0aae7cf88f0d
512 branch: stable
497 branch: stable
513 tag: tip
498 tag: tip
514 user: test
499 user: test
515 date: Thu Jan 01 00:00:00 1970 +0000
500 date: Thu Jan 01 00:00:00 1970 +0000
516 summary: another change for branch stable
501 summary: another change for branch stable
517
502
518 changeset: 10:a7949464abda
503 changeset: 10:a7949464abda
519 user: test
504 user: test
520 date: Thu Jan 01 00:00:00 1970 +0000
505 date: Thu Jan 01 00:00:00 1970 +0000
521 summary: test
506 summary: test
522
507
523
508
524 Branch 'stable' is checked out:
509 Branch 'stable' is checked out:
525
510
526 $ hg -R ua parents
511 $ hg -R ua parents
527 changeset: 13:0aae7cf88f0d
512 changeset: 13:0aae7cf88f0d
528 branch: stable
513 branch: stable
529 tag: tip
514 tag: tip
530 user: test
515 user: test
531 date: Thu Jan 01 00:00:00 1970 +0000
516 date: Thu Jan 01 00:00:00 1970 +0000
532 summary: another change for branch stable
517 summary: another change for branch stable
533
518
534
519
535 $ rm -r ua
520 $ rm -r ua
536
521
537
522
538 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
523 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
539 iterable in addbranchrevs()
524 iterable in addbranchrevs()
540
525
541 $ cat <<EOF > simpleclone.py
526 $ cat <<EOF > simpleclone.py
542 > from mercurial import hg, ui as uimod
527 > from mercurial import hg, ui as uimod
543 > myui = uimod.ui.load()
528 > myui = uimod.ui.load()
544 > repo = hg.repository(myui, b'a')
529 > repo = hg.repository(myui, b'a')
545 > hg.clone(myui, {}, repo, dest=b"ua")
530 > hg.clone(myui, {}, repo, dest=b"ua")
546 > EOF
531 > EOF
547
532
548 $ "$PYTHON" simpleclone.py
533 $ "$PYTHON" simpleclone.py
549 updating to branch default
534 updating to branch default
550 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
535 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
551
536
552 $ rm -r ua
537 $ rm -r ua
553
538
554 $ cat <<EOF > branchclone.py
539 $ cat <<EOF > branchclone.py
555 > from mercurial import extensions, hg, ui as uimod
540 > from mercurial import extensions, hg, ui as uimod
556 > myui = uimod.ui.load()
541 > myui = uimod.ui.load()
557 > extensions.loadall(myui)
542 > extensions.loadall(myui)
558 > extensions.populateui(myui)
543 > extensions.populateui(myui)
559 > repo = hg.repository(myui, b'a')
544 > repo = hg.repository(myui, b'a')
560 > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable"])
545 > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable"])
561 > EOF
546 > EOF
562
547
563 $ "$PYTHON" branchclone.py
548 $ "$PYTHON" branchclone.py
564 adding changesets
549 adding changesets
565 adding manifests
550 adding manifests
566 adding file changes
551 adding file changes
567 added 14 changesets with 14 changes to 3 files
552 added 14 changesets with 14 changes to 3 files
568 new changesets acb14030fe0a:0aae7cf88f0d
553 new changesets acb14030fe0a:0aae7cf88f0d
569 updating to branch stable
554 updating to branch stable
570 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
555 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
571 $ rm -r ua
556 $ rm -r ua
572
557
573 Local clones don't get confused by unusual experimental.evolution options
558 Local clones don't get confused by unusual experimental.evolution options
574
559
575 $ hg clone \
560 $ hg clone \
576 > --config experimental.evolution=allowunstable,allowdivergence,exchange \
561 > --config experimental.evolution=allowunstable,allowdivergence,exchange \
577 > a ua
562 > a ua
578 updating to branch default
563 updating to branch default
579 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
564 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
580 $ rm -r ua
565 $ rm -r ua
581
566
582 $ hg clone \
567 $ hg clone \
583 > --config experimental.evolution.createmarkers=no \
568 > --config experimental.evolution.createmarkers=no \
584 > --config experimental.evolution.allowunstable=yes \
569 > --config experimental.evolution.allowunstable=yes \
585 > --config experimental.evolution.allowdivergence=yes \
570 > --config experimental.evolution.allowdivergence=yes \
586 > --config experimental.evolution.exchange=yes \
571 > --config experimental.evolution.exchange=yes \
587 > a ua
572 > a ua
588 updating to branch default
573 updating to branch default
589 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
574 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
590 $ rm -r ua
575 $ rm -r ua
591
576
592 Test clone with special '@' bookmark:
577 Test clone with special '@' bookmark:
593 $ cd a
578 $ cd a
594 $ hg bookmark -r a7949464abda @ # branch point of stable from default
579 $ hg bookmark -r a7949464abda @ # branch point of stable from default
595 $ hg clone . ../i
580 $ hg clone . ../i
596 updating to bookmark @
581 updating to bookmark @
597 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
582 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
598 $ hg id -i ../i
583 $ hg id -i ../i
599 a7949464abda
584 a7949464abda
600 $ rm -r ../i
585 $ rm -r ../i
601
586
602 $ hg bookmark -f -r stable @
587 $ hg bookmark -f -r stable @
603 $ hg bookmarks
588 $ hg bookmarks
604 @ 15:0aae7cf88f0d
589 @ 15:0aae7cf88f0d
605 $ hg clone . ../i
590 $ hg clone . ../i
606 updating to bookmark @ on branch stable
591 updating to bookmark @ on branch stable
607 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
592 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 $ hg id -i ../i
593 $ hg id -i ../i
609 0aae7cf88f0d
594 0aae7cf88f0d
610 $ cd "$TESTTMP"
595 $ cd "$TESTTMP"
611
596
612
597
613 Testing failures:
598 Testing failures:
614
599
615 $ mkdir fail
600 $ mkdir fail
616 $ cd fail
601 $ cd fail
617
602
618 No local source
603 No local source
619
604
620 $ hg clone a b
605 $ hg clone a b
621 abort: repository a not found
606 abort: repository a not found
622 [255]
607 [255]
623
608
624 Invalid URL
609 Invalid URL
625
610
626 $ hg clone http://invalid:url/a b
611 $ hg clone http://invalid:url/a b
627 abort: error: nonnumeric port: 'url'
612 abort: error: nonnumeric port: 'url'
628 [100]
613 [100]
629
614
630 No remote source
615 No remote source
631
616
632 #if windows
617 #if windows
633 $ hg clone http://$LOCALIP:3121/a b
618 $ hg clone http://$LOCALIP:3121/a b
634 abort: error: * (glob)
619 abort: error: * (glob)
635 [100]
620 [100]
636 #else
621 #else
637 $ hg clone http://$LOCALIP:3121/a b
622 $ hg clone http://$LOCALIP:3121/a b
638 abort: error: *refused* (glob)
623 abort: error: *refused* (glob)
639 [100]
624 [100]
640 #endif
625 #endif
641 $ rm -rf b # work around bug with http clone
626 $ rm -rf b # work around bug with http clone
642
627
643
628
644 #if unix-permissions no-root
629 #if unix-permissions no-root
645
630
646 Inaccessible source
631 Inaccessible source
647
632
648 $ mkdir a
633 $ mkdir a
649 $ chmod 000 a
634 $ chmod 000 a
650 $ hg clone a b
635 $ hg clone a b
651 abort: Permission denied: *$TESTTMP/fail/a/.hg* (glob)
636 abort: Permission denied: *$TESTTMP/fail/a/.hg* (glob)
652 [255]
637 [255]
653
638
654 Inaccessible destination
639 Inaccessible destination
655
640
656 $ hg init b
641 $ hg init b
657 $ cd b
642 $ cd b
658 $ hg clone . ../a
643 $ hg clone . ../a
659 abort: Permission denied: *../a* (glob)
644 abort: Permission denied: *../a* (glob)
660 [255]
645 [255]
661 $ cd ..
646 $ cd ..
662 $ chmod 700 a
647 $ chmod 700 a
663 $ rm -r a b
648 $ rm -r a b
664
649
665 #endif
650 #endif
666
651
667
652
668 #if fifo
653 #if fifo
669
654
670 Source of wrong type
655 Source of wrong type
671
656
672 $ mkfifo a
657 $ mkfifo a
673 $ hg clone a b
658 $ hg clone a b
674 abort: $ENOTDIR$: *$TESTTMP/fail/a/.hg* (glob)
659 abort: $ENOTDIR$: *$TESTTMP/fail/a/.hg* (glob)
675 [255]
660 [255]
676 $ rm a
661 $ rm a
677
662
678 #endif
663 #endif
679
664
680 Default destination, same directory
665 Default destination, same directory
681
666
682 $ hg init q
667 $ hg init q
683 $ hg clone q
668 $ hg clone q
684 destination directory: q
669 destination directory: q
685 abort: destination 'q' is not empty
670 abort: destination 'q' is not empty
686 [10]
671 [10]
687
672
688 destination directory not empty
673 destination directory not empty
689
674
690 $ mkdir a
675 $ mkdir a
691 $ echo stuff > a/a
676 $ echo stuff > a/a
692 $ hg clone q a
677 $ hg clone q a
693 abort: destination 'a' is not empty
678 abort: destination 'a' is not empty
694 [10]
679 [10]
695
680
696
681
697 #if unix-permissions no-root
682 #if unix-permissions no-root
698
683
699 leave existing directory in place after clone failure
684 leave existing directory in place after clone failure
700
685
701 $ hg init c
686 $ hg init c
702 $ cd c
687 $ cd c
703 $ echo c > c
688 $ echo c > c
704 $ hg commit -A -m test
689 $ hg commit -A -m test
705 adding c
690 adding c
706 $ chmod -rx .hg/store/data
691 $ chmod -rx .hg/store/data
707 $ cd ..
692 $ cd ..
708 $ mkdir d
693 $ mkdir d
709 $ hg clone c d 2> err
694 $ hg clone c d 2> err
710 [255]
695 [255]
711 $ test -d d
696 $ test -d d
712 $ test -d d/.hg
697 $ test -d d/.hg
713 [1]
698 [1]
714
699
715 re-enable perm to allow deletion
700 re-enable perm to allow deletion
716
701
717 $ chmod +rx c/.hg/store/data
702 $ chmod +rx c/.hg/store/data
718
703
719 #endif
704 #endif
720
705
721 $ cd ..
706 $ cd ..
722
707
723 Test clone from the repository in (emulated) revlog format 0 (issue4203):
708 Test clone from the repository in (emulated) revlog format 0 (issue4203):
724
709
725 $ mkdir issue4203
710 $ mkdir issue4203
726 $ mkdir -p src/.hg
711 $ mkdir -p src/.hg
727 $ echo foo > src/foo
712 $ echo foo > src/foo
728 $ hg -R src add src/foo
713 $ hg -R src add src/foo
729 $ hg -R src commit -m '#0'
714 $ hg -R src commit -m '#0'
730 $ hg -R src log -q
715 $ hg -R src log -q
731 0:e1bab28bca43
716 0:e1bab28bca43
732 $ hg -R src debugrevlog -c | egrep 'format|flags'
717 $ hg -R src debugrevlog -c | egrep 'format|flags'
733 format : 0
718 format : 0
734 flags : (none)
719 flags : (none)
735 $ hg root -R src -T json | sed 's|\\\\|\\|g'
720 $ hg root -R src -T json | sed 's|\\\\|\\|g'
736 [
721 [
737 {
722 {
738 "hgpath": "$TESTTMP/src/.hg",
723 "hgpath": "$TESTTMP/src/.hg",
739 "reporoot": "$TESTTMP/src",
724 "reporoot": "$TESTTMP/src",
740 "storepath": "$TESTTMP/src/.hg"
725 "storepath": "$TESTTMP/src/.hg"
741 }
726 }
742 ]
727 ]
743 $ hg clone -U -q src dst
728 $ hg clone -U -q src dst
744 $ hg -R dst log -q
729 $ hg -R dst log -q
745 0:e1bab28bca43
730 0:e1bab28bca43
746
731
747 Create repositories to test auto sharing functionality
732 Create repositories to test auto sharing functionality
748
733
749 $ cat >> $HGRCPATH << EOF
734 $ cat >> $HGRCPATH << EOF
750 > [extensions]
735 > [extensions]
751 > share=
736 > share=
752 > EOF
737 > EOF
753
738
754 $ hg init empty
739 $ hg init empty
755 $ hg init source1a
740 $ hg init source1a
756 $ cd source1a
741 $ cd source1a
757 $ echo initial1 > foo
742 $ echo initial1 > foo
758 $ hg -q commit -A -m initial
743 $ hg -q commit -A -m initial
759 $ echo second > foo
744 $ echo second > foo
760 $ hg commit -m second
745 $ hg commit -m second
761 $ cd ..
746 $ cd ..
762
747
763 $ hg init filteredrev0
748 $ hg init filteredrev0
764 $ cd filteredrev0
749 $ cd filteredrev0
765 $ cat >> .hg/hgrc << EOF
750 $ cat >> .hg/hgrc << EOF
766 > [experimental]
751 > [experimental]
767 > evolution.createmarkers=True
752 > evolution.createmarkers=True
768 > EOF
753 > EOF
769 $ echo initial1 > foo
754 $ echo initial1 > foo
770 $ hg -q commit -A -m initial0
755 $ hg -q commit -A -m initial0
771 $ hg -q up -r null
756 $ hg -q up -r null
772 $ echo initial2 > foo
757 $ echo initial2 > foo
773 $ hg -q commit -A -m initial1
758 $ hg -q commit -A -m initial1
774 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
759 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
775 1 new obsolescence markers
760 1 new obsolescence markers
776 obsoleted 1 changesets
761 obsoleted 1 changesets
777 $ cd ..
762 $ cd ..
778
763
779 $ hg -q clone --pull source1a source1b
764 $ hg -q clone --pull source1a source1b
780 $ cd source1a
765 $ cd source1a
781 $ hg bookmark bookA
766 $ hg bookmark bookA
782 $ echo 1a > foo
767 $ echo 1a > foo
783 $ hg commit -m 1a
768 $ hg commit -m 1a
784 $ cd ../source1b
769 $ cd ../source1b
785 $ hg -q up -r 0
770 $ hg -q up -r 0
786 $ echo head1 > foo
771 $ echo head1 > foo
787 $ hg commit -m head1
772 $ hg commit -m head1
788 created new head
773 created new head
789 $ hg bookmark head1
774 $ hg bookmark head1
790 $ hg -q up -r 0
775 $ hg -q up -r 0
791 $ echo head2 > foo
776 $ echo head2 > foo
792 $ hg commit -m head2
777 $ hg commit -m head2
793 created new head
778 created new head
794 $ hg bookmark head2
779 $ hg bookmark head2
795 $ hg -q up -r 0
780 $ hg -q up -r 0
796 $ hg branch branch1
781 $ hg branch branch1
797 marked working directory as branch branch1
782 marked working directory as branch branch1
798 (branches are permanent and global, did you want a bookmark?)
783 (branches are permanent and global, did you want a bookmark?)
799 $ echo branch1 > foo
784 $ echo branch1 > foo
800 $ hg commit -m branch1
785 $ hg commit -m branch1
801 $ hg -q up -r 0
786 $ hg -q up -r 0
802 $ hg branch branch2
787 $ hg branch branch2
803 marked working directory as branch branch2
788 marked working directory as branch branch2
804 $ echo branch2 > foo
789 $ echo branch2 > foo
805 $ hg commit -m branch2
790 $ hg commit -m branch2
806 $ cd ..
791 $ cd ..
807 $ hg init source2
792 $ hg init source2
808 $ cd source2
793 $ cd source2
809 $ echo initial2 > foo
794 $ echo initial2 > foo
810 $ hg -q commit -A -m initial2
795 $ hg -q commit -A -m initial2
811 $ echo second > foo
796 $ echo second > foo
812 $ hg commit -m second
797 $ hg commit -m second
813 $ cd ..
798 $ cd ..
814
799
815 Clone with auto share from an empty repo should not result in share
800 Clone with auto share from an empty repo should not result in share
816
801
817 $ mkdir share
802 $ mkdir share
818 $ hg --config share.pool=share clone empty share-empty
803 $ hg --config share.pool=share clone empty share-empty
819 (not using pooled storage: remote appears to be empty)
804 (not using pooled storage: remote appears to be empty)
820 updating to branch default
805 updating to branch default
821 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
806 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
822 $ ls share
807 $ ls share
823 $ test -d share-empty/.hg/store
808 $ test -d share-empty/.hg/store
824 $ test -f share-empty/.hg/sharedpath
809 $ test -f share-empty/.hg/sharedpath
825 [1]
810 [1]
826
811
827 Clone with auto share from a repo with filtered revision 0 should not result in share
812 Clone with auto share from a repo with filtered revision 0 should not result in share
828
813
829 $ hg --config share.pool=share clone filteredrev0 share-filtered
814 $ hg --config share.pool=share clone filteredrev0 share-filtered
830 (not using pooled storage: unable to resolve identity of remote)
815 (not using pooled storage: unable to resolve identity of remote)
831 requesting all changes
816 requesting all changes
832 adding changesets
817 adding changesets
833 adding manifests
818 adding manifests
834 adding file changes
819 adding file changes
835 added 1 changesets with 1 changes to 1 files
820 added 1 changesets with 1 changes to 1 files
836 new changesets e082c1832e09
821 new changesets e082c1832e09
837 updating to branch default
822 updating to branch default
838 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
823 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
839
824
840 Clone from repo with content should result in shared store being created
825 Clone from repo with content should result in shared store being created
841
826
842 $ hg --config share.pool=share clone source1a share-dest1a
827 $ hg --config share.pool=share clone source1a share-dest1a
843 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
828 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
844 requesting all changes
829 requesting all changes
845 adding changesets
830 adding changesets
846 adding manifests
831 adding manifests
847 adding file changes
832 adding file changes
848 added 3 changesets with 3 changes to 1 files
833 added 3 changesets with 3 changes to 1 files
849 new changesets b5f04eac9d8f:e5bfe23c0b47
834 new changesets b5f04eac9d8f:e5bfe23c0b47
850 searching for changes
835 searching for changes
851 no changes found
836 no changes found
852 adding remote bookmark bookA
837 adding remote bookmark bookA
853 updating working directory
838 updating working directory
854 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
839 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
855
840
856 The shared repo should have been created
841 The shared repo should have been created
857
842
858 $ ls share
843 $ ls share
859 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
844 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
860
845
861 The destination should point to it
846 The destination should point to it
862
847
863 $ cat share-dest1a/.hg/sharedpath; echo
848 $ cat share-dest1a/.hg/sharedpath; echo
864 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
849 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
865
850
866 The destination should have bookmarks
851 The destination should have bookmarks
867
852
868 $ hg -R share-dest1a bookmarks
853 $ hg -R share-dest1a bookmarks
869 bookA 2:e5bfe23c0b47
854 bookA 2:e5bfe23c0b47
870
855
871 The default path should be the remote, not the share
856 The default path should be the remote, not the share
872
857
873 $ hg -R share-dest1a config paths.default
858 $ hg -R share-dest1a config paths.default
874 $TESTTMP/source1a
859 $TESTTMP/source1a
875
860
876 Clone with existing share dir should result in pull + share
861 Clone with existing share dir should result in pull + share
877
862
878 $ hg --config share.pool=share clone source1b share-dest1b
863 $ hg --config share.pool=share clone source1b share-dest1b
879 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
864 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
880 searching for changes
865 searching for changes
881 adding changesets
866 adding changesets
882 adding manifests
867 adding manifests
883 adding file changes
868 adding file changes
884 adding remote bookmark head1
869 adding remote bookmark head1
885 adding remote bookmark head2
870 adding remote bookmark head2
886 added 4 changesets with 4 changes to 1 files (+4 heads)
871 added 4 changesets with 4 changes to 1 files (+4 heads)
887 new changesets 4a8dc1ab4c13:6bacf4683960
872 new changesets 4a8dc1ab4c13:6bacf4683960
888 updating working directory
873 updating working directory
889 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
874 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
890
875
891 $ ls share
876 $ ls share
892 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
877 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
893
878
894 $ cat share-dest1b/.hg/sharedpath; echo
879 $ cat share-dest1b/.hg/sharedpath; echo
895 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
880 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
896
881
897 We only get bookmarks from the remote, not everything in the share
882 We only get bookmarks from the remote, not everything in the share
898
883
899 $ hg -R share-dest1b bookmarks
884 $ hg -R share-dest1b bookmarks
900 head1 3:4a8dc1ab4c13
885 head1 3:4a8dc1ab4c13
901 head2 4:99f71071f117
886 head2 4:99f71071f117
902
887
903 Default path should be source, not share.
888 Default path should be source, not share.
904
889
905 $ hg -R share-dest1b config paths.default
890 $ hg -R share-dest1b config paths.default
906 $TESTTMP/source1b
891 $TESTTMP/source1b
907
892
908 Checked out revision should be head of default branch
893 Checked out revision should be head of default branch
909
894
910 $ hg -R share-dest1b log -r .
895 $ hg -R share-dest1b log -r .
911 changeset: 4:99f71071f117
896 changeset: 4:99f71071f117
912 bookmark: head2
897 bookmark: head2
913 parent: 0:b5f04eac9d8f
898 parent: 0:b5f04eac9d8f
914 user: test
899 user: test
915 date: Thu Jan 01 00:00:00 1970 +0000
900 date: Thu Jan 01 00:00:00 1970 +0000
916 summary: head2
901 summary: head2
917
902
918
903
919 Clone from unrelated repo should result in new share
904 Clone from unrelated repo should result in new share
920
905
921 $ hg --config share.pool=share clone source2 share-dest2
906 $ hg --config share.pool=share clone source2 share-dest2
922 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
907 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
923 requesting all changes
908 requesting all changes
924 adding changesets
909 adding changesets
925 adding manifests
910 adding manifests
926 adding file changes
911 adding file changes
927 added 2 changesets with 2 changes to 1 files
912 added 2 changesets with 2 changes to 1 files
928 new changesets 22aeff664783:63cf6c3dba4a
913 new changesets 22aeff664783:63cf6c3dba4a
929 searching for changes
914 searching for changes
930 no changes found
915 no changes found
931 updating working directory
916 updating working directory
932 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
917 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
933
918
934 $ ls share
919 $ ls share
935 22aeff664783fd44c6d9b435618173c118c3448e
920 22aeff664783fd44c6d9b435618173c118c3448e
936 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
921 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
937
922
938 remote naming mode works as advertised
923 remote naming mode works as advertised
939
924
940 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
925 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
941 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
926 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
942 requesting all changes
927 requesting all changes
943 adding changesets
928 adding changesets
944 adding manifests
929 adding manifests
945 adding file changes
930 adding file changes
946 added 3 changesets with 3 changes to 1 files
931 added 3 changesets with 3 changes to 1 files
947 new changesets b5f04eac9d8f:e5bfe23c0b47
932 new changesets b5f04eac9d8f:e5bfe23c0b47
948 searching for changes
933 searching for changes
949 no changes found
934 no changes found
950 adding remote bookmark bookA
935 adding remote bookmark bookA
951 updating working directory
936 updating working directory
952 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
937 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
953
938
954 $ ls shareremote
939 $ ls shareremote
955 195bb1fcdb595c14a6c13e0269129ed78f6debde
940 195bb1fcdb595c14a6c13e0269129ed78f6debde
956
941
957 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
942 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
958 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
943 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
959 requesting all changes
944 requesting all changes
960 adding changesets
945 adding changesets
961 adding manifests
946 adding manifests
962 adding file changes
947 adding file changes
963 added 6 changesets with 6 changes to 1 files (+4 heads)
948 added 6 changesets with 6 changes to 1 files (+4 heads)
964 new changesets b5f04eac9d8f:6bacf4683960
949 new changesets b5f04eac9d8f:6bacf4683960
965 searching for changes
950 searching for changes
966 no changes found
951 no changes found
967 adding remote bookmark head1
952 adding remote bookmark head1
968 adding remote bookmark head2
953 adding remote bookmark head2
969 updating working directory
954 updating working directory
970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
955 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
971
956
972 $ ls shareremote
957 $ ls shareremote
973 195bb1fcdb595c14a6c13e0269129ed78f6debde
958 195bb1fcdb595c14a6c13e0269129ed78f6debde
974 c0d4f83847ca2a873741feb7048a45085fd47c46
959 c0d4f83847ca2a873741feb7048a45085fd47c46
975
960
976 request to clone a single revision is respected in sharing mode
961 request to clone a single revision is respected in sharing mode
977
962
978 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
963 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
979 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
964 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
980 adding changesets
965 adding changesets
981 adding manifests
966 adding manifests
982 adding file changes
967 adding file changes
983 added 2 changesets with 2 changes to 1 files
968 added 2 changesets with 2 changes to 1 files
984 new changesets b5f04eac9d8f:4a8dc1ab4c13
969 new changesets b5f04eac9d8f:4a8dc1ab4c13
985 no changes found
970 no changes found
986 adding remote bookmark head1
971 adding remote bookmark head1
987 updating working directory
972 updating working directory
988 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
973 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
989
974
990 $ hg -R share-1arev log -G
975 $ hg -R share-1arev log -G
991 @ changeset: 1:4a8dc1ab4c13
976 @ changeset: 1:4a8dc1ab4c13
992 | bookmark: head1
977 | bookmark: head1
993 | tag: tip
978 | tag: tip
994 | user: test
979 | user: test
995 | date: Thu Jan 01 00:00:00 1970 +0000
980 | date: Thu Jan 01 00:00:00 1970 +0000
996 | summary: head1
981 | summary: head1
997 |
982 |
998 o changeset: 0:b5f04eac9d8f
983 o changeset: 0:b5f04eac9d8f
999 user: test
984 user: test
1000 date: Thu Jan 01 00:00:00 1970 +0000
985 date: Thu Jan 01 00:00:00 1970 +0000
1001 summary: initial
986 summary: initial
1002
987
1003
988
1004 making another clone should only pull down requested rev
989 making another clone should only pull down requested rev
1005
990
1006 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
991 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
1007 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
992 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1008 searching for changes
993 searching for changes
1009 adding changesets
994 adding changesets
1010 adding manifests
995 adding manifests
1011 adding file changes
996 adding file changes
1012 adding remote bookmark head1
997 adding remote bookmark head1
1013 adding remote bookmark head2
998 adding remote bookmark head2
1014 added 1 changesets with 1 changes to 1 files (+1 heads)
999 added 1 changesets with 1 changes to 1 files (+1 heads)
1015 new changesets 99f71071f117
1000 new changesets 99f71071f117
1016 updating working directory
1001 updating working directory
1017 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1002 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1018
1003
1019 $ hg -R share-1brev log -G
1004 $ hg -R share-1brev log -G
1020 @ changeset: 2:99f71071f117
1005 @ changeset: 2:99f71071f117
1021 | bookmark: head2
1006 | bookmark: head2
1022 | tag: tip
1007 | tag: tip
1023 | parent: 0:b5f04eac9d8f
1008 | parent: 0:b5f04eac9d8f
1024 | user: test
1009 | user: test
1025 | date: Thu Jan 01 00:00:00 1970 +0000
1010 | date: Thu Jan 01 00:00:00 1970 +0000
1026 | summary: head2
1011 | summary: head2
1027 |
1012 |
1028 | o changeset: 1:4a8dc1ab4c13
1013 | o changeset: 1:4a8dc1ab4c13
1029 |/ bookmark: head1
1014 |/ bookmark: head1
1030 | user: test
1015 | user: test
1031 | date: Thu Jan 01 00:00:00 1970 +0000
1016 | date: Thu Jan 01 00:00:00 1970 +0000
1032 | summary: head1
1017 | summary: head1
1033 |
1018 |
1034 o changeset: 0:b5f04eac9d8f
1019 o changeset: 0:b5f04eac9d8f
1035 user: test
1020 user: test
1036 date: Thu Jan 01 00:00:00 1970 +0000
1021 date: Thu Jan 01 00:00:00 1970 +0000
1037 summary: initial
1022 summary: initial
1038
1023
1039
1024
1040 Request to clone a single branch is respected in sharing mode
1025 Request to clone a single branch is respected in sharing mode
1041
1026
1042 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1027 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1043 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1028 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1044 adding changesets
1029 adding changesets
1045 adding manifests
1030 adding manifests
1046 adding file changes
1031 adding file changes
1047 added 2 changesets with 2 changes to 1 files
1032 added 2 changesets with 2 changes to 1 files
1048 new changesets b5f04eac9d8f:5f92a6c1a1b1
1033 new changesets b5f04eac9d8f:5f92a6c1a1b1
1049 no changes found
1034 no changes found
1050 updating working directory
1035 updating working directory
1051 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1036 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1052
1037
1053 $ hg -R share-1bbranch1 log -G
1038 $ hg -R share-1bbranch1 log -G
1054 o changeset: 1:5f92a6c1a1b1
1039 o changeset: 1:5f92a6c1a1b1
1055 | branch: branch1
1040 | branch: branch1
1056 | tag: tip
1041 | tag: tip
1057 | user: test
1042 | user: test
1058 | date: Thu Jan 01 00:00:00 1970 +0000
1043 | date: Thu Jan 01 00:00:00 1970 +0000
1059 | summary: branch1
1044 | summary: branch1
1060 |
1045 |
1061 @ changeset: 0:b5f04eac9d8f
1046 @ changeset: 0:b5f04eac9d8f
1062 user: test
1047 user: test
1063 date: Thu Jan 01 00:00:00 1970 +0000
1048 date: Thu Jan 01 00:00:00 1970 +0000
1064 summary: initial
1049 summary: initial
1065
1050
1066
1051
1067 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1052 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1068 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1053 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1069 searching for changes
1054 searching for changes
1070 adding changesets
1055 adding changesets
1071 adding manifests
1056 adding manifests
1072 adding file changes
1057 adding file changes
1073 added 1 changesets with 1 changes to 1 files (+1 heads)
1058 added 1 changesets with 1 changes to 1 files (+1 heads)
1074 new changesets 6bacf4683960
1059 new changesets 6bacf4683960
1075 updating working directory
1060 updating working directory
1076 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1061 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1077
1062
1078 $ hg -R share-1bbranch2 log -G
1063 $ hg -R share-1bbranch2 log -G
1079 o changeset: 2:6bacf4683960
1064 o changeset: 2:6bacf4683960
1080 | branch: branch2
1065 | branch: branch2
1081 | tag: tip
1066 | tag: tip
1082 | parent: 0:b5f04eac9d8f
1067 | parent: 0:b5f04eac9d8f
1083 | user: test
1068 | user: test
1084 | date: Thu Jan 01 00:00:00 1970 +0000
1069 | date: Thu Jan 01 00:00:00 1970 +0000
1085 | summary: branch2
1070 | summary: branch2
1086 |
1071 |
1087 | o changeset: 1:5f92a6c1a1b1
1072 | o changeset: 1:5f92a6c1a1b1
1088 |/ branch: branch1
1073 |/ branch: branch1
1089 | user: test
1074 | user: test
1090 | date: Thu Jan 01 00:00:00 1970 +0000
1075 | date: Thu Jan 01 00:00:00 1970 +0000
1091 | summary: branch1
1076 | summary: branch1
1092 |
1077 |
1093 @ changeset: 0:b5f04eac9d8f
1078 @ changeset: 0:b5f04eac9d8f
1094 user: test
1079 user: test
1095 date: Thu Jan 01 00:00:00 1970 +0000
1080 date: Thu Jan 01 00:00:00 1970 +0000
1096 summary: initial
1081 summary: initial
1097
1082
1098
1083
1099 -U is respected in share clone mode
1084 -U is respected in share clone mode
1100
1085
1101 $ hg --config share.pool=share clone -U source1a share-1anowc
1086 $ hg --config share.pool=share clone -U source1a share-1anowc
1102 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1087 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1103 searching for changes
1088 searching for changes
1104 no changes found
1089 no changes found
1105 adding remote bookmark bookA
1090 adding remote bookmark bookA
1106
1091
1107 $ ls -A share-1anowc
1092 $ ls -A share-1anowc
1108 .hg
1093 .hg
1109
1094
1110 Test that auto sharing doesn't cause failure of "hg clone local remote"
1095 Test that auto sharing doesn't cause failure of "hg clone local remote"
1111
1096
1112 $ cd $TESTTMP
1097 $ cd $TESTTMP
1113 $ hg -R a id -r 0
1098 $ hg -R a id -r 0
1114 acb14030fe0a
1099 acb14030fe0a
1115 $ hg id -R remote -r 0
1100 $ hg id -R remote -r 0
1116 abort: repository remote not found
1101 abort: repository remote not found
1117 [255]
1102 [255]
1118 $ hg --config share.pool=share -q clone a ssh://user@dummy/remote
1103 $ hg --config share.pool=share -q clone a ssh://user@dummy/remote
1119 $ hg -R remote id -r 0
1104 $ hg -R remote id -r 0
1120 acb14030fe0a
1105 acb14030fe0a
1121
1106
1122 Cloning into pooled storage doesn't race (issue5104)
1107 Cloning into pooled storage doesn't race (issue5104)
1123
1108
1124 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1109 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1125 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1110 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1126 $ wait
1111 $ wait
1127
1112
1128 $ hg -R share-destrace1 log -r tip
1113 $ hg -R share-destrace1 log -r tip
1129 changeset: 2:e5bfe23c0b47
1114 changeset: 2:e5bfe23c0b47
1130 bookmark: bookA
1115 bookmark: bookA
1131 tag: tip
1116 tag: tip
1132 user: test
1117 user: test
1133 date: Thu Jan 01 00:00:00 1970 +0000
1118 date: Thu Jan 01 00:00:00 1970 +0000
1134 summary: 1a
1119 summary: 1a
1135
1120
1136
1121
1137 $ hg -R share-destrace2 log -r tip
1122 $ hg -R share-destrace2 log -r tip
1138 changeset: 2:e5bfe23c0b47
1123 changeset: 2:e5bfe23c0b47
1139 bookmark: bookA
1124 bookmark: bookA
1140 tag: tip
1125 tag: tip
1141 user: test
1126 user: test
1142 date: Thu Jan 01 00:00:00 1970 +0000
1127 date: Thu Jan 01 00:00:00 1970 +0000
1143 summary: 1a
1128 summary: 1a
1144
1129
1145 One repo should be new, the other should be shared from the pool. We
1130 One repo should be new, the other should be shared from the pool. We
1146 don't care which is which, so we just make sure we always print the
1131 don't care which is which, so we just make sure we always print the
1147 one containing "new pooled" first, then one one containing "existing
1132 one containing "new pooled" first, then one one containing "existing
1148 pooled".
1133 pooled".
1149
1134
1150 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1135 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1151 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1136 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1152 requesting all changes
1137 requesting all changes
1153 adding changesets
1138 adding changesets
1154 adding manifests
1139 adding manifests
1155 adding file changes
1140 adding file changes
1156 added 3 changesets with 3 changes to 1 files
1141 added 3 changesets with 3 changes to 1 files
1157 new changesets b5f04eac9d8f:e5bfe23c0b47
1142 new changesets b5f04eac9d8f:e5bfe23c0b47
1158 searching for changes
1143 searching for changes
1159 no changes found
1144 no changes found
1160 adding remote bookmark bookA
1145 adding remote bookmark bookA
1161 updating working directory
1146 updating working directory
1162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1163
1148
1164 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1149 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1165 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1150 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1166 searching for changes
1151 searching for changes
1167 no changes found
1152 no changes found
1168 adding remote bookmark bookA
1153 adding remote bookmark bookA
1169 updating working directory
1154 updating working directory
1170 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1171
1156
1172 SEC: check for unsafe ssh url
1157 SEC: check for unsafe ssh url
1173
1158
1174 $ cat >> $HGRCPATH << EOF
1159 $ cat >> $HGRCPATH << EOF
1175 > [ui]
1160 > [ui]
1176 > ssh = sh -c "read l; read l; read l"
1161 > ssh = sh -c "read l; read l; read l"
1177 > EOF
1162 > EOF
1178
1163
1179 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1164 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1180 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1165 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1181 [255]
1166 [255]
1182 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1167 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1183 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1168 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1184 [255]
1169 [255]
1185 $ hg clone 'ssh://fakehost|touch%20owned/path'
1170 $ hg clone 'ssh://fakehost|touch%20owned/path'
1186 abort: no suitable response from remote hg
1171 abort: no suitable response from remote hg
1187 [255]
1172 [255]
1188 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1173 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1189 abort: no suitable response from remote hg
1174 abort: no suitable response from remote hg
1190 [255]
1175 [255]
1191
1176
1192 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1177 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1193 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1178 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1194 [255]
1179 [255]
1195
1180
1196 #if windows
1181 #if windows
1197 $ hg clone "ssh://%26touch%20owned%20/" --debug
1182 $ hg clone "ssh://%26touch%20owned%20/" --debug
1198 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1183 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1199 sending hello command
1184 sending hello command
1200 sending between command
1185 sending between command
1201 abort: no suitable response from remote hg
1186 abort: no suitable response from remote hg
1202 [255]
1187 [255]
1203 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1188 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1204 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1189 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1205 sending hello command
1190 sending hello command
1206 sending between command
1191 sending between command
1207 abort: no suitable response from remote hg
1192 abort: no suitable response from remote hg
1208 [255]
1193 [255]
1209 #else
1194 #else
1210 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1195 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1211 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1196 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1212 sending hello command
1197 sending hello command
1213 sending between command
1198 sending between command
1214 abort: no suitable response from remote hg
1199 abort: no suitable response from remote hg
1215 [255]
1200 [255]
1216 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1201 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1217 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1202 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1218 sending hello command
1203 sending hello command
1219 sending between command
1204 sending between command
1220 abort: no suitable response from remote hg
1205 abort: no suitable response from remote hg
1221 [255]
1206 [255]
1222 #endif
1207 #endif
1223
1208
1224 $ hg clone "ssh://v-alid.example.com/" --debug
1209 $ hg clone "ssh://v-alid.example.com/" --debug
1225 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1210 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1226 sending hello command
1211 sending hello command
1227 sending between command
1212 sending between command
1228 abort: no suitable response from remote hg
1213 abort: no suitable response from remote hg
1229 [255]
1214 [255]
1230
1215
1231 We should not have created a file named owned - if it exists, the
1216 We should not have created a file named owned - if it exists, the
1232 attack succeeded.
1217 attack succeeded.
1233 $ if test -f owned; then echo 'you got owned'; fi
1218 $ if test -f owned; then echo 'you got owned'; fi
1234
1219
1235 Cloning without fsmonitor enabled does not print a warning for small repos
1220 Cloning without fsmonitor enabled does not print a warning for small repos
1236
1221
1237 $ hg clone a fsmonitor-default
1222 $ hg clone a fsmonitor-default
1238 updating to bookmark @ on branch stable
1223 updating to bookmark @ on branch stable
1239 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1224 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1240
1225
1241 Lower the warning threshold to simulate a large repo
1226 Lower the warning threshold to simulate a large repo
1242
1227
1243 $ cat >> $HGRCPATH << EOF
1228 $ cat >> $HGRCPATH << EOF
1244 > [fsmonitor]
1229 > [fsmonitor]
1245 > warn_update_file_count = 2
1230 > warn_update_file_count = 2
1246 > warn_update_file_count_rust = 2
1231 > warn_update_file_count_rust = 2
1247 > EOF
1232 > EOF
1248
1233
1249 We should see a warning about no fsmonitor on supported platforms
1234 We should see a warning about no fsmonitor on supported platforms
1250
1235
1251 #if linuxormacos no-fsmonitor
1236 #if linuxormacos no-fsmonitor
1252 $ hg clone a nofsmonitor
1237 $ hg clone a nofsmonitor
1253 updating to bookmark @ on branch stable
1238 updating to bookmark @ on branch stable
1254 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1239 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1255 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1240 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1256 #else
1241 #else
1257 $ hg clone a nofsmonitor
1242 $ hg clone a nofsmonitor
1258 updating to bookmark @ on branch stable
1243 updating to bookmark @ on branch stable
1259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1260 #endif
1245 #endif
1261
1246
1262 We should not see warning about fsmonitor when it is enabled
1247 We should not see warning about fsmonitor when it is enabled
1263
1248
1264 #if fsmonitor
1249 #if fsmonitor
1265 $ hg clone a fsmonitor-enabled
1250 $ hg clone a fsmonitor-enabled
1266 updating to bookmark @ on branch stable
1251 updating to bookmark @ on branch stable
1267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1252 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1268 #endif
1253 #endif
1269
1254
1270 We can disable the fsmonitor warning
1255 We can disable the fsmonitor warning
1271
1256
1272 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1257 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1273 updating to bookmark @ on branch stable
1258 updating to bookmark @ on branch stable
1274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1275
1260
1276 Loaded fsmonitor but disabled in config should still print warning
1261 Loaded fsmonitor but disabled in config should still print warning
1277
1262
1278 #if linuxormacos fsmonitor
1263 #if linuxormacos fsmonitor
1279 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1264 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1280 updating to bookmark @ on branch stable
1265 updating to bookmark @ on branch stable
1281 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1266 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1282 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1283 #endif
1268 #endif
1284
1269
1285 Warning not printed if working directory isn't empty
1270 Warning not printed if working directory isn't empty
1286
1271
1287 $ hg -q clone a fsmonitor-update
1272 $ hg -q clone a fsmonitor-update
1288 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1273 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1289 $ cd fsmonitor-update
1274 $ cd fsmonitor-update
1290 $ hg up acb14030fe0a
1275 $ hg up acb14030fe0a
1291 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1276 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1292 (leaving bookmark @)
1277 (leaving bookmark @)
1293 $ hg up cf0fe1914066
1278 $ hg up cf0fe1914066
1294 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1295
1280
1296 `hg update` from null revision also prints
1281 `hg update` from null revision also prints
1297
1282
1298 $ hg up null
1283 $ hg up null
1299 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1300
1285
1301 #if linuxormacos no-fsmonitor
1286 #if linuxormacos no-fsmonitor
1302 $ hg up cf0fe1914066
1287 $ hg up cf0fe1914066
1303 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1288 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1304 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1289 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1305 #else
1290 #else
1306 $ hg up cf0fe1914066
1291 $ hg up cf0fe1914066
1307 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1308 #endif
1293 #endif
1309
1294
1310 $ cd ..
1295 $ cd ..
1311
1296
@@ -1,101 +1,91
1 #require reporevlogstore
1 #require reporevlogstore
2
2
3 $ CONTRIBDIR="$TESTDIR/../contrib"
3 $ CONTRIBDIR="$TESTDIR/../contrib"
4
4
5 $ hg init repo-a
5 $ hg init repo-a
6 $ cd repo-a
6 $ cd repo-a
7
7
8 $ echo this is file a > a
8 $ echo this is file a > a
9 $ hg add a
9 $ hg add a
10 $ hg commit -m first
10 $ hg commit -m first
11
11
12 $ echo adding to file a >> a
12 $ echo adding to file a >> a
13 $ hg commit -m second
13 $ hg commit -m second
14
14
15 $ echo adding more to file a >> a
15 $ echo adding more to file a >> a
16 $ hg commit -m third
16 $ hg commit -m third
17 $ hg verify
17 $ hg verify -q
18 checking changesets
19 checking manifests
20 crosschecking files in changesets and manifests
21 checking files
22 checked 3 changesets with 3 changes to 1 files
23
18
24 Dumping revlog of file a to stdout:
19 Dumping revlog of file a to stdout:
25 $ "$PYTHON" "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i
20 $ "$PYTHON" "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i
26 file: .hg/store/data/a.i
21 file: .hg/store/data/a.i
27 node: 183d2312b35066fb6b3b449b84efc370d50993d0
22 node: 183d2312b35066fb6b3b449b84efc370d50993d0
28 linkrev: 0
23 linkrev: 0
29 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
24 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
30 length: 15
25 length: 15
31 -start-
26 -start-
32 this is file a
27 this is file a
33
28
34 -end-
29 -end-
35 node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
30 node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
36 linkrev: 1
31 linkrev: 1
37 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
32 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
38 length: 32
33 length: 32
39 -start-
34 -start-
40 this is file a
35 this is file a
41 adding to file a
36 adding to file a
42
37
43 -end-
38 -end-
44 node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
39 node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
45 linkrev: 2
40 linkrev: 2
46 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
41 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
47 length: 54
42 length: 54
48 -start-
43 -start-
49 this is file a
44 this is file a
50 adding to file a
45 adding to file a
51 adding more to file a
46 adding more to file a
52
47
53 -end-
48 -end-
54
49
55 Dump all revlogs to file repo.dump:
50 Dump all revlogs to file repo.dump:
56
51
57 $ find .hg/store -name "*.i" | sort | xargs "$PYTHON" "$CONTRIBDIR/dumprevlog" > ../repo.dump
52 $ find .hg/store -name "*.i" | sort | xargs "$PYTHON" "$CONTRIBDIR/dumprevlog" > ../repo.dump
58 $ cd ..
53 $ cd ..
59
54
60 Undumping into repo-b:
55 Undumping into repo-b:
61
56
62 $ hg init repo-b
57 $ hg init repo-b
63 $ cd repo-b
58 $ cd repo-b
64 $ "$PYTHON" "$CONTRIBDIR/undumprevlog" < ../repo.dump
59 $ "$PYTHON" "$CONTRIBDIR/undumprevlog" < ../repo.dump
65 .hg/store/00changelog.i
60 .hg/store/00changelog.i
66 .hg/store/00manifest.i
61 .hg/store/00manifest.i
67 .hg/store/data/a.i
62 .hg/store/data/a.i
68 $ cd ..
63 $ cd ..
69
64
70 Rebuild fncache with clone --pull:
65 Rebuild fncache with clone --pull:
71
66
72 $ hg clone --pull -U repo-b repo-c
67 $ hg clone --pull -U repo-b repo-c
73 requesting all changes
68 requesting all changes
74 adding changesets
69 adding changesets
75 adding manifests
70 adding manifests
76 adding file changes
71 adding file changes
77 added 3 changesets with 3 changes to 1 files
72 added 3 changesets with 3 changes to 1 files
78 new changesets de1da620e7d8:46946d278c50
73 new changesets de1da620e7d8:46946d278c50
79
74
80 Verify:
75 Verify:
81
76
82 $ hg -R repo-c verify
77 $ hg -R repo-c verify -q
83 checking changesets
84 checking manifests
85 crosschecking files in changesets and manifests
86 checking files
87 checked 3 changesets with 3 changes to 1 files
88
78
89 Compare repos:
79 Compare repos:
90
80
91 $ hg -R repo-c incoming repo-a
81 $ hg -R repo-c incoming repo-a
92 comparing with repo-a
82 comparing with repo-a
93 searching for changes
83 searching for changes
94 no changes found
84 no changes found
95 [1]
85 [1]
96
86
97 $ hg -R repo-a incoming repo-c
87 $ hg -R repo-a incoming repo-c
98 comparing with repo-c
88 comparing with repo-c
99 searching for changes
89 searching for changes
100 no changes found
90 no changes found
101 [1]
91 [1]
@@ -1,821 +1,816
1
1
2 $ HGMERGE=true; export HGMERGE
2 $ HGMERGE=true; export HGMERGE
3 $ echo '[extensions]' >> $HGRCPATH
3 $ echo '[extensions]' >> $HGRCPATH
4 $ echo 'convert =' >> $HGRCPATH
4 $ echo 'convert =' >> $HGRCPATH
5 $ glog()
5 $ glog()
6 > {
6 > {
7 > hg log -G --template '{rev} "{desc}" files: {files}\n' "$@"
7 > hg log -G --template '{rev} "{desc}" files: {files}\n' "$@"
8 > }
8 > }
9 $ hg init source
9 $ hg init source
10 $ cd source
10 $ cd source
11 $ echo foo > foo
11 $ echo foo > foo
12 $ echo baz > baz
12 $ echo baz > baz
13 $ mkdir -p dir/subdir
13 $ mkdir -p dir/subdir
14 $ echo dir/file >> dir/file
14 $ echo dir/file >> dir/file
15 $ echo dir/file2 >> dir/file2
15 $ echo dir/file2 >> dir/file2
16 $ echo dir/file3 >> dir/file3 # to be corrupted in rev 0
16 $ echo dir/file3 >> dir/file3 # to be corrupted in rev 0
17 $ echo dir/subdir/file3 >> dir/subdir/file3
17 $ echo dir/subdir/file3 >> dir/subdir/file3
18 $ echo dir/subdir/file4 >> dir/subdir/file4
18 $ echo dir/subdir/file4 >> dir/subdir/file4
19 $ hg ci -d '0 0' -qAm '0: add foo baz dir/'
19 $ hg ci -d '0 0' -qAm '0: add foo baz dir/'
20 $ echo bar > bar
20 $ echo bar > bar
21 $ echo quux > quux
21 $ echo quux > quux
22 $ echo dir/file4 >> dir/file4 # to be corrupted in rev 1
22 $ echo dir/file4 >> dir/file4 # to be corrupted in rev 1
23 $ hg copy foo copied
23 $ hg copy foo copied
24 $ hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied'
24 $ hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied'
25 $ echo >> foo
25 $ echo >> foo
26 $ hg ci -d '2 0' -m '2: change foo'
26 $ hg ci -d '2 0' -m '2: change foo'
27 $ hg up -qC 1
27 $ hg up -qC 1
28 $ echo >> bar
28 $ echo >> bar
29 $ echo >> quux
29 $ echo >> quux
30 $ hg ci -d '3 0' -m '3: change bar quux'
30 $ hg ci -d '3 0' -m '3: change bar quux'
31 created new head
31 created new head
32 $ hg up -qC 2
32 $ hg up -qC 2
33 $ hg merge -qr 3
33 $ hg merge -qr 3
34 $ echo >> bar
34 $ echo >> bar
35 $ echo >> baz
35 $ echo >> baz
36 $ hg ci -d '4 0' -m '4: first merge; change bar baz'
36 $ hg ci -d '4 0' -m '4: first merge; change bar baz'
37 $ echo >> bar
37 $ echo >> bar
38 $ echo 1 >> baz
38 $ echo 1 >> baz
39 $ echo >> quux
39 $ echo >> quux
40 $ hg ci -d '5 0' -m '5: change bar baz quux'
40 $ hg ci -d '5 0' -m '5: change bar baz quux'
41 $ hg up -qC 4
41 $ hg up -qC 4
42 $ echo >> foo
42 $ echo >> foo
43 $ echo 2 >> baz
43 $ echo 2 >> baz
44 $ hg ci -d '6 0' -m '6: change foo baz'
44 $ hg ci -d '6 0' -m '6: change foo baz'
45 created new head
45 created new head
46 $ hg up -qC 5
46 $ hg up -qC 5
47 $ hg merge -qr 6
47 $ hg merge -qr 6
48 $ echo >> bar
48 $ echo >> bar
49 $ hg ci -d '7 0' -m '7: second merge; change bar'
49 $ hg ci -d '7 0' -m '7: second merge; change bar'
50 $ echo >> foo
50 $ echo >> foo
51 $ hg ci -m '8: change foo'
51 $ hg ci -m '8: change foo'
52 $ glog
52 $ glog
53 @ 8 "8: change foo" files: foo
53 @ 8 "8: change foo" files: foo
54 |
54 |
55 o 7 "7: second merge; change bar" files: bar baz
55 o 7 "7: second merge; change bar" files: bar baz
56 |\
56 |\
57 | o 6 "6: change foo baz" files: baz foo
57 | o 6 "6: change foo baz" files: baz foo
58 | |
58 | |
59 o | 5 "5: change bar baz quux" files: bar baz quux
59 o | 5 "5: change bar baz quux" files: bar baz quux
60 |/
60 |/
61 o 4 "4: first merge; change bar baz" files: bar baz
61 o 4 "4: first merge; change bar baz" files: bar baz
62 |\
62 |\
63 | o 3 "3: change bar quux" files: bar quux
63 | o 3 "3: change bar quux" files: bar quux
64 | |
64 | |
65 o | 2 "2: change foo" files: foo
65 o | 2 "2: change foo" files: foo
66 |/
66 |/
67 o 1 "1: add bar quux; copy foo to copied" files: bar copied dir/file4 quux
67 o 1 "1: add bar quux; copy foo to copied" files: bar copied dir/file4 quux
68 |
68 |
69 o 0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/file3 dir/subdir/file3 dir/subdir/file4 foo
69 o 0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/file3 dir/subdir/file3 dir/subdir/file4 foo
70
70
71
71
72 final file versions in this repo:
72 final file versions in this repo:
73
73
74 $ hg manifest --debug
74 $ hg manifest --debug
75 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
75 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
76 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
76 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
77 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied
77 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied
78 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir/file
78 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir/file
79 75e6d3f8328f5f6ace6bf10b98df793416a09dca 644 dir/file2
79 75e6d3f8328f5f6ace6bf10b98df793416a09dca 644 dir/file2
80 e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c 644 dir/file3
80 e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c 644 dir/file3
81 6edd55f559cdce67132b12ca09e09cee08b60442 644 dir/file4
81 6edd55f559cdce67132b12ca09e09cee08b60442 644 dir/file4
82 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir/subdir/file3
82 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir/subdir/file3
83 57a1c1511590f3de52874adfa04effe8a77d64af 644 dir/subdir/file4
83 57a1c1511590f3de52874adfa04effe8a77d64af 644 dir/subdir/file4
84 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
84 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
85 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
85 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
86 $ hg debugrename copied
86 $ hg debugrename copied
87 copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
87 copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
88
88
89 $ cd ..
89 $ cd ..
90
90
91
91
92 Test interaction with startrev and verify that changing it is handled properly:
92 Test interaction with startrev and verify that changing it is handled properly:
93
93
94 $ > empty
94 $ > empty
95 $ hg convert --filemap empty source movingstart --config convert.hg.startrev=3 -r4
95 $ hg convert --filemap empty source movingstart --config convert.hg.startrev=3 -r4
96 initializing destination movingstart repository
96 initializing destination movingstart repository
97 scanning source...
97 scanning source...
98 sorting...
98 sorting...
99 converting...
99 converting...
100 1 3: change bar quux
100 1 3: change bar quux
101 0 4: first merge; change bar baz
101 0 4: first merge; change bar baz
102 $ hg convert --filemap empty source movingstart
102 $ hg convert --filemap empty source movingstart
103 scanning source...
103 scanning source...
104 sorting...
104 sorting...
105 converting...
105 converting...
106 3 5: change bar baz quux
106 3 5: change bar baz quux
107 2 6: change foo baz
107 2 6: change foo baz
108 1 7: second merge; change bar
108 1 7: second merge; change bar
109 warning: af455ce4166b3c9c88e6309c2b9332171dcea595 parent 61e22ca76c3b3e93df20338c4e02ce286898e825 is missing
109 warning: af455ce4166b3c9c88e6309c2b9332171dcea595 parent 61e22ca76c3b3e93df20338c4e02ce286898e825 is missing
110 warning: cf908b3eeedc301c9272ebae931da966d5b326c7 parent 59e1ab45c888289513b7354484dac8a88217beab is missing
110 warning: cf908b3eeedc301c9272ebae931da966d5b326c7 parent 59e1ab45c888289513b7354484dac8a88217beab is missing
111 0 8: change foo
111 0 8: change foo
112
112
113
113
114 splitrepo tests
114 splitrepo tests
115
115
116 $ splitrepo()
116 $ splitrepo()
117 > {
117 > {
118 > msg="$1"
118 > msg="$1"
119 > files="$2"
119 > files="$2"
120 > opts=$3
120 > opts=$3
121 > echo "% $files: $msg"
121 > echo "% $files: $msg"
122 > prefix=`echo "$files" | sed -e 's/ /-/g'`
122 > prefix=`echo "$files" | sed -e 's/ /-/g'`
123 > fmap="$prefix.fmap"
123 > fmap="$prefix.fmap"
124 > repo="$prefix.repo"
124 > repo="$prefix.repo"
125 > for i in $files; do
125 > for i in $files; do
126 > echo "include $i" >> "$fmap"
126 > echo "include $i" >> "$fmap"
127 > done
127 > done
128 > hg -q convert $opts --filemap "$fmap" --datesort source "$repo"
128 > hg -q convert $opts --filemap "$fmap" --datesort source "$repo"
129 > hg up -q -R "$repo"
129 > hg up -q -R "$repo"
130 > glog -R "$repo"
130 > glog -R "$repo"
131 > hg -R "$repo" manifest --debug
131 > hg -R "$repo" manifest --debug
132 > }
132 > }
133 $ splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo
133 $ splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo
134 % foo: skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd
134 % foo: skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd
135 @ 3 "8: change foo" files: foo
135 @ 3 "8: change foo" files: foo
136 |
136 |
137 o 2 "6: change foo baz" files: foo
137 o 2 "6: change foo baz" files: foo
138 |
138 |
139 o 1 "2: change foo" files: foo
139 o 1 "2: change foo" files: foo
140 |
140 |
141 o 0 "0: add foo baz dir/" files: foo
141 o 0 "0: add foo baz dir/" files: foo
142
142
143 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
143 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
144 $ splitrepo 'merges are not merges anymore' bar
144 $ splitrepo 'merges are not merges anymore' bar
145 % bar: merges are not merges anymore
145 % bar: merges are not merges anymore
146 @ 4 "7: second merge; change bar" files: bar
146 @ 4 "7: second merge; change bar" files: bar
147 |
147 |
148 o 3 "5: change bar baz quux" files: bar
148 o 3 "5: change bar baz quux" files: bar
149 |
149 |
150 o 2 "4: first merge; change bar baz" files: bar
150 o 2 "4: first merge; change bar baz" files: bar
151 |
151 |
152 o 1 "3: change bar quux" files: bar
152 o 1 "3: change bar quux" files: bar
153 |
153 |
154 o 0 "1: add bar quux; copy foo to copied" files: bar
154 o 0 "1: add bar quux; copy foo to copied" files: bar
155
155
156 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
156 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
157 $ splitrepo '1st merge is not a merge anymore; 2nd still is' baz
157 $ splitrepo '1st merge is not a merge anymore; 2nd still is' baz
158 % baz: 1st merge is not a merge anymore; 2nd still is
158 % baz: 1st merge is not a merge anymore; 2nd still is
159 @ 4 "7: second merge; change bar" files: baz
159 @ 4 "7: second merge; change bar" files: baz
160 |\
160 |\
161 | o 3 "6: change foo baz" files: baz
161 | o 3 "6: change foo baz" files: baz
162 | |
162 | |
163 o | 2 "5: change bar baz quux" files: baz
163 o | 2 "5: change bar baz quux" files: baz
164 |/
164 |/
165 o 1 "4: first merge; change bar baz" files: baz
165 o 1 "4: first merge; change bar baz" files: baz
166 |
166 |
167 o 0 "0: add foo baz dir/" files: baz
167 o 0 "0: add foo baz dir/" files: baz
168
168
169 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
169 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
170 $ splitrepo 'we add additional merges when they are interesting' 'foo quux'
170 $ splitrepo 'we add additional merges when they are interesting' 'foo quux'
171 % foo quux: we add additional merges when they are interesting
171 % foo quux: we add additional merges when they are interesting
172 @ 8 "8: change foo" files: foo
172 @ 8 "8: change foo" files: foo
173 |
173 |
174 o 7 "7: second merge; change bar" files:
174 o 7 "7: second merge; change bar" files:
175 |\
175 |\
176 | o 6 "6: change foo baz" files: foo
176 | o 6 "6: change foo baz" files: foo
177 | |
177 | |
178 o | 5 "5: change bar baz quux" files: quux
178 o | 5 "5: change bar baz quux" files: quux
179 |/
179 |/
180 o 4 "4: first merge; change bar baz" files:
180 o 4 "4: first merge; change bar baz" files:
181 |\
181 |\
182 | o 3 "3: change bar quux" files: quux
182 | o 3 "3: change bar quux" files: quux
183 | |
183 | |
184 o | 2 "2: change foo" files: foo
184 o | 2 "2: change foo" files: foo
185 |/
185 |/
186 o 1 "1: add bar quux; copy foo to copied" files: quux
186 o 1 "1: add bar quux; copy foo to copied" files: quux
187 |
187 |
188 o 0 "0: add foo baz dir/" files: foo
188 o 0 "0: add foo baz dir/" files: foo
189
189
190 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
190 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
191 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
191 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
192 $ splitrepo 'partial conversion' 'bar quux' '-r 3'
192 $ splitrepo 'partial conversion' 'bar quux' '-r 3'
193 % bar quux: partial conversion
193 % bar quux: partial conversion
194 @ 1 "3: change bar quux" files: bar quux
194 @ 1 "3: change bar quux" files: bar quux
195 |
195 |
196 o 0 "1: add bar quux; copy foo to copied" files: bar quux
196 o 0 "1: add bar quux; copy foo to copied" files: bar quux
197
197
198 b79105bedc55102f394e90a789c9c380117c1b4a 644 bar
198 b79105bedc55102f394e90a789c9c380117c1b4a 644 bar
199 db0421cc6b685a458c8d86c7d5c004f94429ea23 644 quux
199 db0421cc6b685a458c8d86c7d5c004f94429ea23 644 quux
200 $ splitrepo 'complete the partial conversion' 'bar quux'
200 $ splitrepo 'complete the partial conversion' 'bar quux'
201 % bar quux: complete the partial conversion
201 % bar quux: complete the partial conversion
202 @ 4 "7: second merge; change bar" files: bar
202 @ 4 "7: second merge; change bar" files: bar
203 |
203 |
204 o 3 "5: change bar baz quux" files: bar quux
204 o 3 "5: change bar baz quux" files: bar quux
205 |
205 |
206 o 2 "4: first merge; change bar baz" files: bar
206 o 2 "4: first merge; change bar baz" files: bar
207 |
207 |
208 o 1 "3: change bar quux" files: bar quux
208 o 1 "3: change bar quux" files: bar quux
209 |
209 |
210 o 0 "1: add bar quux; copy foo to copied" files: bar quux
210 o 0 "1: add bar quux; copy foo to copied" files: bar quux
211
211
212 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
212 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
213 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
213 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
214 $ rm -r foo.repo
214 $ rm -r foo.repo
215 $ splitrepo 'partial conversion' 'foo' '-r 3'
215 $ splitrepo 'partial conversion' 'foo' '-r 3'
216 % foo: partial conversion
216 % foo: partial conversion
217 @ 0 "0: add foo baz dir/" files: foo
217 @ 0 "0: add foo baz dir/" files: foo
218
218
219 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
219 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
220 $ splitrepo 'complete the partial conversion' 'foo'
220 $ splitrepo 'complete the partial conversion' 'foo'
221 % foo: complete the partial conversion
221 % foo: complete the partial conversion
222 @ 3 "8: change foo" files: foo
222 @ 3 "8: change foo" files: foo
223 |
223 |
224 o 2 "6: change foo baz" files: foo
224 o 2 "6: change foo baz" files: foo
225 |
225 |
226 o 1 "2: change foo" files: foo
226 o 1 "2: change foo" files: foo
227 |
227 |
228 o 0 "0: add foo baz dir/" files: foo
228 o 0 "0: add foo baz dir/" files: foo
229
229
230 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
230 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
231 $ splitrepo 'copied file; source not included in new repo' copied
231 $ splitrepo 'copied file; source not included in new repo' copied
232 % copied: copied file; source not included in new repo
232 % copied: copied file; source not included in new repo
233 @ 0 "1: add bar quux; copy foo to copied" files: copied
233 @ 0 "1: add bar quux; copy foo to copied" files: copied
234
234
235 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 copied
235 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 copied
236 $ hg --cwd copied.repo debugrename copied
236 $ hg --cwd copied.repo debugrename copied
237 copied not renamed
237 copied not renamed
238 $ splitrepo 'copied file; source included in new repo' 'foo copied'
238 $ splitrepo 'copied file; source included in new repo' 'foo copied'
239 % foo copied: copied file; source included in new repo
239 % foo copied: copied file; source included in new repo
240 @ 4 "8: change foo" files: foo
240 @ 4 "8: change foo" files: foo
241 |
241 |
242 o 3 "6: change foo baz" files: foo
242 o 3 "6: change foo baz" files: foo
243 |
243 |
244 o 2 "2: change foo" files: foo
244 o 2 "2: change foo" files: foo
245 |
245 |
246 o 1 "1: add bar quux; copy foo to copied" files: copied
246 o 1 "1: add bar quux; copy foo to copied" files: copied
247 |
247 |
248 o 0 "0: add foo baz dir/" files: foo
248 o 0 "0: add foo baz dir/" files: foo
249
249
250 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied
250 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied
251 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
251 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
252 $ hg --cwd foo-copied.repo debugrename copied
252 $ hg --cwd foo-copied.repo debugrename copied
253 copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
253 copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
254
254
255 verify the top level 'include .' if there is no other includes:
255 verify the top level 'include .' if there is no other includes:
256
256
257 $ echo "exclude something" > default.fmap
257 $ echo "exclude something" > default.fmap
258 $ hg convert -q --filemap default.fmap -r1 source dummydest2
258 $ hg convert -q --filemap default.fmap -r1 source dummydest2
259 $ hg -R dummydest2 log --template '{rev} {node|short} {desc|firstline}\n'
259 $ hg -R dummydest2 log --template '{rev} {node|short} {desc|firstline}\n'
260 1 61e22ca76c3b 1: add bar quux; copy foo to copied
260 1 61e22ca76c3b 1: add bar quux; copy foo to copied
261 0 c085cf2ee7fe 0: add foo baz dir/
261 0 c085cf2ee7fe 0: add foo baz dir/
262
262
263 $ echo "include somethingelse" >> default.fmap
263 $ echo "include somethingelse" >> default.fmap
264 $ hg convert -q --filemap default.fmap -r1 source dummydest3
264 $ hg convert -q --filemap default.fmap -r1 source dummydest3
265 $ hg -R dummydest3 log --template '{rev} {node|short} {desc|firstline}\n'
265 $ hg -R dummydest3 log --template '{rev} {node|short} {desc|firstline}\n'
266
266
267 $ echo "include ." >> default.fmap
267 $ echo "include ." >> default.fmap
268 $ hg convert -q --filemap default.fmap -r1 source dummydest4
268 $ hg convert -q --filemap default.fmap -r1 source dummydest4
269 $ hg -R dummydest4 log --template '{rev} {node|short} {desc|firstline}\n'
269 $ hg -R dummydest4 log --template '{rev} {node|short} {desc|firstline}\n'
270 1 61e22ca76c3b 1: add bar quux; copy foo to copied
270 1 61e22ca76c3b 1: add bar quux; copy foo to copied
271 0 c085cf2ee7fe 0: add foo baz dir/
271 0 c085cf2ee7fe 0: add foo baz dir/
272
272
273 ensure that the filemap contains duplicated slashes (issue3612)
273 ensure that the filemap contains duplicated slashes (issue3612)
274
274
275 $ cat > renames.fmap <<EOF
275 $ cat > renames.fmap <<EOF
276 > include dir
276 > include dir
277 > exclude dir/file2
277 > exclude dir/file2
278 > rename dir dir2//dir3
278 > rename dir dir2//dir3
279 > include foo
279 > include foo
280 > include copied
280 > include copied
281 > rename foo foo2/
281 > rename foo foo2/
282 > rename copied ./copied2
282 > rename copied ./copied2
283 > exclude dir/subdir
283 > exclude dir/subdir
284 > include dir/subdir/file3
284 > include dir/subdir/file3
285 > EOF
285 > EOF
286 #if reporevlogstore
286 #if reporevlogstore
287 $ rm source/.hg/store/data/dir/file3.i
287 $ rm source/.hg/store/data/dir/file3.i
288 $ rm source/.hg/store/data/dir/file4.i
288 $ rm source/.hg/store/data/dir/file4.i
289 #endif
289 #endif
290 #if reposimplestore
290 #if reposimplestore
291 $ rm -rf source/.hg/store/data/dir/file3
291 $ rm -rf source/.hg/store/data/dir/file3
292 $ rm -rf source/.hg/store/data/dir/file4
292 $ rm -rf source/.hg/store/data/dir/file4
293 #endif
293 #endif
294 $ hg -q convert --filemap renames.fmap --datesort source dummydest
294 $ hg -q convert --filemap renames.fmap --datesort source dummydest
295 abort: dir/file3@e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: no match found (reporevlogstore !)
295 abort: dir/file3@e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: no match found (reporevlogstore !)
296 abort: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !)
296 abort: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !)
297 [50]
297 [50]
298 $ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo
298 $ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo
299 ignoring: dir/file3@e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: no match found (reporevlogstore !)
299 ignoring: dir/file3@e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: no match found (reporevlogstore !)
300 ignoring: dir/file4@6edd55f559cdce67132b12ca09e09cee08b60442: no match found (reporevlogstore !)
300 ignoring: dir/file4@6edd55f559cdce67132b12ca09e09cee08b60442: no match found (reporevlogstore !)
301 ignoring: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !)
301 ignoring: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !)
302 ignoring: data/dir/file4/index@6edd55f559cd: no node (reposimplestore !)
302 ignoring: data/dir/file4/index@6edd55f559cd: no node (reposimplestore !)
303 $ hg up -q -R renames.repo
303 $ hg up -q -R renames.repo
304 $ glog -R renames.repo
304 $ glog -R renames.repo
305 @ 4 "8: change foo" files: foo2
305 @ 4 "8: change foo" files: foo2
306 |
306 |
307 o 3 "6: change foo baz" files: foo2
307 o 3 "6: change foo baz" files: foo2
308 |
308 |
309 o 2 "2: change foo" files: foo2
309 o 2 "2: change foo" files: foo2
310 |
310 |
311 o 1 "1: add bar quux; copy foo to copied" files: copied2
311 o 1 "1: add bar quux; copy foo to copied" files: copied2
312 |
312 |
313 o 0 "0: add foo baz dir/" files: dir2/dir3/file dir2/dir3/subdir/file3 foo2
313 o 0 "0: add foo baz dir/" files: dir2/dir3/file dir2/dir3/subdir/file3 foo2
314
314
315 $ hg -R renames.repo verify
315 $ hg -R renames.repo verify -q
316 checking changesets
317 checking manifests
318 crosschecking files in changesets and manifests
319 checking files
320 checked 5 changesets with 7 changes to 4 files
321
316
322 $ hg -R renames.repo manifest --debug
317 $ hg -R renames.repo manifest --debug
323 d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644 copied2
318 d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644 copied2
324 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir2/dir3/file
319 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir2/dir3/file
325 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir2/dir3/subdir/file3
320 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir2/dir3/subdir/file3
326 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo2
321 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo2
327 $ hg --cwd renames.repo debugrename copied2
322 $ hg --cwd renames.repo debugrename copied2
328 copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
323 copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
329
324
330 copied:
325 copied:
331
326
332 $ hg --cwd source cat copied
327 $ hg --cwd source cat copied
333 foo
328 foo
334
329
335 copied2:
330 copied2:
336
331
337 $ hg --cwd renames.repo cat copied2
332 $ hg --cwd renames.repo cat copied2
338 foo
333 foo
339
334
340 filemap errors
335 filemap errors
341
336
342 $ cat > errors.fmap <<EOF
337 $ cat > errors.fmap <<EOF
343 > include dir/ # beware that comments changes error line numbers!
338 > include dir/ # beware that comments changes error line numbers!
344 > exclude /dir
339 > exclude /dir
345 > rename dir//dir /dir//dir/ "out of sync"
340 > rename dir//dir /dir//dir/ "out of sync"
346 > include
341 > include
347 > EOF
342 > EOF
348 $ hg -q convert --filemap errors.fmap source errors.repo
343 $ hg -q convert --filemap errors.fmap source errors.repo
349 errors.fmap:3: superfluous / in include '/dir'
344 errors.fmap:3: superfluous / in include '/dir'
350 errors.fmap:3: superfluous / in rename '/dir'
345 errors.fmap:3: superfluous / in rename '/dir'
351 errors.fmap:4: unknown directive 'out of sync'
346 errors.fmap:4: unknown directive 'out of sync'
352 errors.fmap:5: path to exclude is missing
347 errors.fmap:5: path to exclude is missing
353 abort: errors in filemap
348 abort: errors in filemap
354 [255]
349 [255]
355
350
356 test branch closing revision pruning if branch is pruned
351 test branch closing revision pruning if branch is pruned
357
352
358 $ hg init branchpruning
353 $ hg init branchpruning
359 $ cd branchpruning
354 $ cd branchpruning
360 $ hg branch foo
355 $ hg branch foo
361 marked working directory as branch foo
356 marked working directory as branch foo
362 (branches are permanent and global, did you want a bookmark?)
357 (branches are permanent and global, did you want a bookmark?)
363 $ echo a > a
358 $ echo a > a
364 $ hg ci -Am adda
359 $ hg ci -Am adda
365 adding a
360 adding a
366 $ hg ci --close-branch -m closefoo
361 $ hg ci --close-branch -m closefoo
367 $ hg up 0
362 $ hg up 0
368 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 $ hg branch empty
364 $ hg branch empty
370 marked working directory as branch empty
365 marked working directory as branch empty
371 (branches are permanent and global, did you want a bookmark?)
366 (branches are permanent and global, did you want a bookmark?)
372 $ hg ci -m emptybranch
367 $ hg ci -m emptybranch
373 $ hg ci --close-branch -m closeempty
368 $ hg ci --close-branch -m closeempty
374 $ hg up 0
369 $ hg up 0
375 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
376 $ hg branch default
371 $ hg branch default
377 marked working directory as branch default
372 marked working directory as branch default
378 (branches are permanent and global, did you want a bookmark?)
373 (branches are permanent and global, did you want a bookmark?)
379 $ echo b > b
374 $ echo b > b
380 $ hg ci -Am addb
375 $ hg ci -Am addb
381 adding b
376 adding b
382 $ hg ci --close-branch -m closedefault
377 $ hg ci --close-branch -m closedefault
383 $ cat > filemap <<EOF
378 $ cat > filemap <<EOF
384 > include b
379 > include b
385 > EOF
380 > EOF
386 $ cd ..
381 $ cd ..
387 $ hg convert branchpruning branchpruning-hg1
382 $ hg convert branchpruning branchpruning-hg1
388 initializing destination branchpruning-hg1 repository
383 initializing destination branchpruning-hg1 repository
389 scanning source...
384 scanning source...
390 sorting...
385 sorting...
391 converting...
386 converting...
392 5 adda
387 5 adda
393 4 closefoo
388 4 closefoo
394 3 emptybranch
389 3 emptybranch
395 2 closeempty
390 2 closeempty
396 1 addb
391 1 addb
397 0 closedefault
392 0 closedefault
398 $ glog -R branchpruning-hg1
393 $ glog -R branchpruning-hg1
399 _ 5 "closedefault" files:
394 _ 5 "closedefault" files:
400 |
395 |
401 o 4 "addb" files: b
396 o 4 "addb" files: b
402 |
397 |
403 | _ 3 "closeempty" files:
398 | _ 3 "closeempty" files:
404 | |
399 | |
405 | o 2 "emptybranch" files:
400 | o 2 "emptybranch" files:
406 |/
401 |/
407 | _ 1 "closefoo" files:
402 | _ 1 "closefoo" files:
408 |/
403 |/
409 o 0 "adda" files: a
404 o 0 "adda" files: a
410
405
411
406
412 exercise incremental conversion at the same time
407 exercise incremental conversion at the same time
413
408
414 $ hg convert -r0 --filemap branchpruning/filemap branchpruning branchpruning-hg2
409 $ hg convert -r0 --filemap branchpruning/filemap branchpruning branchpruning-hg2
415 initializing destination branchpruning-hg2 repository
410 initializing destination branchpruning-hg2 repository
416 scanning source...
411 scanning source...
417 sorting...
412 sorting...
418 converting...
413 converting...
419 0 adda
414 0 adda
420 $ hg convert -r4 --filemap branchpruning/filemap branchpruning branchpruning-hg2
415 $ hg convert -r4 --filemap branchpruning/filemap branchpruning branchpruning-hg2
421 scanning source...
416 scanning source...
422 sorting...
417 sorting...
423 converting...
418 converting...
424 0 addb
419 0 addb
425 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2
420 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2
426 scanning source...
421 scanning source...
427 sorting...
422 sorting...
428 converting...
423 converting...
429 3 closefoo
424 3 closefoo
430 2 emptybranch
425 2 emptybranch
431 1 closeempty
426 1 closeempty
432 0 closedefault
427 0 closedefault
433 $ glog -R branchpruning-hg2
428 $ glog -R branchpruning-hg2
434 _ 1 "closedefault" files:
429 _ 1 "closedefault" files:
435 |
430 |
436 o 0 "addb" files: b
431 o 0 "addb" files: b
437
432
438 Include directives dropped empty commits, but other directives don't
433 Include directives dropped empty commits, but other directives don't
439
434
440 $ cat > branchpruning/exclude_filemap <<EOF
435 $ cat > branchpruning/exclude_filemap <<EOF
441 > exclude a
436 > exclude a
442 > EOF
437 > EOF
443 $ hg convert --filemap branchpruning/exclude_filemap branchpruning branchpruning-hg-exclude
438 $ hg convert --filemap branchpruning/exclude_filemap branchpruning branchpruning-hg-exclude
444 initializing destination branchpruning-hg-exclude repository
439 initializing destination branchpruning-hg-exclude repository
445 scanning source...
440 scanning source...
446 sorting...
441 sorting...
447 converting...
442 converting...
448 5 adda
443 5 adda
449 4 closefoo
444 4 closefoo
450 3 emptybranch
445 3 emptybranch
451 2 closeempty
446 2 closeempty
452 1 addb
447 1 addb
453 0 closedefault
448 0 closedefault
454
449
455 $ glog -R branchpruning-hg-exclude
450 $ glog -R branchpruning-hg-exclude
456 _ 3 "closedefault" files:
451 _ 3 "closedefault" files:
457 |
452 |
458 o 2 "addb" files: b
453 o 2 "addb" files: b
459
454
460 _ 1 "closeempty" files:
455 _ 1 "closeempty" files:
461 |
456 |
462 o 0 "emptybranch" files:
457 o 0 "emptybranch" files:
463
458
464
459
465 Test rebuilding of map with unknown revisions in shamap - it used to crash
460 Test rebuilding of map with unknown revisions in shamap - it used to crash
466
461
467 $ cd branchpruning
462 $ cd branchpruning
468 $ hg up -r 2
463 $ hg up -r 2
469 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
464 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
470 $ hg merge 4
465 $ hg merge 4
471 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
466 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
472 (branch merge, don't forget to commit)
467 (branch merge, don't forget to commit)
473 $ hg ci -m 'merging something'
468 $ hg ci -m 'merging something'
474 $ cd ..
469 $ cd ..
475 $ echo "53792d18237d2b64971fa571936869156655338d 6d955580116e82c4b029bd30f321323bae71a7f0" >> branchpruning-hg2/.hg/shamap
470 $ echo "53792d18237d2b64971fa571936869156655338d 6d955580116e82c4b029bd30f321323bae71a7f0" >> branchpruning-hg2/.hg/shamap
476 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2 --debug --config progress.debug=true
471 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2 --debug --config progress.debug=true
477 run hg source pre-conversion action
472 run hg source pre-conversion action
478 run hg sink pre-conversion action
473 run hg sink pre-conversion action
479 scanning source...
474 scanning source...
480 scanning: 1/7 revisions (14.29%)
475 scanning: 1/7 revisions (14.29%)
481 sorting...
476 sorting...
482 converting...
477 converting...
483 0 merging something
478 0 merging something
484 source: 2503605b178fe50e8fbbb0e77b97939540aa8c87
479 source: 2503605b178fe50e8fbbb0e77b97939540aa8c87
485 converting: 0/1 revisions (0.00%)
480 converting: 0/1 revisions (0.00%)
486 unknown revmap source: 53792d18237d2b64971fa571936869156655338d
481 unknown revmap source: 53792d18237d2b64971fa571936869156655338d
487 run hg sink post-conversion action
482 run hg sink post-conversion action
488 run hg source post-conversion action
483 run hg source post-conversion action
489
484
490
485
491 filemap rename undoing revision rename
486 filemap rename undoing revision rename
492
487
493 $ hg init renameundo
488 $ hg init renameundo
494 $ cd renameundo
489 $ cd renameundo
495 $ echo 1 > a
490 $ echo 1 > a
496 $ echo 1 > c
491 $ echo 1 > c
497 $ hg ci -qAm add
492 $ hg ci -qAm add
498 $ hg mv -q a b/a
493 $ hg mv -q a b/a
499 $ hg mv -q c b/c
494 $ hg mv -q c b/c
500 $ hg ci -qm rename
495 $ hg ci -qm rename
501 $ echo 2 > b/a
496 $ echo 2 > b/a
502 $ echo 2 > b/c
497 $ echo 2 > b/c
503 $ hg ci -qm modify
498 $ hg ci -qm modify
504 $ cd ..
499 $ cd ..
505
500
506 $ echo "rename b ." > renameundo.fmap
501 $ echo "rename b ." > renameundo.fmap
507 $ hg convert --filemap renameundo.fmap renameundo renameundo2
502 $ hg convert --filemap renameundo.fmap renameundo renameundo2
508 initializing destination renameundo2 repository
503 initializing destination renameundo2 repository
509 scanning source...
504 scanning source...
510 sorting...
505 sorting...
511 converting...
506 converting...
512 2 add
507 2 add
513 1 rename
508 1 rename
514 filtering out empty revision
509 filtering out empty revision
515 repository tip rolled back to revision 0 (undo convert)
510 repository tip rolled back to revision 0 (undo convert)
516 0 modify
511 0 modify
517 $ glog -R renameundo2
512 $ glog -R renameundo2
518 o 1 "modify" files: a c
513 o 1 "modify" files: a c
519 |
514 |
520 o 0 "add" files: a c
515 o 0 "add" files: a c
521
516
522
517
523
518
524 test merge parents/empty merges pruning
519 test merge parents/empty merges pruning
525
520
526 $ glog()
521 $ glog()
527 > {
522 > {
528 > hg log -G --template '{rev}:{node|short}@{branch} "{desc}" files: {files}\n' "$@"
523 > hg log -G --template '{rev}:{node|short}@{branch} "{desc}" files: {files}\n' "$@"
529 > }
524 > }
530
525
531 test anonymous branch pruning
526 test anonymous branch pruning
532
527
533 $ hg init anonymousbranch
528 $ hg init anonymousbranch
534 $ cd anonymousbranch
529 $ cd anonymousbranch
535 $ echo a > a
530 $ echo a > a
536 $ echo b > b
531 $ echo b > b
537 $ hg ci -Am add
532 $ hg ci -Am add
538 adding a
533 adding a
539 adding b
534 adding b
540 $ echo a >> a
535 $ echo a >> a
541 $ hg ci -m changea
536 $ hg ci -m changea
542 $ hg up 0
537 $ hg up 0
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
538 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
544 $ echo b >> b
539 $ echo b >> b
545 $ hg ci -m changeb
540 $ hg ci -m changeb
546 created new head
541 created new head
547 $ hg up 1
542 $ hg up 1
548 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
543 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
549 $ hg merge
544 $ hg merge
550 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
545 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
551 (branch merge, don't forget to commit)
546 (branch merge, don't forget to commit)
552 $ hg ci -m merge
547 $ hg ci -m merge
553 $ cd ..
548 $ cd ..
554
549
555 $ cat > filemap <<EOF
550 $ cat > filemap <<EOF
556 > include a
551 > include a
557 > EOF
552 > EOF
558 $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg
553 $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg
559 initializing destination anonymousbranch-hg repository
554 initializing destination anonymousbranch-hg repository
560 scanning source...
555 scanning source...
561 sorting...
556 sorting...
562 converting...
557 converting...
563 3 add
558 3 add
564 2 changea
559 2 changea
565 1 changeb
560 1 changeb
566 0 merge
561 0 merge
567 $ glog -R anonymousbranch
562 $ glog -R anonymousbranch
568 @ 3:c71d5201a498@default "merge" files:
563 @ 3:c71d5201a498@default "merge" files:
569 |\
564 |\
570 | o 2:607eb44b17f9@default "changeb" files: b
565 | o 2:607eb44b17f9@default "changeb" files: b
571 | |
566 | |
572 o | 1:1f60ea617824@default "changea" files: a
567 o | 1:1f60ea617824@default "changea" files: a
573 |/
568 |/
574 o 0:0146e6129113@default "add" files: a b
569 o 0:0146e6129113@default "add" files: a b
575
570
576 $ glog -R anonymousbranch-hg
571 $ glog -R anonymousbranch-hg
577 o 1:cda818e7219b@default "changea" files: a
572 o 1:cda818e7219b@default "changea" files: a
578 |
573 |
579 o 0:c334dc3be0da@default "add" files: a
574 o 0:c334dc3be0da@default "add" files: a
580
575
581 $ cat anonymousbranch-hg/.hg/shamap
576 $ cat anonymousbranch-hg/.hg/shamap
582 0146e6129113dba9ac90207cfdf2d7ed35257ae5 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
577 0146e6129113dba9ac90207cfdf2d7ed35257ae5 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
583 1f60ea61782421edf8d051ff4fcb61b330f26a4a cda818e7219b5f7f3fb9f49780054ed6a1905ec3
578 1f60ea61782421edf8d051ff4fcb61b330f26a4a cda818e7219b5f7f3fb9f49780054ed6a1905ec3
584 607eb44b17f9348cd5cbd26e16af87ba77b0b037 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
579 607eb44b17f9348cd5cbd26e16af87ba77b0b037 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
585 c71d5201a498b2658d105a6bf69d7a0df2649aea cda818e7219b5f7f3fb9f49780054ed6a1905ec3
580 c71d5201a498b2658d105a6bf69d7a0df2649aea cda818e7219b5f7f3fb9f49780054ed6a1905ec3
586
581
587 $ cat > filemap <<EOF
582 $ cat > filemap <<EOF
588 > include b
583 > include b
589 > EOF
584 > EOF
590 $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg2
585 $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg2
591 initializing destination anonymousbranch-hg2 repository
586 initializing destination anonymousbranch-hg2 repository
592 scanning source...
587 scanning source...
593 sorting...
588 sorting...
594 converting...
589 converting...
595 3 add
590 3 add
596 2 changea
591 2 changea
597 1 changeb
592 1 changeb
598 0 merge
593 0 merge
599 $ glog -R anonymousbranch
594 $ glog -R anonymousbranch
600 @ 3:c71d5201a498@default "merge" files:
595 @ 3:c71d5201a498@default "merge" files:
601 |\
596 |\
602 | o 2:607eb44b17f9@default "changeb" files: b
597 | o 2:607eb44b17f9@default "changeb" files: b
603 | |
598 | |
604 o | 1:1f60ea617824@default "changea" files: a
599 o | 1:1f60ea617824@default "changea" files: a
605 |/
600 |/
606 o 0:0146e6129113@default "add" files: a b
601 o 0:0146e6129113@default "add" files: a b
607
602
608 $ glog -R anonymousbranch-hg2
603 $ glog -R anonymousbranch-hg2
609 o 1:62dd350b0df6@default "changeb" files: b
604 o 1:62dd350b0df6@default "changeb" files: b
610 |
605 |
611 o 0:4b9ced861657@default "add" files: b
606 o 0:4b9ced861657@default "add" files: b
612
607
613 $ cat anonymousbranch-hg2/.hg/shamap
608 $ cat anonymousbranch-hg2/.hg/shamap
614 0146e6129113dba9ac90207cfdf2d7ed35257ae5 4b9ced86165703791653059a1db6ed864630a523
609 0146e6129113dba9ac90207cfdf2d7ed35257ae5 4b9ced86165703791653059a1db6ed864630a523
615 1f60ea61782421edf8d051ff4fcb61b330f26a4a 4b9ced86165703791653059a1db6ed864630a523
610 1f60ea61782421edf8d051ff4fcb61b330f26a4a 4b9ced86165703791653059a1db6ed864630a523
616 607eb44b17f9348cd5cbd26e16af87ba77b0b037 62dd350b0df695f7d2c82a02e0499b16fd790f22
611 607eb44b17f9348cd5cbd26e16af87ba77b0b037 62dd350b0df695f7d2c82a02e0499b16fd790f22
617 c71d5201a498b2658d105a6bf69d7a0df2649aea 62dd350b0df695f7d2c82a02e0499b16fd790f22
612 c71d5201a498b2658d105a6bf69d7a0df2649aea 62dd350b0df695f7d2c82a02e0499b16fd790f22
618
613
619 test named branch pruning
614 test named branch pruning
620
615
621 $ hg init namedbranch
616 $ hg init namedbranch
622 $ cd namedbranch
617 $ cd namedbranch
623 $ echo a > a
618 $ echo a > a
624 $ echo b > b
619 $ echo b > b
625 $ hg ci -Am add
620 $ hg ci -Am add
626 adding a
621 adding a
627 adding b
622 adding b
628 $ echo a >> a
623 $ echo a >> a
629 $ hg ci -m changea
624 $ hg ci -m changea
630 $ hg up 0
625 $ hg up 0
631 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
626 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
632 $ hg branch foo
627 $ hg branch foo
633 marked working directory as branch foo
628 marked working directory as branch foo
634 (branches are permanent and global, did you want a bookmark?)
629 (branches are permanent and global, did you want a bookmark?)
635 $ echo b >> b
630 $ echo b >> b
636 $ hg ci -m changeb
631 $ hg ci -m changeb
637 $ hg up default
632 $ hg up default
638 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
633 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
639 $ hg merge foo
634 $ hg merge foo
640 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
635 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
641 (branch merge, don't forget to commit)
636 (branch merge, don't forget to commit)
642 $ hg ci -m merge
637 $ hg ci -m merge
643 $ cd ..
638 $ cd ..
644
639
645 $ cat > filemap <<EOF
640 $ cat > filemap <<EOF
646 > include a
641 > include a
647 > EOF
642 > EOF
648 $ hg convert --filemap filemap namedbranch namedbranch-hg
643 $ hg convert --filemap filemap namedbranch namedbranch-hg
649 initializing destination namedbranch-hg repository
644 initializing destination namedbranch-hg repository
650 scanning source...
645 scanning source...
651 sorting...
646 sorting...
652 converting...
647 converting...
653 3 add
648 3 add
654 2 changea
649 2 changea
655 1 changeb
650 1 changeb
656 0 merge
651 0 merge
657 $ glog -R namedbranch
652 $ glog -R namedbranch
658 @ 3:73899bcbe45c@default "merge" files:
653 @ 3:73899bcbe45c@default "merge" files:
659 |\
654 |\
660 | o 2:8097982d19fc@foo "changeb" files: b
655 | o 2:8097982d19fc@foo "changeb" files: b
661 | |
656 | |
662 o | 1:1f60ea617824@default "changea" files: a
657 o | 1:1f60ea617824@default "changea" files: a
663 |/
658 |/
664 o 0:0146e6129113@default "add" files: a b
659 o 0:0146e6129113@default "add" files: a b
665
660
666 $ glog -R namedbranch-hg
661 $ glog -R namedbranch-hg
667 o 1:cda818e7219b@default "changea" files: a
662 o 1:cda818e7219b@default "changea" files: a
668 |
663 |
669 o 0:c334dc3be0da@default "add" files: a
664 o 0:c334dc3be0da@default "add" files: a
670
665
671
666
672 $ cd namedbranch
667 $ cd namedbranch
673 $ hg --config extensions.mq= strip tip
668 $ hg --config extensions.mq= strip tip
674 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
669 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
675 saved backup bundle to $TESTTMP/namedbranch/.hg/strip-backup/73899bcbe45c-92adf160-backup.hg
670 saved backup bundle to $TESTTMP/namedbranch/.hg/strip-backup/73899bcbe45c-92adf160-backup.hg
676 $ hg up foo
671 $ hg up foo
677 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
672 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
678 $ hg merge default
673 $ hg merge default
679 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
674 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
680 (branch merge, don't forget to commit)
675 (branch merge, don't forget to commit)
681 $ hg ci -m merge
676 $ hg ci -m merge
682 $ cd ..
677 $ cd ..
683
678
684 $ hg convert --filemap filemap namedbranch namedbranch-hg2
679 $ hg convert --filemap filemap namedbranch namedbranch-hg2
685 initializing destination namedbranch-hg2 repository
680 initializing destination namedbranch-hg2 repository
686 scanning source...
681 scanning source...
687 sorting...
682 sorting...
688 converting...
683 converting...
689 3 add
684 3 add
690 2 changea
685 2 changea
691 1 changeb
686 1 changeb
692 0 merge
687 0 merge
693 $ glog -R namedbranch
688 $ glog -R namedbranch
694 @ 3:e1959de76e1b@foo "merge" files:
689 @ 3:e1959de76e1b@foo "merge" files:
695 |\
690 |\
696 | o 2:8097982d19fc@foo "changeb" files: b
691 | o 2:8097982d19fc@foo "changeb" files: b
697 | |
692 | |
698 o | 1:1f60ea617824@default "changea" files: a
693 o | 1:1f60ea617824@default "changea" files: a
699 |/
694 |/
700 o 0:0146e6129113@default "add" files: a b
695 o 0:0146e6129113@default "add" files: a b
701
696
702 $ glog -R namedbranch-hg2
697 $ glog -R namedbranch-hg2
703 o 2:dcf314454667@foo "merge" files:
698 o 2:dcf314454667@foo "merge" files:
704 |\
699 |\
705 | o 1:cda818e7219b@default "changea" files: a
700 | o 1:cda818e7219b@default "changea" files: a
706 |/
701 |/
707 o 0:c334dc3be0da@default "add" files: a
702 o 0:c334dc3be0da@default "add" files: a
708
703
709 $ cd ..
704 $ cd ..
710
705
711 test converting merges into a repo that contains other files
706 test converting merges into a repo that contains other files
712
707
713 $ hg init merge-test1
708 $ hg init merge-test1
714 $ cd merge-test1
709 $ cd merge-test1
715 $ touch a && hg commit -Aqm 'add a'
710 $ touch a && hg commit -Aqm 'add a'
716 $ echo a > a && hg commit -Aqm 'edit a'
711 $ echo a > a && hg commit -Aqm 'edit a'
717 $ hg up -q 0
712 $ hg up -q 0
718 $ touch b && hg commit -Aqm 'add b'
713 $ touch b && hg commit -Aqm 'add b'
719 $ hg merge -q 1 && hg commit -qm 'merge a & b'
714 $ hg merge -q 1 && hg commit -qm 'merge a & b'
720
715
721 $ cd ..
716 $ cd ..
722 $ hg init merge-test2
717 $ hg init merge-test2
723 $ cd merge-test2
718 $ cd merge-test2
724 $ mkdir converted
719 $ mkdir converted
725 $ touch converted/a toberemoved && hg commit -Aqm 'add converted/a & toberemoved'
720 $ touch converted/a toberemoved && hg commit -Aqm 'add converted/a & toberemoved'
726 $ touch x && rm toberemoved && hg commit -Aqm 'add x & remove tobremoved'
721 $ touch x && rm toberemoved && hg commit -Aqm 'add x & remove tobremoved'
727 $ cd ..
722 $ cd ..
728 $ hg log -G -T '{shortest(node)} {desc}' -R merge-test1
723 $ hg log -G -T '{shortest(node)} {desc}' -R merge-test1
729 @ 1191 merge a & b
724 @ 1191 merge a & b
730 |\
725 |\
731 | o 9077 add b
726 | o 9077 add b
732 | |
727 | |
733 o | d19f edit a
728 o | d19f edit a
734 |/
729 |/
735 o ac82 add a
730 o ac82 add a
736
731
737 $ hg log -G -T '{shortest(node)} {desc}' -R merge-test2
732 $ hg log -G -T '{shortest(node)} {desc}' -R merge-test2
738 @ 150e add x & remove tobremoved
733 @ 150e add x & remove tobremoved
739 |
734 |
740 o bbac add converted/a & toberemoved
735 o bbac add converted/a & toberemoved
741
736
742 - Build a shamap where the target converted/a is in on top of an unrelated
737 - Build a shamap where the target converted/a is in on top of an unrelated
743 - change to 'x'. This simulates using convert to merge several repositories
738 - change to 'x'. This simulates using convert to merge several repositories
744 - together.
739 - together.
745 $ cat >> merge-test2/.hg/shamap <<EOF
740 $ cat >> merge-test2/.hg/shamap <<EOF
746 > $(hg -R merge-test1 log -r 0 -T '{node}') $(hg -R merge-test2 log -r 0 -T '{node}')
741 > $(hg -R merge-test1 log -r 0 -T '{node}') $(hg -R merge-test2 log -r 0 -T '{node}')
747 > $(hg -R merge-test1 log -r 1 -T '{node}') $(hg -R merge-test2 log -r 1 -T '{node}')
742 > $(hg -R merge-test1 log -r 1 -T '{node}') $(hg -R merge-test2 log -r 1 -T '{node}')
748 > EOF
743 > EOF
749 $ cat >> merge-test-filemap <<EOF
744 $ cat >> merge-test-filemap <<EOF
750 > rename . converted/
745 > rename . converted/
751 > EOF
746 > EOF
752 $ hg convert --filemap merge-test-filemap merge-test1 merge-test2 --traceback
747 $ hg convert --filemap merge-test-filemap merge-test1 merge-test2 --traceback
753 scanning source...
748 scanning source...
754 sorting...
749 sorting...
755 converting...
750 converting...
756 1 add b
751 1 add b
757 0 merge a & b
752 0 merge a & b
758 $ hg -R merge-test2 manifest -r tip
753 $ hg -R merge-test2 manifest -r tip
759 converted/a
754 converted/a
760 converted/b
755 converted/b
761 x
756 x
762 $ hg -R merge-test2 log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
757 $ hg -R merge-test2 log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
763 o e2ff merge a & b
758 o e2ff merge a & b
764 |\ - converted/a
759 |\ - converted/a
765 | |
760 | |
766 | o 2995 add b
761 | o 2995 add b
767 | | - converted/b
762 | | - converted/b
768 | |
763 | |
769 @ | 150e add x & remove tobremoved
764 @ | 150e add x & remove tobremoved
770 |/ - toberemoved
765 |/ - toberemoved
771 | - x
766 | - x
772 |
767 |
773 o bbac add converted/a & toberemoved
768 o bbac add converted/a & toberemoved
774 - converted/a
769 - converted/a
775 - toberemoved
770 - toberemoved
776
771
777 $ cd ..
772 $ cd ..
778
773
779 Test case where cleanp2 contains a file that doesn't exist in p2 - for
774 Test case where cleanp2 contains a file that doesn't exist in p2 - for
780 example because filemap changed.
775 example because filemap changed.
781
776
782 $ hg init cleanp2
777 $ hg init cleanp2
783 $ cd cleanp2
778 $ cd cleanp2
784 $ touch f f1 f2 && hg ci -Aqm '0'
779 $ touch f f1 f2 && hg ci -Aqm '0'
785 $ echo f1 > f1 && echo >> f && hg ci -m '1'
780 $ echo f1 > f1 && echo >> f && hg ci -m '1'
786 $ hg up -qr0 && echo f2 > f2 && echo >> f && hg ci -qm '2'
781 $ hg up -qr0 && echo f2 > f2 && echo >> f && hg ci -qm '2'
787 $ echo "include f" > filemap
782 $ echo "include f" > filemap
788 $ hg convert --filemap filemap .
783 $ hg convert --filemap filemap .
789 assuming destination .-hg
784 assuming destination .-hg
790 initializing destination .-hg repository
785 initializing destination .-hg repository
791 scanning source...
786 scanning source...
792 sorting...
787 sorting...
793 converting...
788 converting...
794 2 0
789 2 0
795 1 1
790 1 1
796 0 2
791 0 2
797 $ hg merge && hg ci -qm '3'
792 $ hg merge && hg ci -qm '3'
798 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
799 (branch merge, don't forget to commit)
794 (branch merge, don't forget to commit)
800 $ echo "include ." > filemap
795 $ echo "include ." > filemap
801 $ hg convert --filemap filemap .
796 $ hg convert --filemap filemap .
802 assuming destination .-hg
797 assuming destination .-hg
803 scanning source...
798 scanning source...
804 sorting...
799 sorting...
805 converting...
800 converting...
806 0 3
801 0 3
807 $ hg -R .-hg log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
802 $ hg -R .-hg log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
808 o bbfe 3
803 o bbfe 3
809 |\
804 |\
810 | o 33a0 2
805 | o 33a0 2
811 | | - f
806 | | - f
812 | |
807 | |
813 o | f73e 1
808 o | f73e 1
814 |/ - f
809 |/ - f
815 |
810 |
816 o d681 0
811 o d681 0
817 - f
812 - f
818
813
819 $ hg -R .-hg mani -r tip
814 $ hg -R .-hg mani -r tip
820 f
815 f
821 $ cd ..
816 $ cd ..
@@ -1,227 +1,222
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > convert=
3 > convert=
4 > [convert]
4 > [convert]
5 > hg.saverev=False
5 > hg.saverev=False
6 > EOF
6 > EOF
7 $ hg init orig
7 $ hg init orig
8 $ cd orig
8 $ cd orig
9 $ echo foo > foo
9 $ echo foo > foo
10 $ echo bar > bar
10 $ echo bar > bar
11 $ hg ci -qAm 'add foo bar' -d '0 0'
11 $ hg ci -qAm 'add foo bar' -d '0 0'
12 $ echo >> foo
12 $ echo >> foo
13 $ hg ci -m 'change foo' -d '1 0'
13 $ hg ci -m 'change foo' -d '1 0'
14 $ hg up -qC 0
14 $ hg up -qC 0
15 $ hg copy --after --force foo bar
15 $ hg copy --after --force foo bar
16 $ hg copy foo baz
16 $ hg copy foo baz
17 $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
17 $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
18 created new head
18 created new head
19
19
20 Test that template can print all file copies (issue4362)
20 Test that template can print all file copies (issue4362)
21 $ hg log -r . --template "{file_copies % ' File: {file_copy}\n'}"
21 $ hg log -r . --template "{file_copies % ' File: {file_copy}\n'}"
22 File: bar (foo)
22 File: bar (foo)
23 File: baz (foo)
23 File: baz (foo)
24
24
25 $ hg bookmark premerge1
25 $ hg bookmark premerge1
26 $ hg merge -r 1
26 $ hg merge -r 1
27 merging baz and foo to baz
27 merging baz and foo to baz
28 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
28 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
29 (branch merge, don't forget to commit)
29 (branch merge, don't forget to commit)
30 $ hg ci -m 'merge local copy' -d '3 0'
30 $ hg ci -m 'merge local copy' -d '3 0'
31 $ hg up -C 1
31 $ hg up -C 1
32 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
32 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
33 (leaving bookmark premerge1)
33 (leaving bookmark premerge1)
34 $ hg bookmark premerge2
34 $ hg bookmark premerge2
35 $ hg merge 2
35 $ hg merge 2
36 merging foo and baz to baz
36 merging foo and baz to baz
37 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
37 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
38 (branch merge, don't forget to commit)
39 $ hg ci -m 'merge remote copy' -d '4 0'
39 $ hg ci -m 'merge remote copy' -d '4 0'
40 created new head
40 created new head
41
41
42 Make and delete some tags
42 Make and delete some tags
43
43
44 $ hg tag that
44 $ hg tag that
45 $ hg tag --remove that
45 $ hg tag --remove that
46 $ hg tag this
46 $ hg tag this
47
47
48 #if execbit
48 #if execbit
49 $ chmod +x baz
49 $ chmod +x baz
50 #else
50 #else
51 $ echo some other change to make sure we get a rev 5 > baz
51 $ echo some other change to make sure we get a rev 5 > baz
52 #endif
52 #endif
53 $ hg ci -m 'mark baz executable' -d '5 0'
53 $ hg ci -m 'mark baz executable' -d '5 0'
54 $ cd ..
54 $ cd ..
55 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
55 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
56 initializing destination new repository
56 initializing destination new repository
57 scanning source...
57 scanning source...
58 sorting...
58 sorting...
59 converting...
59 converting...
60 8 add foo bar
60 8 add foo bar
61 7 change foo
61 7 change foo
62 6 make bar and baz copies of foo
62 6 make bar and baz copies of foo
63 5 merge local copy
63 5 merge local copy
64 4 merge remote copy
64 4 merge remote copy
65 3 Added tag that for changeset 8601262d7472
65 3 Added tag that for changeset 8601262d7472
66 2 Removed tag that
66 2 Removed tag that
67 1 Added tag this for changeset 706614b458c1
67 1 Added tag this for changeset 706614b458c1
68 0 mark baz executable
68 0 mark baz executable
69 updating bookmarks
69 updating bookmarks
70 $ cd new
70 $ cd new
71 $ hg out ../orig
71 $ hg out ../orig
72 comparing with ../orig
72 comparing with ../orig
73 searching for changes
73 searching for changes
74 no changes found
74 no changes found
75 [1]
75 [1]
76 #if execbit
76 #if execbit
77 $ hg bookmarks
77 $ hg bookmarks
78 premerge1 3:973ef48a98a4
78 premerge1 3:973ef48a98a4
79 premerge2 8:c4968fdf2e5d
79 premerge2 8:c4968fdf2e5d
80 #else
80 #else
81 Different hash because no x bit
81 Different hash because no x bit
82 $ hg bookmarks
82 $ hg bookmarks
83 premerge1 3:973ef48a98a4
83 premerge1 3:973ef48a98a4
84 premerge2 8:1cc21e701444
84 premerge2 8:1cc21e701444
85 #endif
85 #endif
86
86
87 Test that redoing a convert results in an identical graph
87 Test that redoing a convert results in an identical graph
88 $ cd ../
88 $ cd ../
89 $ rm new/.hg/shamap
89 $ rm new/.hg/shamap
90 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
90 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
91 scanning source...
91 scanning source...
92 sorting...
92 sorting...
93 converting...
93 converting...
94 8 add foo bar
94 8 add foo bar
95 7 change foo
95 7 change foo
96 6 make bar and baz copies of foo
96 6 make bar and baz copies of foo
97 5 merge local copy
97 5 merge local copy
98 4 merge remote copy
98 4 merge remote copy
99 3 Added tag that for changeset 8601262d7472
99 3 Added tag that for changeset 8601262d7472
100 2 Removed tag that
100 2 Removed tag that
101 1 Added tag this for changeset 706614b458c1
101 1 Added tag this for changeset 706614b458c1
102 0 mark baz executable
102 0 mark baz executable
103 updating bookmarks
103 updating bookmarks
104 $ hg -R new log -G -T '{rev} {desc}'
104 $ hg -R new log -G -T '{rev} {desc}'
105 o 8 mark baz executable
105 o 8 mark baz executable
106 |
106 |
107 o 7 Added tag this for changeset 706614b458c1
107 o 7 Added tag this for changeset 706614b458c1
108 |
108 |
109 o 6 Removed tag that
109 o 6 Removed tag that
110 |
110 |
111 o 5 Added tag that for changeset 8601262d7472
111 o 5 Added tag that for changeset 8601262d7472
112 |
112 |
113 o 4 merge remote copy
113 o 4 merge remote copy
114 |\
114 |\
115 +---o 3 merge local copy
115 +---o 3 merge local copy
116 | |/
116 | |/
117 | o 2 make bar and baz copies of foo
117 | o 2 make bar and baz copies of foo
118 | |
118 | |
119 o | 1 change foo
119 o | 1 change foo
120 |/
120 |/
121 o 0 add foo bar
121 o 0 add foo bar
122
122
123
123
124 check shamap LF and CRLF handling
124 check shamap LF and CRLF handling
125
125
126 $ cat > rewrite.py <<EOF
126 $ cat > rewrite.py <<EOF
127 > import sys
127 > import sys
128 > # Interlace LF and CRLF
128 > # Interlace LF and CRLF
129 > lines = [(l.rstrip() + ((i % 2) and b'\n' or b'\r\n'))
129 > lines = [(l.rstrip() + ((i % 2) and b'\n' or b'\r\n'))
130 > for i, l in enumerate(open(sys.argv[1], 'rb'))]
130 > for i, l in enumerate(open(sys.argv[1], 'rb'))]
131 > open(sys.argv[1], 'wb').write(b''.join(lines))
131 > open(sys.argv[1], 'wb').write(b''.join(lines))
132 > EOF
132 > EOF
133 $ "$PYTHON" rewrite.py new/.hg/shamap
133 $ "$PYTHON" rewrite.py new/.hg/shamap
134 $ cd orig
134 $ cd orig
135 $ hg up -qC 1
135 $ hg up -qC 1
136 $ echo foo >> foo
136 $ echo foo >> foo
137 $ hg ci -qm 'change foo again'
137 $ hg ci -qm 'change foo again'
138 $ hg up -qC 2
138 $ hg up -qC 2
139 $ echo foo >> foo
139 $ echo foo >> foo
140 $ hg ci -qm 'change foo again again'
140 $ hg ci -qm 'change foo again again'
141 $ cd ..
141 $ cd ..
142 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
142 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
143 scanning source...
143 scanning source...
144 sorting...
144 sorting...
145 converting...
145 converting...
146 1 change foo again again
146 1 change foo again again
147 0 change foo again
147 0 change foo again
148 updating bookmarks
148 updating bookmarks
149
149
150 init broken repository
150 init broken repository
151
151
152 $ hg init broken
152 $ hg init broken
153 $ cd broken
153 $ cd broken
154 $ echo a >> a
154 $ echo a >> a
155 $ echo b >> b
155 $ echo b >> b
156 $ hg ci -qAm init
156 $ hg ci -qAm init
157 $ echo a >> a
157 $ echo a >> a
158 $ echo b >> b
158 $ echo b >> b
159 $ hg copy b c
159 $ hg copy b c
160 $ hg ci -qAm changeall
160 $ hg ci -qAm changeall
161 $ hg up -qC 0
161 $ hg up -qC 0
162 $ echo bc >> b
162 $ echo bc >> b
163 $ hg ci -m changebagain
163 $ hg ci -m changebagain
164 created new head
164 created new head
165 $ HGMERGE=internal:local hg -q merge
165 $ HGMERGE=internal:local hg -q merge
166 $ hg ci -m merge
166 $ hg ci -m merge
167 $ hg mv b d
167 $ hg mv b d
168 $ hg ci -m moveb
168 $ hg ci -m moveb
169
169
170 break it
170 break it
171
171
172 #if reporevlogstore
172 #if reporevlogstore
173 $ rm .hg/store/data/b.*
173 $ rm .hg/store/data/b.*
174 #endif
174 #endif
175 #if reposimplestore
175 #if reposimplestore
176 $ rm .hg/store/data/b/*
176 $ rm .hg/store/data/b/*
177 #endif
177 #endif
178 $ cd ..
178 $ cd ..
179 $ hg --config convert.hg.ignoreerrors=True convert broken fixed
179 $ hg --config convert.hg.ignoreerrors=True convert broken fixed
180 initializing destination fixed repository
180 initializing destination fixed repository
181 scanning source...
181 scanning source...
182 sorting...
182 sorting...
183 converting...
183 converting...
184 4 init
184 4 init
185 ignoring: b@1e88685f5ddec574a34c70af492f95b6debc8741: no match found (reporevlogstore !)
185 ignoring: b@1e88685f5ddec574a34c70af492f95b6debc8741: no match found (reporevlogstore !)
186 ignoring: data/b/index@1e88685f5dde: no node (reposimplestore !)
186 ignoring: data/b/index@1e88685f5dde: no node (reposimplestore !)
187 3 changeall
187 3 changeall
188 2 changebagain
188 2 changebagain
189 1 merge
189 1 merge
190 0 moveb
190 0 moveb
191 $ hg -R fixed verify
191 $ hg -R fixed verify -q
192 checking changesets
193 checking manifests
194 crosschecking files in changesets and manifests
195 checking files
196 checked 5 changesets with 5 changes to 3 files
197
192
198 manifest -r 0
193 manifest -r 0
199
194
200 $ hg -R fixed manifest -r 0
195 $ hg -R fixed manifest -r 0
201 a
196 a
202
197
203 manifest -r tip
198 manifest -r tip
204
199
205 $ hg -R fixed manifest -r tip
200 $ hg -R fixed manifest -r tip
206 a
201 a
207 c
202 c
208 d
203 d
209 $ cd ..
204 $ cd ..
210
205
211 $ hg init commit-references
206 $ hg init commit-references
212 $ cd commit-references
207 $ cd commit-references
213 $ echo a > a
208 $ echo a > a
214 $ hg ci -Aqm initial
209 $ hg ci -Aqm initial
215 $ echo b > b
210 $ echo b > b
216 $ hg ci -Aqm 'the previous commit was 1451231c8757'
211 $ hg ci -Aqm 'the previous commit was 1451231c8757'
217 $ echo c > c
212 $ echo c > c
218 $ hg ci -Aqm 'the working copy is called ffffffffffff'
213 $ hg ci -Aqm 'the working copy is called ffffffffffff'
219
214
220 $ cd ..
215 $ cd ..
221 $ hg convert commit-references new-commit-references -q \
216 $ hg convert commit-references new-commit-references -q \
222 > --config convert.hg.sourcename=yes
217 > --config convert.hg.sourcename=yes
223 $ cd new-commit-references
218 $ cd new-commit-references
224 $ hg log -T '{node|short} {desc}\n'
219 $ hg log -T '{node|short} {desc}\n'
225 fe295c9e6bc6 the working copy is called ffffffffffff
220 fe295c9e6bc6 the working copy is called ffffffffffff
226 642508659503 the previous commit was c2491f685436
221 642508659503 the previous commit was c2491f685436
227 c2491f685436 initial
222 c2491f685436 initial
@@ -1,416 +1,411
1 $ mkdir part1
1 $ mkdir part1
2 $ cd part1
2 $ cd part1
3
3
4 $ hg init
4 $ hg init
5 $ echo a > a
5 $ echo a > a
6 $ hg add a
6 $ hg add a
7 $ hg commit -m "1"
7 $ hg commit -m "1"
8 $ hg status
8 $ hg status
9 $ hg copy a b
9 $ hg copy a b
10 $ hg --config ui.portablefilenames=abort copy a con.xml
10 $ hg --config ui.portablefilenames=abort copy a con.xml
11 abort: filename contains 'con', which is reserved on Windows: con.xml
11 abort: filename contains 'con', which is reserved on Windows: con.xml
12 [10]
12 [10]
13 $ hg status
13 $ hg status
14 A b
14 A b
15 $ hg sum
15 $ hg sum
16 parent: 0:c19d34741b0a tip
16 parent: 0:c19d34741b0a tip
17 1
17 1
18 branch: default
18 branch: default
19 commit: 1 copied
19 commit: 1 copied
20 update: (current)
20 update: (current)
21 phases: 1 draft
21 phases: 1 draft
22 $ hg --debug commit -m "2"
22 $ hg --debug commit -m "2"
23 committing files:
23 committing files:
24 b
24 b
25 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
25 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
26 committing manifest
26 committing manifest
27 committing changelog
27 committing changelog
28 updating the branch cache
28 updating the branch cache
29 committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
29 committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
30
30
31 we should see two history entries
31 we should see two history entries
32
32
33 $ hg history -v
33 $ hg history -v
34 changeset: 1:93580a2c28a5
34 changeset: 1:93580a2c28a5
35 tag: tip
35 tag: tip
36 user: test
36 user: test
37 date: Thu Jan 01 00:00:00 1970 +0000
37 date: Thu Jan 01 00:00:00 1970 +0000
38 files: b
38 files: b
39 description:
39 description:
40 2
40 2
41
41
42
42
43 changeset: 0:c19d34741b0a
43 changeset: 0:c19d34741b0a
44 user: test
44 user: test
45 date: Thu Jan 01 00:00:00 1970 +0000
45 date: Thu Jan 01 00:00:00 1970 +0000
46 files: a
46 files: a
47 description:
47 description:
48 1
48 1
49
49
50
50
51
51
52 we should see one log entry for a
52 we should see one log entry for a
53
53
54 $ hg log a
54 $ hg log a
55 changeset: 0:c19d34741b0a
55 changeset: 0:c19d34741b0a
56 user: test
56 user: test
57 date: Thu Jan 01 00:00:00 1970 +0000
57 date: Thu Jan 01 00:00:00 1970 +0000
58 summary: 1
58 summary: 1
59
59
60
60
61 this should show a revision linked to changeset 0
61 this should show a revision linked to changeset 0
62
62
63 $ hg debugindex a
63 $ hg debugindex a
64 rev linkrev nodeid p1-nodeid p2-nodeid
64 rev linkrev nodeid p1-nodeid p2-nodeid
65 0 0 b789fdd96dc2 000000000000 000000000000
65 0 0 b789fdd96dc2 000000000000 000000000000
66
66
67 we should see one log entry for b
67 we should see one log entry for b
68
68
69 $ hg log b
69 $ hg log b
70 changeset: 1:93580a2c28a5
70 changeset: 1:93580a2c28a5
71 tag: tip
71 tag: tip
72 user: test
72 user: test
73 date: Thu Jan 01 00:00:00 1970 +0000
73 date: Thu Jan 01 00:00:00 1970 +0000
74 summary: 2
74 summary: 2
75
75
76
76
77 this should show a revision linked to changeset 1
77 this should show a revision linked to changeset 1
78
78
79 $ hg debugindex b
79 $ hg debugindex b
80 rev linkrev nodeid p1-nodeid p2-nodeid
80 rev linkrev nodeid p1-nodeid p2-nodeid
81 0 1 37d9b5d994ea 000000000000 000000000000
81 0 1 37d9b5d994ea 000000000000 000000000000
82
82
83 this should show the rename information in the metadata
83 this should show the rename information in the metadata
84
84
85 $ hg debugdata b 0 | head -3 | tail -2
85 $ hg debugdata b 0 | head -3 | tail -2
86 copy: a
86 copy: a
87 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
87 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
88
88
89 #if reporevlogstore
89 #if reporevlogstore
90 $ md5sum.py .hg/store/data/b.i
90 $ md5sum.py .hg/store/data/b.i
91 44913824c8f5890ae218f9829535922e .hg/store/data/b.i
91 44913824c8f5890ae218f9829535922e .hg/store/data/b.i
92 #endif
92 #endif
93 $ hg cat b > bsum
93 $ hg cat b > bsum
94 $ md5sum.py bsum
94 $ md5sum.py bsum
95 60b725f10c9c85c70d97880dfe8191b3 bsum
95 60b725f10c9c85c70d97880dfe8191b3 bsum
96 $ hg cat a > asum
96 $ hg cat a > asum
97 $ md5sum.py asum
97 $ md5sum.py asum
98 60b725f10c9c85c70d97880dfe8191b3 asum
98 60b725f10c9c85c70d97880dfe8191b3 asum
99 $ hg verify
99 $ hg verify -q
100 checking changesets
101 checking manifests
102 crosschecking files in changesets and manifests
103 checking files
104 checked 2 changesets with 2 changes to 2 files
105
100
106 $ cd ..
101 $ cd ..
107
102
108
103
109 $ mkdir part2
104 $ mkdir part2
110 $ cd part2
105 $ cd part2
111
106
112 $ hg init
107 $ hg init
113 $ echo foo > foo
108 $ echo foo > foo
114 should fail - foo is not managed
109 should fail - foo is not managed
115 $ hg mv foo bar
110 $ hg mv foo bar
116 foo: not copying - file is not managed
111 foo: not copying - file is not managed
117 abort: no files to copy
112 abort: no files to copy
118 (maybe you meant to use --after --at-rev=.)
113 (maybe you meant to use --after --at-rev=.)
119 [10]
114 [10]
120 $ hg st -A
115 $ hg st -A
121 ? foo
116 ? foo
122 respects ui.relative-paths
117 respects ui.relative-paths
123 $ mkdir dir
118 $ mkdir dir
124 $ cd dir
119 $ cd dir
125 $ hg mv ../foo ../bar
120 $ hg mv ../foo ../bar
126 ../foo: not copying - file is not managed
121 ../foo: not copying - file is not managed
127 abort: no files to copy
122 abort: no files to copy
128 (maybe you meant to use --after --at-rev=.)
123 (maybe you meant to use --after --at-rev=.)
129 [10]
124 [10]
130 $ hg mv ../foo ../bar --config ui.relative-paths=yes
125 $ hg mv ../foo ../bar --config ui.relative-paths=yes
131 ../foo: not copying - file is not managed
126 ../foo: not copying - file is not managed
132 abort: no files to copy
127 abort: no files to copy
133 (maybe you meant to use --after --at-rev=.)
128 (maybe you meant to use --after --at-rev=.)
134 [10]
129 [10]
135 $ hg mv ../foo ../bar --config ui.relative-paths=no
130 $ hg mv ../foo ../bar --config ui.relative-paths=no
136 foo: not copying - file is not managed
131 foo: not copying - file is not managed
137 abort: no files to copy
132 abort: no files to copy
138 (maybe you meant to use --after --at-rev=.)
133 (maybe you meant to use --after --at-rev=.)
139 [10]
134 [10]
140 $ cd ..
135 $ cd ..
141 $ rmdir dir
136 $ rmdir dir
142 $ hg add foo
137 $ hg add foo
143 dry-run; print a warning that this is not a real copy; foo is added
138 dry-run; print a warning that this is not a real copy; foo is added
144 $ hg mv --dry-run foo bar
139 $ hg mv --dry-run foo bar
145 foo has not been committed yet, so no copy data will be stored for bar.
140 foo has not been committed yet, so no copy data will be stored for bar.
146 $ hg st -A
141 $ hg st -A
147 A foo
142 A foo
148 should print a warning that this is not a real copy; bar is added
143 should print a warning that this is not a real copy; bar is added
149 $ hg mv foo bar
144 $ hg mv foo bar
150 foo has not been committed yet, so no copy data will be stored for bar.
145 foo has not been committed yet, so no copy data will be stored for bar.
151 $ hg st -A
146 $ hg st -A
152 A bar
147 A bar
153 should print a warning that this is not a real copy; foo is added
148 should print a warning that this is not a real copy; foo is added
154 $ hg cp bar foo
149 $ hg cp bar foo
155 bar has not been committed yet, so no copy data will be stored for foo.
150 bar has not been committed yet, so no copy data will be stored for foo.
156 $ hg rm -f bar
151 $ hg rm -f bar
157 $ rm bar
152 $ rm bar
158 $ hg st -A
153 $ hg st -A
159 A foo
154 A foo
160 $ hg commit -m1
155 $ hg commit -m1
161
156
162 moving a missing file
157 moving a missing file
163 $ rm foo
158 $ rm foo
164 $ hg mv foo foo3
159 $ hg mv foo foo3
165 foo: deleted in working directory
160 foo: deleted in working directory
166 foo3 does not exist!
161 foo3 does not exist!
167 $ hg up -qC .
162 $ hg up -qC .
168
163
169 copy --after to a nonexistent target filename
164 copy --after to a nonexistent target filename
170 $ hg cp -A foo dummy
165 $ hg cp -A foo dummy
171 foo: not recording copy - dummy does not exist
166 foo: not recording copy - dummy does not exist
172 [1]
167 [1]
173
168
174 dry-run; should show that foo is clean
169 dry-run; should show that foo is clean
175 $ hg copy --dry-run foo bar
170 $ hg copy --dry-run foo bar
176 $ hg st -A
171 $ hg st -A
177 C foo
172 C foo
178 should show copy
173 should show copy
179 $ hg copy foo bar
174 $ hg copy foo bar
180 $ hg st -C
175 $ hg st -C
181 A bar
176 A bar
182 foo
177 foo
183
178
184 shouldn't show copy
179 shouldn't show copy
185 $ hg commit -m2
180 $ hg commit -m2
186 $ hg st -C
181 $ hg st -C
187
182
188 should match
183 should match
189 $ hg debugindex foo
184 $ hg debugindex foo
190 rev linkrev nodeid p1-nodeid p2-nodeid
185 rev linkrev nodeid p1-nodeid p2-nodeid
191 0 0 2ed2a3912a0b 000000000000 000000000000
186 0 0 2ed2a3912a0b 000000000000 000000000000
192 $ hg debugrename bar
187 $ hg debugrename bar
193 bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
188 bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
194
189
195 $ echo bleah > foo
190 $ echo bleah > foo
196 $ echo quux > bar
191 $ echo quux > bar
197 $ hg commit -m3
192 $ hg commit -m3
198
193
199 should not be renamed
194 should not be renamed
200 $ hg debugrename bar
195 $ hg debugrename bar
201 bar not renamed
196 bar not renamed
202
197
203 $ hg copy -f foo bar
198 $ hg copy -f foo bar
204 should show copy
199 should show copy
205 $ hg st -C
200 $ hg st -C
206 M bar
201 M bar
207 foo
202 foo
208
203
209 XXX: filtering lfilesrepo.status() in 3.3-rc causes the copy source to not be
204 XXX: filtering lfilesrepo.status() in 3.3-rc causes the copy source to not be
210 displayed.
205 displayed.
211 $ hg st -C --config extensions.largefiles=
206 $ hg st -C --config extensions.largefiles=
212 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
207 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
213 M bar
208 M bar
214 foo
209 foo
215
210
216 $ hg commit -m3
211 $ hg commit -m3
217
212
218 should show no parents for tip
213 should show no parents for tip
219 $ hg debugindex bar
214 $ hg debugindex bar
220 rev linkrev nodeid p1-nodeid p2-nodeid
215 rev linkrev nodeid p1-nodeid p2-nodeid
221 0 1 7711d36246cc 000000000000 000000000000
216 0 1 7711d36246cc 000000000000 000000000000
222 1 2 bdf70a2b8d03 7711d36246cc 000000000000
217 1 2 bdf70a2b8d03 7711d36246cc 000000000000
223 2 3 b2558327ea8d 000000000000 000000000000
218 2 3 b2558327ea8d 000000000000 000000000000
224 should match
219 should match
225 $ hg debugindex foo
220 $ hg debugindex foo
226 rev linkrev nodeid p1-nodeid p2-nodeid
221 rev linkrev nodeid p1-nodeid p2-nodeid
227 0 0 2ed2a3912a0b 000000000000 000000000000
222 0 0 2ed2a3912a0b 000000000000 000000000000
228 1 2 dd12c926cf16 2ed2a3912a0b 000000000000
223 1 2 dd12c926cf16 2ed2a3912a0b 000000000000
229 $ hg debugrename bar
224 $ hg debugrename bar
230 bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
225 bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
231
226
232 should show no copies
227 should show no copies
233 $ hg st -C
228 $ hg st -C
234
229
235 note: since filelog based copy tracing only trace copy for new file, the copy information here is not displayed.
230 note: since filelog based copy tracing only trace copy for new file, the copy information here is not displayed.
236
231
237 $ hg status --copies --change .
232 $ hg status --copies --change .
238 M bar
233 M bar
239
234
240 They are a devel option to walk all file and fine this information anyway.
235 They are a devel option to walk all file and fine this information anyway.
241
236
242 $ hg status --copies --change . --config devel.copy-tracing.trace-all-files=yes
237 $ hg status --copies --change . --config devel.copy-tracing.trace-all-files=yes
243 M bar
238 M bar
244 foo
239 foo
245
240
246 copy --after on an added file
241 copy --after on an added file
247 $ cp bar baz
242 $ cp bar baz
248 $ hg add baz
243 $ hg add baz
249 $ hg cp -A bar baz
244 $ hg cp -A bar baz
250 $ hg st -C
245 $ hg st -C
251 A baz
246 A baz
252 bar
247 bar
253
248
254 foo was clean:
249 foo was clean:
255 $ hg st -AC foo
250 $ hg st -AC foo
256 C foo
251 C foo
257 Trying to copy on top of an existing file fails,
252 Trying to copy on top of an existing file fails,
258 $ hg copy -A bar foo
253 $ hg copy -A bar foo
259 foo: not overwriting - file already committed
254 foo: not overwriting - file already committed
260 ('hg copy --after --force' to replace the file by recording a copy)
255 ('hg copy --after --force' to replace the file by recording a copy)
261 [1]
256 [1]
262 same error without the --after, so the user doesn't have to go through
257 same error without the --after, so the user doesn't have to go through
263 two hints:
258 two hints:
264 $ hg copy bar foo
259 $ hg copy bar foo
265 foo: not overwriting - file already committed
260 foo: not overwriting - file already committed
266 ('hg copy --force' to replace the file by recording a copy)
261 ('hg copy --force' to replace the file by recording a copy)
267 [1]
262 [1]
268 but it's considered modified after a copy --after --force
263 but it's considered modified after a copy --after --force
269 $ hg copy -Af bar foo
264 $ hg copy -Af bar foo
270 $ hg st -AC foo
265 $ hg st -AC foo
271 M foo
266 M foo
272 bar
267 bar
273 The hint for a file that exists but is not in file history doesn't
268 The hint for a file that exists but is not in file history doesn't
274 mention --force:
269 mention --force:
275 $ touch xyzzy
270 $ touch xyzzy
276 $ hg cp bar xyzzy
271 $ hg cp bar xyzzy
277 xyzzy: not overwriting - file exists
272 xyzzy: not overwriting - file exists
278 ('hg copy --after' to record the copy)
273 ('hg copy --after' to record the copy)
279 [1]
274 [1]
280 $ hg co -qC .
275 $ hg co -qC .
281 $ rm baz xyzzy
276 $ rm baz xyzzy
282
277
283
278
284 Test unmarking copy/rename of a single file
279 Test unmarking copy/rename of a single file
285
280
286 # Set up by creating a copy
281 # Set up by creating a copy
287 $ hg cp bar baz
282 $ hg cp bar baz
288 # Test unmarking as copy a non-existent file
283 # Test unmarking as copy a non-existent file
289 $ hg copy --forget non-existent
284 $ hg copy --forget non-existent
290 non-existent: $ENOENT$
285 non-existent: $ENOENT$
291 $ hg rename --forget non-existent
286 $ hg rename --forget non-existent
292 non-existent: $ENOENT$
287 non-existent: $ENOENT$
293 # Test unmarking as copy an tracked but unrelated file
288 # Test unmarking as copy an tracked but unrelated file
294 $ hg copy --forget foo
289 $ hg copy --forget foo
295 foo: not unmarking as copy - file is not marked as copied
290 foo: not unmarking as copy - file is not marked as copied
296 $ hg rename --forget foo
291 $ hg rename --forget foo
297 foo: not unmarking as copy - file is not marked as copied
292 foo: not unmarking as copy - file is not marked as copied
298 # Test unmarking as copy a copy source
293 # Test unmarking as copy a copy source
299 $ hg copy --forget bar
294 $ hg copy --forget bar
300 bar: not unmarking as copy - file is not marked as copied
295 bar: not unmarking as copy - file is not marked as copied
301 $ hg rename --forget bar
296 $ hg rename --forget bar
302 bar: not unmarking as copy - file is not marked as copied
297 bar: not unmarking as copy - file is not marked as copied
303 # baz should still be marked as a copy
298 # baz should still be marked as a copy
304 $ hg st -C
299 $ hg st -C
305 A baz
300 A baz
306 bar
301 bar
307 # Test the normal case
302 # Test the normal case
308 $ hg copy --forget baz
303 $ hg copy --forget baz
309 $ hg st -C
304 $ hg st -C
310 A baz
305 A baz
311 $ rm bar
306 $ rm bar
312 $ hg rename --after bar baz
307 $ hg rename --after bar baz
313 $ hg st -C
308 $ hg st -C
314 A baz
309 A baz
315 bar
310 bar
316 R bar
311 R bar
317 $ hg rename --forget baz
312 $ hg rename --forget baz
318 $ hg st -C
313 $ hg st -C
319 A baz
314 A baz
320 R bar
315 R bar
321 $ hg revert bar
316 $ hg revert bar
322 # Test unmarking as copy with matching an non-matching patterns
317 # Test unmarking as copy with matching an non-matching patterns
323 $ hg cp bar baz --after
318 $ hg cp bar baz --after
324 $ hg copy --forget bar baz
319 $ hg copy --forget bar baz
325 bar: not unmarking as copy - file is not marked as copied
320 bar: not unmarking as copy - file is not marked as copied
326 $ hg cp bar baz --after
321 $ hg cp bar baz --after
327 $ hg rename --forget bar baz
322 $ hg rename --forget bar baz
328 bar: not unmarking as copy - file is not marked as copied
323 bar: not unmarking as copy - file is not marked as copied
329 $ hg st -C
324 $ hg st -C
330 A baz
325 A baz
331 # Test unmarking as copy with no exact matches
326 # Test unmarking as copy with no exact matches
332 $ hg cp bar baz --after
327 $ hg cp bar baz --after
333 $ hg copy --forget .
328 $ hg copy --forget .
334 $ hg st -C
329 $ hg st -C
335 A baz
330 A baz
336 $ hg cp bar baz --after
331 $ hg cp bar baz --after
337 $ hg st -C
332 $ hg st -C
338 A baz
333 A baz
339 bar
334 bar
340 $ hg rename --forget .
335 $ hg rename --forget .
341 $ hg st -C
336 $ hg st -C
342 A baz
337 A baz
343 $ hg forget baz
338 $ hg forget baz
344 $ rm baz
339 $ rm baz
345
340
346 Test unmarking copy of a directory
341 Test unmarking copy of a directory
347
342
348 $ mkdir dir
343 $ mkdir dir
349 $ echo foo > dir/foo
344 $ echo foo > dir/foo
350 $ echo bar > dir/bar
345 $ echo bar > dir/bar
351 $ hg add dir
346 $ hg add dir
352 adding dir/bar
347 adding dir/bar
353 adding dir/foo
348 adding dir/foo
354 $ hg ci -m 'add dir/'
349 $ hg ci -m 'add dir/'
355 $ hg cp dir dir2
350 $ hg cp dir dir2
356 copying dir/bar to dir2/bar
351 copying dir/bar to dir2/bar
357 copying dir/foo to dir2/foo
352 copying dir/foo to dir2/foo
358 $ touch dir2/untracked
353 $ touch dir2/untracked
359 $ hg copy --forget dir2
354 $ hg copy --forget dir2
360 $ hg st -C
355 $ hg st -C
361 A dir2/bar
356 A dir2/bar
362 A dir2/foo
357 A dir2/foo
363 ? dir2/untracked
358 ? dir2/untracked
364 # Clean up for next test
359 # Clean up for next test
365 $ hg forget dir2
360 $ hg forget dir2
366 removing dir2/bar
361 removing dir2/bar
367 removing dir2/foo
362 removing dir2/foo
368 $ rm -r dir2
363 $ rm -r dir2
369
364
370 Test uncopy on committed copies
365 Test uncopy on committed copies
371
366
372 # Commit some copies
367 # Commit some copies
373 $ hg cp bar baz
368 $ hg cp bar baz
374 $ hg cp bar qux
369 $ hg cp bar qux
375 $ hg ci -m copies
370 $ hg ci -m copies
376 $ hg st -C --change .
371 $ hg st -C --change .
377 A baz
372 A baz
378 bar
373 bar
379 A qux
374 A qux
380 bar
375 bar
381 $ base=$(hg log -r '.^' -T '{rev}')
376 $ base=$(hg log -r '.^' -T '{rev}')
382 $ hg log -G -T '{rev}:{node|short} {desc}\n' -r $base:
377 $ hg log -G -T '{rev}:{node|short} {desc}\n' -r $base:
383 @ 5:a612dc2edfda copies
378 @ 5:a612dc2edfda copies
384 |
379 |
385 o 4:4800b1f1f38e add dir/
380 o 4:4800b1f1f38e add dir/
386 |
381 |
387 ~
382 ~
388 # Add a dirty change on top to show that it's unaffected
383 # Add a dirty change on top to show that it's unaffected
389 $ echo dirty >> baz
384 $ echo dirty >> baz
390 $ hg st
385 $ hg st
391 M baz
386 M baz
392 $ cat baz
387 $ cat baz
393 bleah
388 bleah
394 dirty
389 dirty
395 $ hg copy --forget --at-rev . baz
390 $ hg copy --forget --at-rev . baz
396 saved backup bundle to $TESTTMP/part2/.hg/strip-backup/a612dc2edfda-e36b4448-uncopy.hg
391 saved backup bundle to $TESTTMP/part2/.hg/strip-backup/a612dc2edfda-e36b4448-uncopy.hg
397 # The unwanted copy is no longer recorded, but the unrelated one is
392 # The unwanted copy is no longer recorded, but the unrelated one is
398 $ hg st -C --change .
393 $ hg st -C --change .
399 A baz
394 A baz
400 A qux
395 A qux
401 bar
396 bar
402 # The old commit is gone and we have updated to the new commit
397 # The old commit is gone and we have updated to the new commit
403 $ hg log -G -T '{rev}:{node|short} {desc}\n' -r $base:
398 $ hg log -G -T '{rev}:{node|short} {desc}\n' -r $base:
404 @ 5:c45090e5effe copies
399 @ 5:c45090e5effe copies
405 |
400 |
406 o 4:4800b1f1f38e add dir/
401 o 4:4800b1f1f38e add dir/
407 |
402 |
408 ~
403 ~
409 # Working copy still has the uncommitted change
404 # Working copy still has the uncommitted change
410 $ hg st
405 $ hg st
411 M baz
406 M baz
412 $ cat baz
407 $ cat baz
413 bleah
408 bleah
414 dirty
409 dirty
415
410
416 $ cd ..
411 $ cd ..
@@ -1,60 +1,50
1 Create an empty repo:
1 Create an empty repo:
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5
5
6 Try some commands:
6 Try some commands:
7
7
8 $ hg log
8 $ hg log
9 $ hg grep wah
9 $ hg grep wah
10 [1]
10 [1]
11 $ hg manifest
11 $ hg manifest
12 $ hg verify
12 $ hg verify -q
13 checking changesets
14 checking manifests
15 crosschecking files in changesets and manifests
16 checking files
17 checked 0 changesets with 0 changes to 0 files
18
13
19 Check the basic files created:
14 Check the basic files created:
20
15
21 $ ls .hg
16 $ ls .hg
22 00changelog.i
17 00changelog.i
23 cache
18 cache
24 requires
19 requires
25 store
20 store
26 wcache
21 wcache
27
22
28 Should be empty (except for the "basic" requires):
23 Should be empty (except for the "basic" requires):
29
24
30 $ ls .hg/store
25 $ ls .hg/store
31 requires
26 requires
32
27
33 Poke at a clone:
28 Poke at a clone:
34
29
35 $ cd ..
30 $ cd ..
36 $ hg clone a b
31 $ hg clone a b
37 updating to branch default
32 updating to branch default
38 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 $ cd b
34 $ cd b
40 $ hg verify
35 $ hg verify -q
41 checking changesets
42 checking manifests
43 crosschecking files in changesets and manifests
44 checking files
45 checked 0 changesets with 0 changes to 0 files
46 $ ls .hg
36 $ ls .hg
47 00changelog.i
37 00changelog.i
48 cache
38 cache
49 dirstate
39 dirstate
50 hgrc
40 hgrc
51 requires
41 requires
52 store
42 store
53 wcache
43 wcache
54
44
55 Should be empty (except for the "basic" requires):
45 Should be empty (except for the "basic" requires):
56
46
57 $ ls .hg/store
47 $ ls .hg/store
58 requires
48 requires
59
49
60 $ cd ..
50 $ cd ..
@@ -1,101 +1,96
1 $ hg init
1 $ hg init
2
2
3 $ echo foo > a
3 $ echo foo > a
4 $ echo foo > b
4 $ echo foo > b
5 $ hg add a b
5 $ hg add a b
6
6
7 $ hg ci -m "test"
7 $ hg ci -m "test"
8
8
9 $ echo blah > a
9 $ echo blah > a
10
10
11 $ hg ci -m "branch a"
11 $ hg ci -m "branch a"
12
12
13 $ hg co 0
13 $ hg co 0
14 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
14 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15
15
16 $ echo blah > b
16 $ echo blah > b
17
17
18 $ hg ci -m "branch b"
18 $ hg ci -m "branch b"
19 created new head
19 created new head
20 $ HGMERGE=true hg merge 1
20 $ HGMERGE=true hg merge 1
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 (branch merge, don't forget to commit)
22 (branch merge, don't forget to commit)
23
23
24 $ hg ci -m "merge b/a -> blah"
24 $ hg ci -m "merge b/a -> blah"
25
25
26 $ hg co 1
26 $ hg co 1
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 $ HGMERGE=true hg merge 2
28 $ HGMERGE=true hg merge 2
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 (branch merge, don't forget to commit)
30 (branch merge, don't forget to commit)
31 $ hg ci -m "merge a/b -> blah"
31 $ hg ci -m "merge a/b -> blah"
32 created new head
32 created new head
33
33
34 $ hg log
34 $ hg log
35 changeset: 4:2ee31f665a86
35 changeset: 4:2ee31f665a86
36 tag: tip
36 tag: tip
37 parent: 1:96155394af80
37 parent: 1:96155394af80
38 parent: 2:92cc4c306b19
38 parent: 2:92cc4c306b19
39 user: test
39 user: test
40 date: Thu Jan 01 00:00:00 1970 +0000
40 date: Thu Jan 01 00:00:00 1970 +0000
41 summary: merge a/b -> blah
41 summary: merge a/b -> blah
42
42
43 changeset: 3:e16a66a37edd
43 changeset: 3:e16a66a37edd
44 parent: 2:92cc4c306b19
44 parent: 2:92cc4c306b19
45 parent: 1:96155394af80
45 parent: 1:96155394af80
46 user: test
46 user: test
47 date: Thu Jan 01 00:00:00 1970 +0000
47 date: Thu Jan 01 00:00:00 1970 +0000
48 summary: merge b/a -> blah
48 summary: merge b/a -> blah
49
49
50 changeset: 2:92cc4c306b19
50 changeset: 2:92cc4c306b19
51 parent: 0:5e0375449e74
51 parent: 0:5e0375449e74
52 user: test
52 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
53 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: branch b
54 summary: branch b
55
55
56 changeset: 1:96155394af80
56 changeset: 1:96155394af80
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: branch a
59 summary: branch a
60
60
61 changeset: 0:5e0375449e74
61 changeset: 0:5e0375449e74
62 user: test
62 user: test
63 date: Thu Jan 01 00:00:00 1970 +0000
63 date: Thu Jan 01 00:00:00 1970 +0000
64 summary: test
64 summary: test
65
65
66 $ hg debugindex --changelog
66 $ hg debugindex --changelog
67 rev linkrev nodeid p1-nodeid p2-nodeid
67 rev linkrev nodeid p1-nodeid p2-nodeid
68 0 0 5e0375449e74 000000000000 000000000000
68 0 0 5e0375449e74 000000000000 000000000000
69 1 1 96155394af80 5e0375449e74 000000000000
69 1 1 96155394af80 5e0375449e74 000000000000
70 2 2 92cc4c306b19 5e0375449e74 000000000000
70 2 2 92cc4c306b19 5e0375449e74 000000000000
71 3 3 e16a66a37edd 92cc4c306b19 96155394af80
71 3 3 e16a66a37edd 92cc4c306b19 96155394af80
72 4 4 2ee31f665a86 96155394af80 92cc4c306b19
72 4 4 2ee31f665a86 96155394af80 92cc4c306b19
73
73
74 revision 1
74 revision 1
75 $ hg manifest --debug 1
75 $ hg manifest --debug 1
76 79d7492df40aa0fa093ec4209be78043c181f094 644 a
76 79d7492df40aa0fa093ec4209be78043c181f094 644 a
77 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 b
77 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 b
78 revision 2
78 revision 2
79 $ hg manifest --debug 2
79 $ hg manifest --debug 2
80 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 a
80 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 a
81 79d7492df40aa0fa093ec4209be78043c181f094 644 b
81 79d7492df40aa0fa093ec4209be78043c181f094 644 b
82 revision 3
82 revision 3
83 $ hg manifest --debug 3
83 $ hg manifest --debug 3
84 79d7492df40aa0fa093ec4209be78043c181f094 644 a
84 79d7492df40aa0fa093ec4209be78043c181f094 644 a
85 79d7492df40aa0fa093ec4209be78043c181f094 644 b
85 79d7492df40aa0fa093ec4209be78043c181f094 644 b
86 revision 4
86 revision 4
87 $ hg manifest --debug 4
87 $ hg manifest --debug 4
88 79d7492df40aa0fa093ec4209be78043c181f094 644 a
88 79d7492df40aa0fa093ec4209be78043c181f094 644 a
89 79d7492df40aa0fa093ec4209be78043c181f094 644 b
89 79d7492df40aa0fa093ec4209be78043c181f094 644 b
90
90
91 $ hg debugindex a
91 $ hg debugindex a
92 rev linkrev nodeid p1-nodeid p2-nodeid
92 rev linkrev nodeid p1-nodeid p2-nodeid
93 0 0 2ed2a3912a0b 000000000000 000000000000
93 0 0 2ed2a3912a0b 000000000000 000000000000
94 1 1 79d7492df40a 2ed2a3912a0b 000000000000
94 1 1 79d7492df40a 2ed2a3912a0b 000000000000
95
95
96 $ hg verify
96 $ hg verify -q
97 checking changesets
98 checking manifests
99 crosschecking files in changesets and manifests
100 checking files
101 checked 5 changesets with 4 changes to 2 files
@@ -1,145 +1,140
1 This test makes sure that we don't mark a file as merged with its ancestor
1 This test makes sure that we don't mark a file as merged with its ancestor
2 when we do a merge.
2 when we do a merge.
3
3
4 $ cat <<EOF > merge
4 $ cat <<EOF > merge
5 > import sys, os
5 > import sys, os
6 > print("merging for", os.path.basename(sys.argv[1]))
6 > print("merging for", os.path.basename(sys.argv[1]))
7 > EOF
7 > EOF
8 $ HGMERGE="\"$PYTHON\" ../merge"; export HGMERGE
8 $ HGMERGE="\"$PYTHON\" ../merge"; export HGMERGE
9
9
10 Creating base:
10 Creating base:
11
11
12 $ hg init a
12 $ hg init a
13 $ cd a
13 $ cd a
14 $ echo 1 > foo
14 $ echo 1 > foo
15 $ echo 1 > bar
15 $ echo 1 > bar
16 $ echo 1 > baz
16 $ echo 1 > baz
17 $ echo 1 > quux
17 $ echo 1 > quux
18 $ hg add foo bar baz quux
18 $ hg add foo bar baz quux
19 $ hg commit -m "base"
19 $ hg commit -m "base"
20
20
21 $ cd ..
21 $ cd ..
22 $ hg clone a b
22 $ hg clone a b
23 updating to branch default
23 updating to branch default
24 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
25
25
26 Creating branch a:
26 Creating branch a:
27
27
28 $ cd a
28 $ cd a
29 $ echo 2a > foo
29 $ echo 2a > foo
30 $ echo 2a > bar
30 $ echo 2a > bar
31 $ hg commit -m "branch a"
31 $ hg commit -m "branch a"
32
32
33 Creating branch b:
33 Creating branch b:
34
34
35 $ cd ..
35 $ cd ..
36 $ cd b
36 $ cd b
37 $ echo 2b > foo
37 $ echo 2b > foo
38 $ echo 2b > baz
38 $ echo 2b > baz
39 $ hg commit -m "branch b"
39 $ hg commit -m "branch b"
40
40
41 We shouldn't have anything but n state here:
41 We shouldn't have anything but n state here:
42
42
43 $ hg debugstate --no-dates | grep -v "^n"
43 $ hg debugstate --no-dates | grep -v "^n"
44 [1]
44 [1]
45
45
46 Merging:
46 Merging:
47
47
48 $ hg pull ../a
48 $ hg pull ../a
49 pulling from ../a
49 pulling from ../a
50 searching for changes
50 searching for changes
51 adding changesets
51 adding changesets
52 adding manifests
52 adding manifests
53 adding file changes
53 adding file changes
54 added 1 changesets with 2 changes to 2 files (+1 heads)
54 added 1 changesets with 2 changes to 2 files (+1 heads)
55 new changesets bdd988058d16
55 new changesets bdd988058d16
56 (run 'hg heads' to see heads, 'hg merge' to merge)
56 (run 'hg heads' to see heads, 'hg merge' to merge)
57
57
58 $ hg merge -v
58 $ hg merge -v
59 resolving manifests
59 resolving manifests
60 getting bar
60 getting bar
61 merging foo
61 merging foo
62 merging for foo
62 merging for foo
63 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
63 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
64 (branch merge, don't forget to commit)
64 (branch merge, don't forget to commit)
65
65
66 $ echo 2m > foo
66 $ echo 2m > foo
67 $ echo 2b > baz
67 $ echo 2b > baz
68 $ echo new > quux
68 $ echo new > quux
69
69
70 $ hg ci -m "merge"
70 $ hg ci -m "merge"
71
71
72 main: we should have a merge here:
72 main: we should have a merge here:
73
73
74 $ hg debugindex --changelog
74 $ hg debugindex --changelog
75 rev linkrev nodeid p1-nodeid p2-nodeid
75 rev linkrev nodeid p1-nodeid p2-nodeid
76 0 0 cdca01651b96 000000000000 000000000000
76 0 0 cdca01651b96 000000000000 000000000000
77 1 1 f6718a9cb7f3 cdca01651b96 000000000000
77 1 1 f6718a9cb7f3 cdca01651b96 000000000000
78 2 2 bdd988058d16 cdca01651b96 000000000000
78 2 2 bdd988058d16 cdca01651b96 000000000000
79 3 3 d8a521142a3c f6718a9cb7f3 bdd988058d16
79 3 3 d8a521142a3c f6718a9cb7f3 bdd988058d16
80
80
81 log should show foo and quux changed:
81 log should show foo and quux changed:
82
82
83 $ hg log -v -r tip
83 $ hg log -v -r tip
84 changeset: 3:d8a521142a3c
84 changeset: 3:d8a521142a3c
85 tag: tip
85 tag: tip
86 parent: 1:f6718a9cb7f3
86 parent: 1:f6718a9cb7f3
87 parent: 2:bdd988058d16
87 parent: 2:bdd988058d16
88 user: test
88 user: test
89 date: Thu Jan 01 00:00:00 1970 +0000
89 date: Thu Jan 01 00:00:00 1970 +0000
90 files: foo quux
90 files: foo quux
91 description:
91 description:
92 merge
92 merge
93
93
94
94
95
95
96 foo: we should have a merge here:
96 foo: we should have a merge here:
97
97
98 $ hg debugindex foo
98 $ hg debugindex foo
99 rev linkrev nodeid p1-nodeid p2-nodeid
99 rev linkrev nodeid p1-nodeid p2-nodeid
100 0 0 b8e02f643373 000000000000 000000000000
100 0 0 b8e02f643373 000000000000 000000000000
101 1 1 2ffeddde1b65 b8e02f643373 000000000000
101 1 1 2ffeddde1b65 b8e02f643373 000000000000
102 2 2 33d1fb69067a b8e02f643373 000000000000
102 2 2 33d1fb69067a b8e02f643373 000000000000
103 3 3 aa27919ee430 2ffeddde1b65 33d1fb69067a
103 3 3 aa27919ee430 2ffeddde1b65 33d1fb69067a
104
104
105 bar: we should not have a merge here:
105 bar: we should not have a merge here:
106
106
107 $ hg debugindex bar
107 $ hg debugindex bar
108 rev linkrev nodeid p1-nodeid p2-nodeid
108 rev linkrev nodeid p1-nodeid p2-nodeid
109 0 0 b8e02f643373 000000000000 000000000000
109 0 0 b8e02f643373 000000000000 000000000000
110 1 2 33d1fb69067a b8e02f643373 000000000000
110 1 2 33d1fb69067a b8e02f643373 000000000000
111
111
112 baz: we should not have a merge here:
112 baz: we should not have a merge here:
113
113
114 $ hg debugindex baz
114 $ hg debugindex baz
115 rev linkrev nodeid p1-nodeid p2-nodeid
115 rev linkrev nodeid p1-nodeid p2-nodeid
116 0 0 b8e02f643373 000000000000 000000000000
116 0 0 b8e02f643373 000000000000 000000000000
117 1 1 2ffeddde1b65 b8e02f643373 000000000000
117 1 1 2ffeddde1b65 b8e02f643373 000000000000
118
118
119 quux: we should not have a merge here:
119 quux: we should not have a merge here:
120
120
121 $ hg debugindex quux
121 $ hg debugindex quux
122 rev linkrev nodeid p1-nodeid p2-nodeid
122 rev linkrev nodeid p1-nodeid p2-nodeid
123 0 0 b8e02f643373 000000000000 000000000000
123 0 0 b8e02f643373 000000000000 000000000000
124 1 3 6128c0f33108 b8e02f643373 000000000000
124 1 3 6128c0f33108 b8e02f643373 000000000000
125
125
126 Manifest entries should match tips of all files:
126 Manifest entries should match tips of all files:
127
127
128 $ hg manifest --debug
128 $ hg manifest --debug
129 33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar
129 33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar
130 2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz
130 2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz
131 aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo
131 aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo
132 6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux
132 6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux
133
133
134 Everything should be clean now:
134 Everything should be clean now:
135
135
136 $ hg status
136 $ hg status
137
137
138 $ hg verify
138 $ hg verify -q
139 checking changesets
140 checking manifests
141 crosschecking files in changesets and manifests
142 checking files
143 checked 4 changesets with 10 changes to 4 files
144
139
145 $ cd ..
140 $ cd ..
@@ -1,545 +1,535
1 #require repofncache
1 #require repofncache
2
2
3 An extension which will set fncache chunksize to 1 byte to make sure that logic
3 An extension which will set fncache chunksize to 1 byte to make sure that logic
4 does not break
4 does not break
5
5
6 $ cat > chunksize.py <<EOF
6 $ cat > chunksize.py <<EOF
7 > from mercurial import store
7 > from mercurial import store
8 > store.fncache_chunksize = 1
8 > store.fncache_chunksize = 1
9 > EOF
9 > EOF
10
10
11 $ cat >> $HGRCPATH <<EOF
11 $ cat >> $HGRCPATH <<EOF
12 > [extensions]
12 > [extensions]
13 > chunksize = $TESTTMP/chunksize.py
13 > chunksize = $TESTTMP/chunksize.py
14 > EOF
14 > EOF
15
15
16 Init repo1:
16 Init repo1:
17
17
18 $ hg init repo1
18 $ hg init repo1
19 $ cd repo1
19 $ cd repo1
20 $ echo "some text" > a
20 $ echo "some text" > a
21 $ hg add
21 $ hg add
22 adding a
22 adding a
23 $ hg ci -m first
23 $ hg ci -m first
24 $ cat .hg/store/fncache | sort
24 $ cat .hg/store/fncache | sort
25 data/a.i
25 data/a.i
26
26
27 Testing a.i/b:
27 Testing a.i/b:
28
28
29 $ mkdir a.i
29 $ mkdir a.i
30 $ echo "some other text" > a.i/b
30 $ echo "some other text" > a.i/b
31 $ hg add
31 $ hg add
32 adding a.i/b
32 adding a.i/b
33 $ hg ci -m second
33 $ hg ci -m second
34 $ cat .hg/store/fncache | sort
34 $ cat .hg/store/fncache | sort
35 data/a.i
35 data/a.i
36 data/a.i.hg/b.i
36 data/a.i.hg/b.i
37
37
38 Testing a.i.hg/c:
38 Testing a.i.hg/c:
39
39
40 $ mkdir a.i.hg
40 $ mkdir a.i.hg
41 $ echo "yet another text" > a.i.hg/c
41 $ echo "yet another text" > a.i.hg/c
42 $ hg add
42 $ hg add
43 adding a.i.hg/c
43 adding a.i.hg/c
44 $ hg ci -m third
44 $ hg ci -m third
45 $ cat .hg/store/fncache | sort
45 $ cat .hg/store/fncache | sort
46 data/a.i
46 data/a.i
47 data/a.i.hg.hg/c.i
47 data/a.i.hg.hg/c.i
48 data/a.i.hg/b.i
48 data/a.i.hg/b.i
49
49
50 Testing verify:
50 Testing verify:
51
51
52 $ hg verify
52 $ hg verify -q
53 checking changesets
54 checking manifests
55 crosschecking files in changesets and manifests
56 checking files
57 checked 3 changesets with 3 changes to 3 files
58
53
59 $ rm .hg/store/fncache
54 $ rm .hg/store/fncache
60
55
61 $ hg verify
56 $ hg verify
62 checking changesets
57 checking changesets
63 checking manifests
58 checking manifests
64 crosschecking files in changesets and manifests
59 crosschecking files in changesets and manifests
65 checking files
60 checking files
66 warning: revlog 'data/a.i' not in fncache!
61 warning: revlog 'data/a.i' not in fncache!
67 warning: revlog 'data/a.i.hg/c.i' not in fncache!
62 warning: revlog 'data/a.i.hg/c.i' not in fncache!
68 warning: revlog 'data/a.i/b.i' not in fncache!
63 warning: revlog 'data/a.i/b.i' not in fncache!
69 checked 3 changesets with 3 changes to 3 files
64 checked 3 changesets with 3 changes to 3 files
70 3 warnings encountered!
65 3 warnings encountered!
71 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
66 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
72
67
73 Follow the hint to make sure it works
68 Follow the hint to make sure it works
74
69
75 $ hg debugrebuildfncache
70 $ hg debugrebuildfncache
76 adding data/a.i
71 adding data/a.i
77 adding data/a.i.hg/c.i
72 adding data/a.i.hg/c.i
78 adding data/a.i/b.i
73 adding data/a.i/b.i
79 3 items added, 0 removed from fncache
74 3 items added, 0 removed from fncache
80
75
81 $ hg verify
76 $ hg verify -q
82 checking changesets
83 checking manifests
84 crosschecking files in changesets and manifests
85 checking files
86 checked 3 changesets with 3 changes to 3 files
87
77
88 $ cd ..
78 $ cd ..
89
79
90 Non store repo:
80 Non store repo:
91
81
92 $ hg --config format.usestore=False init foo
82 $ hg --config format.usestore=False init foo
93 $ cd foo
83 $ cd foo
94 $ mkdir tst.d
84 $ mkdir tst.d
95 $ echo foo > tst.d/foo
85 $ echo foo > tst.d/foo
96 $ hg ci -Amfoo
86 $ hg ci -Amfoo
97 adding tst.d/foo
87 adding tst.d/foo
98 $ find .hg | sort
88 $ find .hg | sort
99 .hg
89 .hg
100 .hg/00changelog.i
90 .hg/00changelog.i
101 .hg/00manifest.i
91 .hg/00manifest.i
102 .hg/cache
92 .hg/cache
103 .hg/cache/branch2-served
93 .hg/cache/branch2-served
104 .hg/cache/rbc-names-v1
94 .hg/cache/rbc-names-v1
105 .hg/cache/rbc-revs-v1
95 .hg/cache/rbc-revs-v1
106 .hg/data
96 .hg/data
107 .hg/data/tst.d.hg
97 .hg/data/tst.d.hg
108 .hg/data/tst.d.hg/foo.i
98 .hg/data/tst.d.hg/foo.i
109 .hg/dirstate
99 .hg/dirstate
110 .hg/fsmonitor.state (fsmonitor !)
100 .hg/fsmonitor.state (fsmonitor !)
111 .hg/last-message.txt
101 .hg/last-message.txt
112 .hg/phaseroots
102 .hg/phaseroots
113 .hg/requires
103 .hg/requires
114 .hg/undo
104 .hg/undo
115 .hg/undo.backup.dirstate
105 .hg/undo.backup.dirstate
116 .hg/undo.backupfiles
106 .hg/undo.backupfiles
117 .hg/undo.bookmarks
107 .hg/undo.bookmarks
118 .hg/undo.branch
108 .hg/undo.branch
119 .hg/undo.desc
109 .hg/undo.desc
120 .hg/undo.dirstate
110 .hg/undo.dirstate
121 .hg/undo.phaseroots
111 .hg/undo.phaseroots
122 .hg/wcache
112 .hg/wcache
123 .hg/wcache/checkisexec (execbit !)
113 .hg/wcache/checkisexec (execbit !)
124 .hg/wcache/checklink (symlink !)
114 .hg/wcache/checklink (symlink !)
125 .hg/wcache/checklink-target (symlink !)
115 .hg/wcache/checklink-target (symlink !)
126 .hg/wcache/manifestfulltextcache (reporevlogstore !)
116 .hg/wcache/manifestfulltextcache (reporevlogstore !)
127 $ cd ..
117 $ cd ..
128
118
129 Non fncache repo:
119 Non fncache repo:
130
120
131 $ hg --config format.usefncache=False init bar
121 $ hg --config format.usefncache=False init bar
132 $ cd bar
122 $ cd bar
133 $ mkdir tst.d
123 $ mkdir tst.d
134 $ echo foo > tst.d/Foo
124 $ echo foo > tst.d/Foo
135 $ hg ci -Amfoo
125 $ hg ci -Amfoo
136 adding tst.d/Foo
126 adding tst.d/Foo
137 $ find .hg | sort
127 $ find .hg | sort
138 .hg
128 .hg
139 .hg/00changelog.i
129 .hg/00changelog.i
140 .hg/cache
130 .hg/cache
141 .hg/cache/branch2-served
131 .hg/cache/branch2-served
142 .hg/cache/rbc-names-v1
132 .hg/cache/rbc-names-v1
143 .hg/cache/rbc-revs-v1
133 .hg/cache/rbc-revs-v1
144 .hg/dirstate
134 .hg/dirstate
145 .hg/fsmonitor.state (fsmonitor !)
135 .hg/fsmonitor.state (fsmonitor !)
146 .hg/last-message.txt
136 .hg/last-message.txt
147 .hg/requires
137 .hg/requires
148 .hg/store
138 .hg/store
149 .hg/store/00changelog.i
139 .hg/store/00changelog.i
150 .hg/store/00manifest.i
140 .hg/store/00manifest.i
151 .hg/store/data
141 .hg/store/data
152 .hg/store/data/tst.d.hg
142 .hg/store/data/tst.d.hg
153 .hg/store/data/tst.d.hg/_foo.i
143 .hg/store/data/tst.d.hg/_foo.i
154 .hg/store/phaseroots
144 .hg/store/phaseroots
155 .hg/store/requires
145 .hg/store/requires
156 .hg/store/undo
146 .hg/store/undo
157 .hg/store/undo.backupfiles
147 .hg/store/undo.backupfiles
158 .hg/store/undo.phaseroots
148 .hg/store/undo.phaseroots
159 .hg/undo.backup.dirstate
149 .hg/undo.backup.dirstate
160 .hg/undo.bookmarks
150 .hg/undo.bookmarks
161 .hg/undo.branch
151 .hg/undo.branch
162 .hg/undo.desc
152 .hg/undo.desc
163 .hg/undo.dirstate
153 .hg/undo.dirstate
164 .hg/wcache
154 .hg/wcache
165 .hg/wcache/checkisexec (execbit !)
155 .hg/wcache/checkisexec (execbit !)
166 .hg/wcache/checklink (symlink !)
156 .hg/wcache/checklink (symlink !)
167 .hg/wcache/checklink-target (symlink !)
157 .hg/wcache/checklink-target (symlink !)
168 .hg/wcache/manifestfulltextcache (reporevlogstore !)
158 .hg/wcache/manifestfulltextcache (reporevlogstore !)
169 $ cd ..
159 $ cd ..
170
160
171 Encoding of reserved / long paths in the store
161 Encoding of reserved / long paths in the store
172
162
173 $ hg init r2
163 $ hg init r2
174 $ cd r2
164 $ cd r2
175 $ cat <<EOF > .hg/hgrc
165 $ cat <<EOF > .hg/hgrc
176 > [ui]
166 > [ui]
177 > portablefilenames = ignore
167 > portablefilenames = ignore
178 > EOF
168 > EOF
179
169
180 $ hg import -q --bypass - <<EOF
170 $ hg import -q --bypass - <<EOF
181 > # HG changeset patch
171 > # HG changeset patch
182 > # User test
172 > # User test
183 > # Date 0 0
173 > # Date 0 0
184 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
174 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
185 > # Parent 0000000000000000000000000000000000000000
175 > # Parent 0000000000000000000000000000000000000000
186 > 1
176 > 1
187 >
177 >
188 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
178 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
189 > new file mode 100644
179 > new file mode 100644
190 > --- /dev/null
180 > --- /dev/null
191 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
181 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
192 > @@ -0,0 +1,1 @@
182 > @@ -0,0 +1,1 @@
193 > +foo
183 > +foo
194 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
184 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
195 > new file mode 100644
185 > new file mode 100644
196 > --- /dev/null
186 > --- /dev/null
197 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
187 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
198 > @@ -0,0 +1,1 @@
188 > @@ -0,0 +1,1 @@
199 > +foo
189 > +foo
200 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
190 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
201 > new file mode 100644
191 > new file mode 100644
202 > --- /dev/null
192 > --- /dev/null
203 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
193 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
204 > @@ -0,0 +1,1 @@
194 > @@ -0,0 +1,1 @@
205 > +foo
195 > +foo
206 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
196 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
207 > new file mode 100644
197 > new file mode 100644
208 > --- /dev/null
198 > --- /dev/null
209 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
199 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
210 > @@ -0,0 +1,1 @@
200 > @@ -0,0 +1,1 @@
211 > +foo
201 > +foo
212 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
202 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
213 > new file mode 100644
203 > new file mode 100644
214 > --- /dev/null
204 > --- /dev/null
215 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
205 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
216 > @@ -0,0 +1,1 @@
206 > @@ -0,0 +1,1 @@
217 > +foo
207 > +foo
218 > EOF
208 > EOF
219
209
220 $ find .hg/store -name *.i | sort
210 $ find .hg/store -name *.i | sort
221 .hg/store/00changelog.i
211 .hg/store/00changelog.i
222 .hg/store/00manifest.i
212 .hg/store/00manifest.i
223 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
213 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
224 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
214 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
225 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
215 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
226 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
216 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
227 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
217 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
228
218
229 $ cd ..
219 $ cd ..
230
220
231 Aborting lock does not prevent fncache writes
221 Aborting lock does not prevent fncache writes
232
222
233 $ cat > exceptionext.py <<EOF
223 $ cat > exceptionext.py <<EOF
234 > import os
224 > import os
235 > from mercurial import commands, error, extensions
225 > from mercurial import commands, error, extensions
236 >
226 >
237 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
227 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
238 > def releasewrap():
228 > def releasewrap():
239 > l.held = False # ensure __del__ is a noop
229 > l.held = False # ensure __del__ is a noop
240 > raise error.Abort(b"forced lock failure")
230 > raise error.Abort(b"forced lock failure")
241 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
231 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
242 > return l
232 > return l
243 >
233 >
244 > def reposetup(ui, repo):
234 > def reposetup(ui, repo):
245 > extensions.wrapfunction(repo, '_lock', lockexception)
235 > extensions.wrapfunction(repo, '_lock', lockexception)
246 >
236 >
247 > cmdtable = {}
237 > cmdtable = {}
248 >
238 >
249 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
239 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
250 > # at the end of dispatching (for intentional "forced lcok failure")
240 > # at the end of dispatching (for intentional "forced lcok failure")
251 > def commitwrap(orig, ui, repo, *pats, **opts):
241 > def commitwrap(orig, ui, repo, *pats, **opts):
252 > repo = repo.unfiltered() # to use replaced repo._lock certainly
242 > repo = repo.unfiltered() # to use replaced repo._lock certainly
253 > wlock = repo.wlock()
243 > wlock = repo.wlock()
254 > try:
244 > try:
255 > return orig(ui, repo, *pats, **opts)
245 > return orig(ui, repo, *pats, **opts)
256 > finally:
246 > finally:
257 > # multiple 'relase()' is needed for complete releasing wlock,
247 > # multiple 'relase()' is needed for complete releasing wlock,
258 > # because "forced" abort at last releasing store lock
248 > # because "forced" abort at last releasing store lock
259 > # prevents wlock from being released at same 'lockmod.release()'
249 > # prevents wlock from being released at same 'lockmod.release()'
260 > for i in range(wlock.held):
250 > for i in range(wlock.held):
261 > wlock.release()
251 > wlock.release()
262 >
252 >
263 > def extsetup(ui):
253 > def extsetup(ui):
264 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
254 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
265 > EOF
255 > EOF
266 $ extpath=`pwd`/exceptionext.py
256 $ extpath=`pwd`/exceptionext.py
267 $ hg init fncachetxn
257 $ hg init fncachetxn
268 $ cd fncachetxn
258 $ cd fncachetxn
269 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
259 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
270 $ touch y
260 $ touch y
271 $ hg ci -qAm y
261 $ hg ci -qAm y
272 abort: forced lock failure
262 abort: forced lock failure
273 [255]
263 [255]
274 $ cat .hg/store/fncache
264 $ cat .hg/store/fncache
275 data/y.i
265 data/y.i
276
266
277 Aborting transaction prevents fncache change
267 Aborting transaction prevents fncache change
278
268
279 $ cat > ../exceptionext.py <<EOF
269 $ cat > ../exceptionext.py <<EOF
280 > import os
270 > import os
281 > from mercurial import commands, error, extensions, localrepo
271 > from mercurial import commands, error, extensions, localrepo
282 >
272 >
283 > def wrapper(orig, self, *args, **kwargs):
273 > def wrapper(orig, self, *args, **kwargs):
284 > tr = orig(self, *args, **kwargs)
274 > tr = orig(self, *args, **kwargs)
285 > def fail(tr):
275 > def fail(tr):
286 > raise error.Abort(b"forced transaction failure")
276 > raise error.Abort(b"forced transaction failure")
287 > # zzz prefix to ensure it sorted after store.write
277 > # zzz prefix to ensure it sorted after store.write
288 > tr.addfinalize(b'zzz-forcefails', fail)
278 > tr.addfinalize(b'zzz-forcefails', fail)
289 > return tr
279 > return tr
290 >
280 >
291 > def uisetup(ui):
281 > def uisetup(ui):
292 > extensions.wrapfunction(
282 > extensions.wrapfunction(
293 > localrepo.localrepository, b'transaction', wrapper)
283 > localrepo.localrepository, b'transaction', wrapper)
294 >
284 >
295 > cmdtable = {}
285 > cmdtable = {}
296 >
286 >
297 > EOF
287 > EOF
298
288
299 Clean cached version
289 Clean cached version
300 $ rm -f "${extpath}c"
290 $ rm -f "${extpath}c"
301 $ rm -Rf "`dirname $extpath`/__pycache__"
291 $ rm -Rf "`dirname $extpath`/__pycache__"
302
292
303 $ touch z
293 $ touch z
304 $ hg ci -qAm z
294 $ hg ci -qAm z
305 transaction abort!
295 transaction abort!
306 rollback completed
296 rollback completed
307 abort: forced transaction failure
297 abort: forced transaction failure
308 [255]
298 [255]
309 $ cat .hg/store/fncache
299 $ cat .hg/store/fncache
310 data/y.i
300 data/y.i
311
301
312 Aborted transactions can be recovered later
302 Aborted transactions can be recovered later
313
303
314 $ cat > ../exceptionext.py <<EOF
304 $ cat > ../exceptionext.py <<EOF
315 > import os
305 > import os
316 > from mercurial import (
306 > from mercurial import (
317 > commands,
307 > commands,
318 > error,
308 > error,
319 > extensions,
309 > extensions,
320 > localrepo,
310 > localrepo,
321 > transaction,
311 > transaction,
322 > )
312 > )
323 >
313 >
324 > def trwrapper(orig, self, *args, **kwargs):
314 > def trwrapper(orig, self, *args, **kwargs):
325 > tr = orig(self, *args, **kwargs)
315 > tr = orig(self, *args, **kwargs)
326 > def fail(tr):
316 > def fail(tr):
327 > raise error.Abort(b"forced transaction failure")
317 > raise error.Abort(b"forced transaction failure")
328 > # zzz prefix to ensure it sorted after store.write
318 > # zzz prefix to ensure it sorted after store.write
329 > tr.addfinalize(b'zzz-forcefails', fail)
319 > tr.addfinalize(b'zzz-forcefails', fail)
330 > return tr
320 > return tr
331 >
321 >
332 > def abortwrapper(orig, self, *args, **kwargs):
322 > def abortwrapper(orig, self, *args, **kwargs):
333 > raise error.Abort(b"forced transaction failure")
323 > raise error.Abort(b"forced transaction failure")
334 >
324 >
335 > def uisetup(ui):
325 > def uisetup(ui):
336 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
326 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
337 > trwrapper)
327 > trwrapper)
338 > extensions.wrapfunction(transaction.transaction, '_abort',
328 > extensions.wrapfunction(transaction.transaction, '_abort',
339 > abortwrapper)
329 > abortwrapper)
340 >
330 >
341 > cmdtable = {}
331 > cmdtable = {}
342 >
332 >
343 > EOF
333 > EOF
344
334
345 Clean cached versions
335 Clean cached versions
346 $ rm -f "${extpath}c"
336 $ rm -f "${extpath}c"
347 $ rm -Rf "`dirname $extpath`/__pycache__"
337 $ rm -Rf "`dirname $extpath`/__pycache__"
348
338
349 $ hg up -q 1
339 $ hg up -q 1
350 $ touch z
340 $ touch z
351 $ hg ci -qAm z 2>/dev/null
341 $ hg ci -qAm z 2>/dev/null
352 [255]
342 [255]
353 $ cat .hg/store/fncache | sort
343 $ cat .hg/store/fncache | sort
354 data/y.i
344 data/y.i
355 data/z.i
345 data/z.i
356 $ hg recover --verify
346 $ hg recover --verify
357 rolling back interrupted transaction
347 rolling back interrupted transaction
358 checking changesets
348 checking changesets
359 checking manifests
349 checking manifests
360 crosschecking files in changesets and manifests
350 crosschecking files in changesets and manifests
361 checking files
351 checking files
362 checked 1 changesets with 1 changes to 1 files
352 checked 1 changesets with 1 changes to 1 files
363 $ cat .hg/store/fncache
353 $ cat .hg/store/fncache
364 data/y.i
354 data/y.i
365
355
366 $ cd ..
356 $ cd ..
367
357
368 debugrebuildfncache does nothing unless repo has fncache requirement
358 debugrebuildfncache does nothing unless repo has fncache requirement
369
359
370 $ hg --config format.usefncache=false init nofncache
360 $ hg --config format.usefncache=false init nofncache
371 $ cd nofncache
361 $ cd nofncache
372 $ hg debugrebuildfncache
362 $ hg debugrebuildfncache
373 (not rebuilding fncache because repository does not support fncache)
363 (not rebuilding fncache because repository does not support fncache)
374
364
375 $ cd ..
365 $ cd ..
376
366
377 debugrebuildfncache works on empty repository
367 debugrebuildfncache works on empty repository
378
368
379 $ hg init empty
369 $ hg init empty
380 $ cd empty
370 $ cd empty
381 $ hg debugrebuildfncache
371 $ hg debugrebuildfncache
382 fncache already up to date
372 fncache already up to date
383 $ cd ..
373 $ cd ..
384
374
385 debugrebuildfncache on an up to date repository no-ops
375 debugrebuildfncache on an up to date repository no-ops
386
376
387 $ hg init repo
377 $ hg init repo
388 $ cd repo
378 $ cd repo
389 $ echo initial > foo
379 $ echo initial > foo
390 $ echo initial > .bar
380 $ echo initial > .bar
391 $ hg commit -A -m initial
381 $ hg commit -A -m initial
392 adding .bar
382 adding .bar
393 adding foo
383 adding foo
394
384
395 $ cat .hg/store/fncache | sort
385 $ cat .hg/store/fncache | sort
396 data/.bar.i
386 data/.bar.i
397 data/foo.i
387 data/foo.i
398
388
399 $ hg debugrebuildfncache
389 $ hg debugrebuildfncache
400 fncache already up to date
390 fncache already up to date
401
391
402 debugrebuildfncache restores deleted fncache file
392 debugrebuildfncache restores deleted fncache file
403
393
404 $ rm -f .hg/store/fncache
394 $ rm -f .hg/store/fncache
405 $ hg debugrebuildfncache
395 $ hg debugrebuildfncache
406 adding data/.bar.i
396 adding data/.bar.i
407 adding data/foo.i
397 adding data/foo.i
408 2 items added, 0 removed from fncache
398 2 items added, 0 removed from fncache
409
399
410 $ cat .hg/store/fncache | sort
400 $ cat .hg/store/fncache | sort
411 data/.bar.i
401 data/.bar.i
412 data/foo.i
402 data/foo.i
413
403
414 Rebuild after rebuild should no-op
404 Rebuild after rebuild should no-op
415
405
416 $ hg debugrebuildfncache
406 $ hg debugrebuildfncache
417 fncache already up to date
407 fncache already up to date
418
408
419 A single missing file should get restored, an extra file should be removed
409 A single missing file should get restored, an extra file should be removed
420
410
421 $ cat > .hg/store/fncache << EOF
411 $ cat > .hg/store/fncache << EOF
422 > data/foo.i
412 > data/foo.i
423 > data/bad-entry.i
413 > data/bad-entry.i
424 > EOF
414 > EOF
425
415
426 $ hg debugrebuildfncache
416 $ hg debugrebuildfncache
427 removing data/bad-entry.i
417 removing data/bad-entry.i
428 adding data/.bar.i
418 adding data/.bar.i
429 1 items added, 1 removed from fncache
419 1 items added, 1 removed from fncache
430
420
431 $ cat .hg/store/fncache | sort
421 $ cat .hg/store/fncache | sort
432 data/.bar.i
422 data/.bar.i
433 data/foo.i
423 data/foo.i
434
424
435 debugrebuildfncache recovers from truncated line in fncache
425 debugrebuildfncache recovers from truncated line in fncache
436
426
437 $ printf a > .hg/store/fncache
427 $ printf a > .hg/store/fncache
438 $ hg debugrebuildfncache
428 $ hg debugrebuildfncache
439 fncache does not ends with a newline
429 fncache does not ends with a newline
440 adding data/.bar.i
430 adding data/.bar.i
441 adding data/foo.i
431 adding data/foo.i
442 2 items added, 0 removed from fncache
432 2 items added, 0 removed from fncache
443
433
444 $ cat .hg/store/fncache | sort
434 $ cat .hg/store/fncache | sort
445 data/.bar.i
435 data/.bar.i
446 data/foo.i
436 data/foo.i
447
437
448 $ cd ..
438 $ cd ..
449
439
450 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
440 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
451
441
452 $ hg --config format.dotencode=false init nodotencode
442 $ hg --config format.dotencode=false init nodotencode
453 $ cd nodotencode
443 $ cd nodotencode
454 $ echo initial > foo
444 $ echo initial > foo
455 $ echo initial > .bar
445 $ echo initial > .bar
456 $ hg commit -A -m initial
446 $ hg commit -A -m initial
457 adding .bar
447 adding .bar
458 adding foo
448 adding foo
459
449
460 $ cat .hg/store/fncache | sort
450 $ cat .hg/store/fncache | sort
461 data/.bar.i
451 data/.bar.i
462 data/foo.i
452 data/foo.i
463
453
464 $ rm .hg/store/fncache
454 $ rm .hg/store/fncache
465 $ hg debugrebuildfncache
455 $ hg debugrebuildfncache
466 adding data/.bar.i
456 adding data/.bar.i
467 adding data/foo.i
457 adding data/foo.i
468 2 items added, 0 removed from fncache
458 2 items added, 0 removed from fncache
469
459
470 $ cat .hg/store/fncache | sort
460 $ cat .hg/store/fncache | sort
471 data/.bar.i
461 data/.bar.i
472 data/foo.i
462 data/foo.i
473
463
474 $ cd ..
464 $ cd ..
475
465
476 In repositories that have accumulated a large number of files over time, the
466 In repositories that have accumulated a large number of files over time, the
477 fncache file is going to be large. If we possibly can avoid loading it, so much the better.
467 fncache file is going to be large. If we possibly can avoid loading it, so much the better.
478 The cache should not loaded when committing changes to existing files, or when unbundling
468 The cache should not loaded when committing changes to existing files, or when unbundling
479 changesets that only contain changes to existing files:
469 changesets that only contain changes to existing files:
480
470
481 $ cat > fncacheloadwarn.py << EOF
471 $ cat > fncacheloadwarn.py << EOF
482 > from mercurial import extensions, localrepo
472 > from mercurial import extensions, localrepo
483 >
473 >
484 > def extsetup(ui):
474 > def extsetup(ui):
485 > def wrapstore(orig, requirements, *args):
475 > def wrapstore(orig, requirements, *args):
486 > store = orig(requirements, *args)
476 > store = orig(requirements, *args)
487 > if b'store' in requirements and b'fncache' in requirements:
477 > if b'store' in requirements and b'fncache' in requirements:
488 > instrumentfncachestore(store, ui)
478 > instrumentfncachestore(store, ui)
489 > return store
479 > return store
490 > extensions.wrapfunction(localrepo, 'makestore', wrapstore)
480 > extensions.wrapfunction(localrepo, 'makestore', wrapstore)
491 >
481 >
492 > def instrumentfncachestore(fncachestore, ui):
482 > def instrumentfncachestore(fncachestore, ui):
493 > class instrumentedfncache(type(fncachestore.fncache)):
483 > class instrumentedfncache(type(fncachestore.fncache)):
494 > def _load(self):
484 > def _load(self):
495 > ui.warn(b'fncache load triggered!\n')
485 > ui.warn(b'fncache load triggered!\n')
496 > super(instrumentedfncache, self)._load()
486 > super(instrumentedfncache, self)._load()
497 > fncachestore.fncache.__class__ = instrumentedfncache
487 > fncachestore.fncache.__class__ = instrumentedfncache
498 > EOF
488 > EOF
499
489
500 $ fncachextpath=`pwd`/fncacheloadwarn.py
490 $ fncachextpath=`pwd`/fncacheloadwarn.py
501 $ hg init nofncacheload
491 $ hg init nofncacheload
502 $ cd nofncacheload
492 $ cd nofncacheload
503 $ printf "[extensions]\nfncacheloadwarn=$fncachextpath\n" >> .hg/hgrc
493 $ printf "[extensions]\nfncacheloadwarn=$fncachextpath\n" >> .hg/hgrc
504
494
505 A new file should trigger a load, as we'd want to update the fncache set in that case:
495 A new file should trigger a load, as we'd want to update the fncache set in that case:
506
496
507 $ touch foo
497 $ touch foo
508 $ hg ci -qAm foo
498 $ hg ci -qAm foo
509 fncache load triggered!
499 fncache load triggered!
510
500
511 But modifying that file should not:
501 But modifying that file should not:
512
502
513 $ echo bar >> foo
503 $ echo bar >> foo
514 $ hg ci -qm foo
504 $ hg ci -qm foo
515
505
516 If a transaction has been aborted, the zero-size truncated index file will
506 If a transaction has been aborted, the zero-size truncated index file will
517 not prevent the fncache from being loaded; rather than actually abort
507 not prevent the fncache from being loaded; rather than actually abort
518 a transaction, we simulate the situation by creating a zero-size index file:
508 a transaction, we simulate the situation by creating a zero-size index file:
519
509
520 $ touch .hg/store/data/bar.i
510 $ touch .hg/store/data/bar.i
521 $ touch bar
511 $ touch bar
522 $ hg ci -qAm bar
512 $ hg ci -qAm bar
523 fncache load triggered!
513 fncache load triggered!
524
514
525 Unbundling should follow the same rules; existing files should not cause a load:
515 Unbundling should follow the same rules; existing files should not cause a load:
526
516
527 (loading during the clone is expected)
517 (loading during the clone is expected)
528 $ hg clone -q . tobundle
518 $ hg clone -q . tobundle
529 fncache load triggered!
519 fncache load triggered!
530 fncache load triggered!
520 fncache load triggered!
531
521
532 $ echo 'new line' > tobundle/bar
522 $ echo 'new line' > tobundle/bar
533 $ hg -R tobundle ci -qm bar
523 $ hg -R tobundle ci -qm bar
534 $ hg -R tobundle bundle -q barupdated.hg
524 $ hg -R tobundle bundle -q barupdated.hg
535 $ hg unbundle -q barupdated.hg
525 $ hg unbundle -q barupdated.hg
536
526
537 but adding new files should:
527 but adding new files should:
538
528
539 $ touch tobundle/newfile
529 $ touch tobundle/newfile
540 $ hg -R tobundle ci -qAm newfile
530 $ hg -R tobundle ci -qAm newfile
541 $ hg -R tobundle bundle -q newfile.hg
531 $ hg -R tobundle bundle -q newfile.hg
542 $ hg unbundle -q newfile.hg
532 $ hg unbundle -q newfile.hg
543 fncache load triggered!
533 fncache load triggered!
544
534
545 $ cd ..
535 $ cd ..
@@ -1,452 +1,441
1 #require hardlink reporevlogstore
1 #require hardlink reporevlogstore
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > import sys
4 > import sys
5 > from mercurial import pycompat, util
5 > from mercurial import pycompat, util
6 > for f in sorted(sys.stdin.readlines()):
6 > for f in sorted(sys.stdin.readlines()):
7 > f = f[:-1]
7 > f = f[:-1]
8 > print(util.nlinks(pycompat.fsencode(f)), f)
8 > print(util.nlinks(pycompat.fsencode(f)), f)
9 > EOF
9 > EOF
10
10
11 $ nlinksdir()
11 $ nlinksdir()
12 > {
12 > {
13 > find "$@" -type f | "$PYTHON" $TESTTMP/nlinks.py
13 > find "$@" -type f | "$PYTHON" $TESTTMP/nlinks.py
14 > }
14 > }
15
15
16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17
17
18 $ cat > linkcp.py <<EOF
18 $ cat > linkcp.py <<EOF
19 > import sys
19 > import sys
20 > from mercurial import pycompat, util
20 > from mercurial import pycompat, util
21 > util.copyfiles(pycompat.fsencode(sys.argv[1]),
21 > util.copyfiles(pycompat.fsencode(sys.argv[1]),
22 > pycompat.fsencode(sys.argv[2]), hardlink=True)
22 > pycompat.fsencode(sys.argv[2]), hardlink=True)
23 > EOF
23 > EOF
24
24
25 $ linkcp()
25 $ linkcp()
26 > {
26 > {
27 > "$PYTHON" $TESTTMP/linkcp.py $1 $2
27 > "$PYTHON" $TESTTMP/linkcp.py $1 $2
28 > }
28 > }
29
29
30 Prepare repo r1:
30 Prepare repo r1:
31
31
32 $ hg init r1
32 $ hg init r1
33 $ cd r1
33 $ cd r1
34
34
35 $ echo c1 > f1
35 $ echo c1 > f1
36 $ hg add f1
36 $ hg add f1
37 $ hg ci -m0
37 $ hg ci -m0
38
38
39 $ mkdir d1
39 $ mkdir d1
40 $ cd d1
40 $ cd d1
41 $ echo c2 > f2
41 $ echo c2 > f2
42 $ hg add f2
42 $ hg add f2
43 $ hg ci -m1
43 $ hg ci -m1
44 $ cd ../..
44 $ cd ../..
45
45
46 $ nlinksdir r1/.hg/store
46 $ nlinksdir r1/.hg/store
47 1 r1/.hg/store/00changelog.i
47 1 r1/.hg/store/00changelog.i
48 1 r1/.hg/store/00manifest.i
48 1 r1/.hg/store/00manifest.i
49 1 r1/.hg/store/data/d1/f2.i
49 1 r1/.hg/store/data/d1/f2.i
50 1 r1/.hg/store/data/f1.i
50 1 r1/.hg/store/data/f1.i
51 1 r1/.hg/store/fncache (repofncache !)
51 1 r1/.hg/store/fncache (repofncache !)
52 1 r1/.hg/store/phaseroots
52 1 r1/.hg/store/phaseroots
53 1 r1/.hg/store/requires
53 1 r1/.hg/store/requires
54 1 r1/.hg/store/undo
54 1 r1/.hg/store/undo
55 1 r1/.hg/store/undo.backup.fncache (repofncache !)
55 1 r1/.hg/store/undo.backup.fncache (repofncache !)
56 1 r1/.hg/store/undo.backupfiles
56 1 r1/.hg/store/undo.backupfiles
57 1 r1/.hg/store/undo.phaseroots
57 1 r1/.hg/store/undo.phaseroots
58
58
59
59
60 Create hardlinked clone r2:
60 Create hardlinked clone r2:
61
61
62 $ hg clone -U --debug r1 r2 --config progress.debug=true
62 $ hg clone -U --debug r1 r2 --config progress.debug=true
63 linking: 1/7 files (14.29%)
63 linking: 1/7 files (14.29%)
64 linking: 2/7 files (28.57%)
64 linking: 2/7 files (28.57%)
65 linking: 3/7 files (42.86%)
65 linking: 3/7 files (42.86%)
66 linking: 4/7 files (57.14%)
66 linking: 4/7 files (57.14%)
67 linking: 5/7 files (71.43%)
67 linking: 5/7 files (71.43%)
68 linking: 6/7 files (85.71%)
68 linking: 6/7 files (85.71%)
69 linking: 7/7 files (100.00%)
69 linking: 7/7 files (100.00%)
70 linked 7 files
70 linked 7 files
71 updating the branch cache
71 updating the branch cache
72
72
73 Create non-hardlinked clone r3:
73 Create non-hardlinked clone r3:
74
74
75 $ hg clone --pull r1 r3
75 $ hg clone --pull r1 r3
76 requesting all changes
76 requesting all changes
77 adding changesets
77 adding changesets
78 adding manifests
78 adding manifests
79 adding file changes
79 adding file changes
80 added 2 changesets with 2 changes to 2 files
80 added 2 changesets with 2 changes to 2 files
81 new changesets 40d85e9847f2:7069c422939c
81 new changesets 40d85e9847f2:7069c422939c
82 updating to branch default
82 updating to branch default
83 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
84
84
85
85
86 Repos r1 and r2 should now contain hardlinked files:
86 Repos r1 and r2 should now contain hardlinked files:
87
87
88 $ nlinksdir r1/.hg/store
88 $ nlinksdir r1/.hg/store
89 2 r1/.hg/store/00changelog.i
89 2 r1/.hg/store/00changelog.i
90 2 r1/.hg/store/00manifest.i
90 2 r1/.hg/store/00manifest.i
91 2 r1/.hg/store/data/d1/f2.i
91 2 r1/.hg/store/data/d1/f2.i
92 2 r1/.hg/store/data/f1.i
92 2 r1/.hg/store/data/f1.i
93 1 r1/.hg/store/fncache (repofncache !)
93 1 r1/.hg/store/fncache (repofncache !)
94 1 r1/.hg/store/phaseroots
94 1 r1/.hg/store/phaseroots
95 1 r1/.hg/store/requires
95 1 r1/.hg/store/requires
96 1 r1/.hg/store/undo
96 1 r1/.hg/store/undo
97 1 r1/.hg/store/undo.backup.fncache (repofncache !)
97 1 r1/.hg/store/undo.backup.fncache (repofncache !)
98 1 r1/.hg/store/undo.backupfiles
98 1 r1/.hg/store/undo.backupfiles
99 1 r1/.hg/store/undo.phaseroots
99 1 r1/.hg/store/undo.phaseroots
100
100
101 $ nlinksdir r2/.hg/store
101 $ nlinksdir r2/.hg/store
102 2 r2/.hg/store/00changelog.i
102 2 r2/.hg/store/00changelog.i
103 2 r2/.hg/store/00manifest.i
103 2 r2/.hg/store/00manifest.i
104 2 r2/.hg/store/data/d1/f2.i
104 2 r2/.hg/store/data/d1/f2.i
105 2 r2/.hg/store/data/f1.i
105 2 r2/.hg/store/data/f1.i
106 1 r2/.hg/store/fncache (repofncache !)
106 1 r2/.hg/store/fncache (repofncache !)
107 1 r2/.hg/store/requires
107 1 r2/.hg/store/requires
108
108
109 Repo r3 should not be hardlinked:
109 Repo r3 should not be hardlinked:
110
110
111 $ nlinksdir r3/.hg/store
111 $ nlinksdir r3/.hg/store
112 1 r3/.hg/store/00changelog.i
112 1 r3/.hg/store/00changelog.i
113 1 r3/.hg/store/00manifest.i
113 1 r3/.hg/store/00manifest.i
114 1 r3/.hg/store/data/d1/f2.i
114 1 r3/.hg/store/data/d1/f2.i
115 1 r3/.hg/store/data/f1.i
115 1 r3/.hg/store/data/f1.i
116 1 r3/.hg/store/fncache (repofncache !)
116 1 r3/.hg/store/fncache (repofncache !)
117 1 r3/.hg/store/phaseroots
117 1 r3/.hg/store/phaseroots
118 1 r3/.hg/store/requires
118 1 r3/.hg/store/requires
119 1 r3/.hg/store/undo
119 1 r3/.hg/store/undo
120 1 r3/.hg/store/undo.backupfiles
120 1 r3/.hg/store/undo.backupfiles
121 1 r3/.hg/store/undo.phaseroots
121 1 r3/.hg/store/undo.phaseroots
122
122
123
123
124 Create a non-inlined filelog in r3:
124 Create a non-inlined filelog in r3:
125
125
126 $ cd r3/d1
126 $ cd r3/d1
127 >>> f = open('data1', 'wb')
127 >>> f = open('data1', 'wb')
128 >>> for x in range(10000):
128 >>> for x in range(10000):
129 ... f.write(b"%d\n" % x) and None
129 ... f.write(b"%d\n" % x) and None
130 >>> f.close()
130 >>> f.close()
131 $ for j in 0 1 2 3 4 5 6 7 8 9; do
131 $ for j in 0 1 2 3 4 5 6 7 8 9; do
132 > cat data1 >> f2
132 > cat data1 >> f2
133 > hg commit -m$j
133 > hg commit -m$j
134 > done
134 > done
135 $ cd ../..
135 $ cd ../..
136
136
137 $ nlinksdir r3/.hg/store
137 $ nlinksdir r3/.hg/store
138 1 r3/.hg/store/00changelog.i
138 1 r3/.hg/store/00changelog.i
139 1 r3/.hg/store/00manifest.i
139 1 r3/.hg/store/00manifest.i
140 1 r3/.hg/store/data/d1/f2.d
140 1 r3/.hg/store/data/d1/f2.d
141 1 r3/.hg/store/data/d1/f2.i
141 1 r3/.hg/store/data/d1/f2.i
142 1 r3/.hg/store/data/f1.i
142 1 r3/.hg/store/data/f1.i
143 1 r3/.hg/store/fncache (repofncache !)
143 1 r3/.hg/store/fncache (repofncache !)
144 1 r3/.hg/store/phaseroots
144 1 r3/.hg/store/phaseroots
145 1 r3/.hg/store/requires
145 1 r3/.hg/store/requires
146 1 r3/.hg/store/undo
146 1 r3/.hg/store/undo
147 1 r3/.hg/store/undo.backup.fncache (repofncache !)
147 1 r3/.hg/store/undo.backup.fncache (repofncache !)
148 1 r3/.hg/store/undo.backup.phaseroots
148 1 r3/.hg/store/undo.backup.phaseroots
149 1 r3/.hg/store/undo.backupfiles
149 1 r3/.hg/store/undo.backupfiles
150 1 r3/.hg/store/undo.phaseroots
150 1 r3/.hg/store/undo.phaseroots
151
151
152 Push to repo r1 should break up most hardlinks in r2:
152 Push to repo r1 should break up most hardlinks in r2:
153
153
154 $ hg -R r2 verify
154 $ hg -R r2 verify -q
155 checking changesets
156 checking manifests
157 crosschecking files in changesets and manifests
158 checking files
159 checked 2 changesets with 2 changes to 2 files
160
155
161 $ cd r3
156 $ cd r3
162 $ hg push
157 $ hg push
163 pushing to $TESTTMP/r1
158 pushing to $TESTTMP/r1
164 searching for changes
159 searching for changes
165 adding changesets
160 adding changesets
166 adding manifests
161 adding manifests
167 adding file changes
162 adding file changes
168 added 10 changesets with 10 changes to 1 files
163 added 10 changesets with 10 changes to 1 files
169
164
170 $ cd ..
165 $ cd ..
171
166
172 $ nlinksdir r2/.hg/store
167 $ nlinksdir r2/.hg/store
173 1 r2/.hg/store/00changelog.i
168 1 r2/.hg/store/00changelog.i
174 1 r2/.hg/store/00manifest.i
169 1 r2/.hg/store/00manifest.i
175 1 r2/.hg/store/data/d1/f2.i
170 1 r2/.hg/store/data/d1/f2.i
176 2 r2/.hg/store/data/f1.i
171 2 r2/.hg/store/data/f1.i
177 [12] r2/\.hg/store/fncache (re) (repofncache !)
172 [12] r2/\.hg/store/fncache (re) (repofncache !)
178 1 r2/.hg/store/requires
173 1 r2/.hg/store/requires
179
174
180 #if hardlink-whitelisted repofncache
175 #if hardlink-whitelisted repofncache
181 $ nlinksdir r2/.hg/store/fncache
176 $ nlinksdir r2/.hg/store/fncache
182 1 r2/.hg/store/fncache
177 1 r2/.hg/store/fncache
183 #endif
178 #endif
184
179
185 $ hg -R r2 verify
180 $ hg -R r2 verify -q
186 checking changesets
187 checking manifests
188 crosschecking files in changesets and manifests
189 checking files
190 checked 2 changesets with 2 changes to 2 files
191
192
181
193 $ cd r1
182 $ cd r1
194 $ hg up
183 $ hg up
195 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
196
185
197 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
186 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
198
187
199 $ echo c1c1 >> f1
188 $ echo c1c1 >> f1
200 $ hg ci -m00
189 $ hg ci -m00
201 $ cd ..
190 $ cd ..
202
191
203 $ nlinksdir r2/.hg/store
192 $ nlinksdir r2/.hg/store
204 1 r2/.hg/store/00changelog.i
193 1 r2/.hg/store/00changelog.i
205 1 r2/.hg/store/00manifest.i
194 1 r2/.hg/store/00manifest.i
206 1 r2/.hg/store/data/d1/f2.i
195 1 r2/.hg/store/data/d1/f2.i
207 1 r2/.hg/store/data/f1.i
196 1 r2/.hg/store/data/f1.i
208 1 r2/.hg/store/fncache (repofncache !)
197 1 r2/.hg/store/fncache (repofncache !)
209 1 r2/.hg/store/requires
198 1 r2/.hg/store/requires
210
199
211 #if hardlink-whitelisted repofncache
200 #if hardlink-whitelisted repofncache
212 $ nlinksdir r2/.hg/store/fncache
201 $ nlinksdir r2/.hg/store/fncache
213 1 r2/.hg/store/fncache
202 1 r2/.hg/store/fncache
214 #endif
203 #endif
215
204
216 Create a file which exec permissions we will change
205 Create a file which exec permissions we will change
217 $ cd r3
206 $ cd r3
218 $ echo "echo hello world" > f3
207 $ echo "echo hello world" > f3
219 $ hg add f3
208 $ hg add f3
220 $ hg ci -mf3
209 $ hg ci -mf3
221 $ cd ..
210 $ cd ..
222
211
223 $ cd r3
212 $ cd r3
224 $ hg tip --template '{rev}:{node|short}\n'
213 $ hg tip --template '{rev}:{node|short}\n'
225 12:d3b77733a28a
214 12:d3b77733a28a
226 $ echo bla > f1
215 $ echo bla > f1
227 $ chmod +x f3
216 $ chmod +x f3
228 $ hg ci -m1
217 $ hg ci -m1
229 $ cd ..
218 $ cd ..
230
219
231 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
220 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
232
221
233 $ linkcp r3 r4
222 $ linkcp r3 r4
234
223
235 'checklink' is produced by hardlinking a symlink, which is undefined whether
224 'checklink' is produced by hardlinking a symlink, which is undefined whether
236 the symlink should be followed or not. It does behave differently on Linux and
225 the symlink should be followed or not. It does behave differently on Linux and
237 BSD. Just remove it so the test pass on both platforms.
226 BSD. Just remove it so the test pass on both platforms.
238
227
239 $ rm -f r4/.hg/wcache/checklink
228 $ rm -f r4/.hg/wcache/checklink
240
229
241 r4 has hardlinks in the working dir (not just inside .hg):
230 r4 has hardlinks in the working dir (not just inside .hg):
242
231
243 $ nlinksdir r4
232 $ nlinksdir r4
244 2 r4/.hg/00changelog.i
233 2 r4/.hg/00changelog.i
245 2 r4/.hg/branch
234 2 r4/.hg/branch
246 2 r4/.hg/cache/branch2-base
235 2 r4/.hg/cache/branch2-base
247 2 r4/.hg/cache/branch2-immutable
236 2 r4/.hg/cache/branch2-immutable
248 2 r4/.hg/cache/branch2-served
237 2 r4/.hg/cache/branch2-served
249 2 r4/.hg/cache/branch2-served.hidden
238 2 r4/.hg/cache/branch2-served.hidden
250 2 r4/.hg/cache/branch2-visible
239 2 r4/.hg/cache/branch2-visible
251 2 r4/.hg/cache/branch2-visible-hidden
240 2 r4/.hg/cache/branch2-visible-hidden
252 2 r4/.hg/cache/rbc-names-v1
241 2 r4/.hg/cache/rbc-names-v1
253 2 r4/.hg/cache/rbc-revs-v1
242 2 r4/.hg/cache/rbc-revs-v1
254 2 r4/.hg/cache/tags2
243 2 r4/.hg/cache/tags2
255 2 r4/.hg/cache/tags2-served
244 2 r4/.hg/cache/tags2-served
256 2 r4/.hg/dirstate
245 2 r4/.hg/dirstate
257 2 r4/.hg/fsmonitor.state (fsmonitor !)
246 2 r4/.hg/fsmonitor.state (fsmonitor !)
258 2 r4/.hg/hgrc
247 2 r4/.hg/hgrc
259 2 r4/.hg/last-message.txt
248 2 r4/.hg/last-message.txt
260 2 r4/.hg/requires
249 2 r4/.hg/requires
261 2 r4/.hg/store/00changelog.i
250 2 r4/.hg/store/00changelog.i
262 2 r4/.hg/store/00manifest.i
251 2 r4/.hg/store/00manifest.i
263 2 r4/.hg/store/data/d1/f2.d
252 2 r4/.hg/store/data/d1/f2.d
264 2 r4/.hg/store/data/d1/f2.i
253 2 r4/.hg/store/data/d1/f2.i
265 2 r4/.hg/store/data/f1.i
254 2 r4/.hg/store/data/f1.i
266 2 r4/.hg/store/data/f3.i
255 2 r4/.hg/store/data/f3.i
267 2 r4/.hg/store/fncache (repofncache !)
256 2 r4/.hg/store/fncache (repofncache !)
268 2 r4/.hg/store/phaseroots
257 2 r4/.hg/store/phaseroots
269 2 r4/.hg/store/requires
258 2 r4/.hg/store/requires
270 2 r4/.hg/store/undo
259 2 r4/.hg/store/undo
271 2 r4/.hg/store/undo.backup.fncache (repofncache !)
260 2 r4/.hg/store/undo.backup.fncache (repofncache !)
272 2 r4/.hg/store/undo.backup.phaseroots
261 2 r4/.hg/store/undo.backup.phaseroots
273 2 r4/.hg/store/undo.backupfiles
262 2 r4/.hg/store/undo.backupfiles
274 2 r4/.hg/store/undo.phaseroots
263 2 r4/.hg/store/undo.phaseroots
275 [24] r4/\.hg/undo\.backup\.dirstate (re)
264 [24] r4/\.hg/undo\.backup\.dirstate (re)
276 2 r4/.hg/undo.bookmarks
265 2 r4/.hg/undo.bookmarks
277 2 r4/.hg/undo.branch
266 2 r4/.hg/undo.branch
278 2 r4/.hg/undo.desc
267 2 r4/.hg/undo.desc
279 [24] r4/\.hg/undo\.dirstate (re)
268 [24] r4/\.hg/undo\.dirstate (re)
280 2 r4/.hg/wcache/checkisexec (execbit !)
269 2 r4/.hg/wcache/checkisexec (execbit !)
281 2 r4/.hg/wcache/checklink-target (symlink !)
270 2 r4/.hg/wcache/checklink-target (symlink !)
282 2 r4/.hg/wcache/checknoexec (execbit !)
271 2 r4/.hg/wcache/checknoexec (execbit !)
283 2 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
272 2 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
284 2 r4/d1/data1
273 2 r4/d1/data1
285 2 r4/d1/f2
274 2 r4/d1/f2
286 2 r4/f1
275 2 r4/f1
287 2 r4/f3
276 2 r4/f3
288
277
289 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
278 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
290 #if hardlink-whitelisted
279 #if hardlink-whitelisted
291 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
280 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
292 4 r4/.hg/undo.backup.dirstate
281 4 r4/.hg/undo.backup.dirstate
293 4 r4/.hg/undo.dirstate
282 4 r4/.hg/undo.dirstate
294 #endif
283 #endif
295
284
296
285
297 $ hg -R r4 up 12
286 $ hg -R r4 up 12
298 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
287 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
299 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
288 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
300
289
301 $ nlinksdir r4
290 $ nlinksdir r4
302 2 r4/.hg/00changelog.i
291 2 r4/.hg/00changelog.i
303 1 r4/.hg/branch
292 1 r4/.hg/branch
304 2 r4/.hg/cache/branch2-base
293 2 r4/.hg/cache/branch2-base
305 2 r4/.hg/cache/branch2-immutable
294 2 r4/.hg/cache/branch2-immutable
306 2 r4/.hg/cache/branch2-served
295 2 r4/.hg/cache/branch2-served
307 2 r4/.hg/cache/branch2-served.hidden
296 2 r4/.hg/cache/branch2-served.hidden
308 2 r4/.hg/cache/branch2-visible
297 2 r4/.hg/cache/branch2-visible
309 2 r4/.hg/cache/branch2-visible-hidden
298 2 r4/.hg/cache/branch2-visible-hidden
310 2 r4/.hg/cache/rbc-names-v1
299 2 r4/.hg/cache/rbc-names-v1
311 2 r4/.hg/cache/rbc-revs-v1
300 2 r4/.hg/cache/rbc-revs-v1
312 2 r4/.hg/cache/tags2
301 2 r4/.hg/cache/tags2
313 2 r4/.hg/cache/tags2-served
302 2 r4/.hg/cache/tags2-served
314 1 r4/.hg/dirstate
303 1 r4/.hg/dirstate
315 1 r4/.hg/fsmonitor.state (fsmonitor !)
304 1 r4/.hg/fsmonitor.state (fsmonitor !)
316 2 r4/.hg/hgrc
305 2 r4/.hg/hgrc
317 2 r4/.hg/last-message.txt
306 2 r4/.hg/last-message.txt
318 2 r4/.hg/requires
307 2 r4/.hg/requires
319 2 r4/.hg/store/00changelog.i
308 2 r4/.hg/store/00changelog.i
320 2 r4/.hg/store/00manifest.i
309 2 r4/.hg/store/00manifest.i
321 2 r4/.hg/store/data/d1/f2.d
310 2 r4/.hg/store/data/d1/f2.d
322 2 r4/.hg/store/data/d1/f2.i
311 2 r4/.hg/store/data/d1/f2.i
323 2 r4/.hg/store/data/f1.i
312 2 r4/.hg/store/data/f1.i
324 2 r4/.hg/store/data/f3.i
313 2 r4/.hg/store/data/f3.i
325 2 r4/.hg/store/fncache
314 2 r4/.hg/store/fncache
326 2 r4/.hg/store/phaseroots
315 2 r4/.hg/store/phaseroots
327 2 r4/.hg/store/requires
316 2 r4/.hg/store/requires
328 2 r4/.hg/store/undo
317 2 r4/.hg/store/undo
329 2 r4/.hg/store/undo.backup.fncache (repofncache !)
318 2 r4/.hg/store/undo.backup.fncache (repofncache !)
330 2 r4/.hg/store/undo.backup.phaseroots
319 2 r4/.hg/store/undo.backup.phaseroots
331 2 r4/.hg/store/undo.backupfiles
320 2 r4/.hg/store/undo.backupfiles
332 2 r4/.hg/store/undo.phaseroots
321 2 r4/.hg/store/undo.phaseroots
333 [24] r4/\.hg/undo\.backup\.dirstate (re)
322 [24] r4/\.hg/undo\.backup\.dirstate (re)
334 2 r4/.hg/undo.bookmarks
323 2 r4/.hg/undo.bookmarks
335 2 r4/.hg/undo.branch
324 2 r4/.hg/undo.branch
336 2 r4/.hg/undo.desc
325 2 r4/.hg/undo.desc
337 [24] r4/\.hg/undo\.dirstate (re)
326 [24] r4/\.hg/undo\.dirstate (re)
338 2 r4/.hg/wcache/checkisexec (execbit !)
327 2 r4/.hg/wcache/checkisexec (execbit !)
339 2 r4/.hg/wcache/checklink-target (symlink !)
328 2 r4/.hg/wcache/checklink-target (symlink !)
340 2 r4/.hg/wcache/checknoexec (execbit !)
329 2 r4/.hg/wcache/checknoexec (execbit !)
341 1 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
330 1 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
342 2 r4/d1/data1
331 2 r4/d1/data1
343 2 r4/d1/f2
332 2 r4/d1/f2
344 1 r4/f1
333 1 r4/f1
345 1 r4/f3 (execbit !)
334 1 r4/f3 (execbit !)
346 2 r4/f3 (no-execbit !)
335 2 r4/f3 (no-execbit !)
347
336
348 #if hardlink-whitelisted
337 #if hardlink-whitelisted
349 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
338 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
350 4 r4/.hg/undo.backup.dirstate
339 4 r4/.hg/undo.backup.dirstate
351 4 r4/.hg/undo.dirstate
340 4 r4/.hg/undo.dirstate
352 #endif
341 #endif
353
342
354 Test hardlinking outside hg:
343 Test hardlinking outside hg:
355
344
356 $ mkdir x
345 $ mkdir x
357 $ echo foo > x/a
346 $ echo foo > x/a
358
347
359 $ linkcp x y
348 $ linkcp x y
360 $ echo bar >> y/a
349 $ echo bar >> y/a
361
350
362 No diff if hardlink:
351 No diff if hardlink:
363
352
364 $ diff x/a y/a
353 $ diff x/a y/a
365
354
366 Test mq hardlinking:
355 Test mq hardlinking:
367
356
368 $ echo "[extensions]" >> $HGRCPATH
357 $ echo "[extensions]" >> $HGRCPATH
369 $ echo "mq=" >> $HGRCPATH
358 $ echo "mq=" >> $HGRCPATH
370
359
371 $ hg init a
360 $ hg init a
372 $ cd a
361 $ cd a
373
362
374 $ hg qimport -n foo - << EOF
363 $ hg qimport -n foo - << EOF
375 > # HG changeset patch
364 > # HG changeset patch
376 > # Date 1 0
365 > # Date 1 0
377 > diff -r 2588a8b53d66 a
366 > diff -r 2588a8b53d66 a
378 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
367 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
379 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
368 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
380 > @@ -0,0 +1,1 @@
369 > @@ -0,0 +1,1 @@
381 > +a
370 > +a
382 > EOF
371 > EOF
383 adding foo to series file
372 adding foo to series file
384
373
385 $ hg qpush
374 $ hg qpush
386 applying foo
375 applying foo
387 now at: foo
376 now at: foo
388
377
389 $ cd ..
378 $ cd ..
390 $ linkcp a b
379 $ linkcp a b
391 $ cd b
380 $ cd b
392
381
393 $ hg qimport -n bar - << EOF
382 $ hg qimport -n bar - << EOF
394 > # HG changeset patch
383 > # HG changeset patch
395 > # Date 2 0
384 > # Date 2 0
396 > diff -r 2588a8b53d66 a
385 > diff -r 2588a8b53d66 a
397 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
386 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
398 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
387 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
399 > @@ -0,0 +1,1 @@
388 > @@ -0,0 +1,1 @@
400 > +b
389 > +b
401 > EOF
390 > EOF
402 adding bar to series file
391 adding bar to series file
403
392
404 $ hg qpush
393 $ hg qpush
405 applying bar
394 applying bar
406 now at: bar
395 now at: bar
407
396
408 $ cat .hg/patches/status
397 $ cat .hg/patches/status
409 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
398 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
410 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
399 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
411
400
412 $ cat .hg/patches/series
401 $ cat .hg/patches/series
413 foo
402 foo
414 bar
403 bar
415
404
416 $ cat ../a/.hg/patches/status
405 $ cat ../a/.hg/patches/status
417 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
406 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
418
407
419 $ cat ../a/.hg/patches/series
408 $ cat ../a/.hg/patches/series
420 foo
409 foo
421
410
422 Test tags hardlinking:
411 Test tags hardlinking:
423
412
424 $ hg qdel -r qbase:qtip
413 $ hg qdel -r qbase:qtip
425 patch foo finalized without changeset message
414 patch foo finalized without changeset message
426 patch bar finalized without changeset message
415 patch bar finalized without changeset message
427
416
428 $ hg tag -l lfoo
417 $ hg tag -l lfoo
429 $ hg tag foo
418 $ hg tag foo
430
419
431 $ cd ..
420 $ cd ..
432 $ linkcp b c
421 $ linkcp b c
433 $ cd c
422 $ cd c
434
423
435 $ hg tag -l -r 0 lbar
424 $ hg tag -l -r 0 lbar
436 $ hg tag -r 0 bar
425 $ hg tag -r 0 bar
437
426
438 $ cat .hgtags
427 $ cat .hgtags
439 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
428 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
440 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
429 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
441
430
442 $ cat .hg/localtags
431 $ cat .hg/localtags
443 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
432 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
444 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
433 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
445
434
446 $ cat ../b/.hgtags
435 $ cat ../b/.hgtags
447 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
436 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
448
437
449 $ cat ../b/.hg/localtags
438 $ cat ../b/.hg/localtags
450 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
439 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
451
440
452 $ cd ..
441 $ cd ..
@@ -1,415 +1,405
1 #require serve
1 #require serve
2
2
3 This test is a duplicate of 'test-http.t', feel free to factor out
3 This test is a duplicate of 'test-http.t', feel free to factor out
4 parts that are not bundle1/bundle2 specific.
4 parts that are not bundle1/bundle2 specific.
5
5
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [devel]
7 > [devel]
8 > # This test is dedicated to interaction through old bundle
8 > # This test is dedicated to interaction through old bundle
9 > legacy.exchange = bundle1
9 > legacy.exchange = bundle1
10 > EOF
10 > EOF
11
11
12 $ hg init test
12 $ hg init test
13 $ cd test
13 $ cd test
14 $ echo foo>foo
14 $ echo foo>foo
15 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
15 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
16 $ echo foo>foo.d/foo
16 $ echo foo>foo.d/foo
17 $ echo bar>foo.d/bAr.hg.d/BaR
17 $ echo bar>foo.d/bAr.hg.d/BaR
18 $ echo bar>foo.d/baR.d.hg/bAR
18 $ echo bar>foo.d/baR.d.hg/bAR
19 $ hg commit -A -m 1
19 $ hg commit -A -m 1
20 adding foo
20 adding foo
21 adding foo.d/bAr.hg.d/BaR
21 adding foo.d/bAr.hg.d/BaR
22 adding foo.d/baR.d.hg/bAR
22 adding foo.d/baR.d.hg/bAR
23 adding foo.d/foo
23 adding foo.d/foo
24 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
24 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
25 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
25 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
26
26
27 Test server address cannot be reused
27 Test server address cannot be reused
28
28
29 $ hg serve -p $HGPORT1 2>&1
29 $ hg serve -p $HGPORT1 2>&1
30 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
30 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
31 [255]
31 [255]
32
32
33 $ cd ..
33 $ cd ..
34 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
34 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
35
35
36 clone via stream
36 clone via stream
37
37
38 #if no-reposimplestore
38 #if no-reposimplestore
39 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
39 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
40 streaming all changes
40 streaming all changes
41 6 files to transfer, 606 bytes of data (no-zstd !)
41 6 files to transfer, 606 bytes of data (no-zstd !)
42 6 files to transfer, 608 bytes of data (zstd !)
42 6 files to transfer, 608 bytes of data (zstd !)
43 transferred * bytes in * seconds (*/sec) (glob)
43 transferred * bytes in * seconds (*/sec) (glob)
44 searching for changes
44 searching for changes
45 no changes found
45 no changes found
46 updating to branch default
46 updating to branch default
47 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ hg verify -R copy
48 $ hg verify -R copy -q
49 checking changesets
50 checking manifests
51 crosschecking files in changesets and manifests
52 checking files
53 checked 1 changesets with 4 changes to 4 files
54 #endif
49 #endif
55
50
56 try to clone via stream, should use pull instead
51 try to clone via stream, should use pull instead
57
52
58 $ hg clone --stream http://localhost:$HGPORT1/ copy2
53 $ hg clone --stream http://localhost:$HGPORT1/ copy2
59 warning: stream clone requested but server has them disabled
54 warning: stream clone requested but server has them disabled
60 requesting all changes
55 requesting all changes
61 adding changesets
56 adding changesets
62 adding manifests
57 adding manifests
63 adding file changes
58 adding file changes
64 added 1 changesets with 4 changes to 4 files
59 added 1 changesets with 4 changes to 4 files
65 new changesets 8b6053c928fe
60 new changesets 8b6053c928fe
66 updating to branch default
61 updating to branch default
67 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
68
63
69 try to clone via stream but missing requirements, so should use pull instead
64 try to clone via stream but missing requirements, so should use pull instead
70
65
71 $ cat > $TESTTMP/removesupportedformat.py << EOF
66 $ cat > $TESTTMP/removesupportedformat.py << EOF
72 > from mercurial import localrepo
67 > from mercurial import localrepo
73 > def reposetup(ui, repo):
68 > def reposetup(ui, repo):
74 > local = repo.local()
69 > local = repo.local()
75 > if local is not None:
70 > if local is not None:
76 > local.supported.remove(b'generaldelta')
71 > local.supported.remove(b'generaldelta')
77 > EOF
72 > EOF
78
73
79 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
74 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
80 warning: stream clone requested but client is missing requirements: generaldelta
75 warning: stream clone requested but client is missing requirements: generaldelta
81 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
76 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
82 requesting all changes
77 requesting all changes
83 adding changesets
78 adding changesets
84 adding manifests
79 adding manifests
85 adding file changes
80 adding file changes
86 added 1 changesets with 4 changes to 4 files
81 added 1 changesets with 4 changes to 4 files
87 new changesets 8b6053c928fe
82 new changesets 8b6053c928fe
88 updating to branch default
83 updating to branch default
89 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
90
85
91 clone via pull
86 clone via pull
92
87
93 $ hg clone http://localhost:$HGPORT1/ copy-pull
88 $ hg clone http://localhost:$HGPORT1/ copy-pull
94 requesting all changes
89 requesting all changes
95 adding changesets
90 adding changesets
96 adding manifests
91 adding manifests
97 adding file changes
92 adding file changes
98 added 1 changesets with 4 changes to 4 files
93 added 1 changesets with 4 changes to 4 files
99 new changesets 8b6053c928fe
94 new changesets 8b6053c928fe
100 updating to branch default
95 updating to branch default
101 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 $ hg verify -R copy-pull
97 $ hg verify -R copy-pull -q
103 checking changesets
104 checking manifests
105 crosschecking files in changesets and manifests
106 checking files
107 checked 1 changesets with 4 changes to 4 files
108 $ cd test
98 $ cd test
109 $ echo bar > bar
99 $ echo bar > bar
110 $ hg commit -A -d '1 0' -m 2
100 $ hg commit -A -d '1 0' -m 2
111 adding bar
101 adding bar
112 $ cd ..
102 $ cd ..
113
103
114 clone over http with --update
104 clone over http with --update
115
105
116 $ hg clone http://localhost:$HGPORT1/ updated --update 0
106 $ hg clone http://localhost:$HGPORT1/ updated --update 0
117 requesting all changes
107 requesting all changes
118 adding changesets
108 adding changesets
119 adding manifests
109 adding manifests
120 adding file changes
110 adding file changes
121 added 2 changesets with 5 changes to 5 files
111 added 2 changesets with 5 changes to 5 files
122 new changesets 8b6053c928fe:5fed3813f7f5
112 new changesets 8b6053c928fe:5fed3813f7f5
123 updating to branch default
113 updating to branch default
124 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
125 $ hg log -r . -R updated
115 $ hg log -r . -R updated
126 changeset: 0:8b6053c928fe
116 changeset: 0:8b6053c928fe
127 user: test
117 user: test
128 date: Thu Jan 01 00:00:00 1970 +0000
118 date: Thu Jan 01 00:00:00 1970 +0000
129 summary: 1
119 summary: 1
130
120
131 $ rm -rf updated
121 $ rm -rf updated
132
122
133 incoming via HTTP
123 incoming via HTTP
134
124
135 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
125 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
136 adding changesets
126 adding changesets
137 adding manifests
127 adding manifests
138 adding file changes
128 adding file changes
139 added 1 changesets with 4 changes to 4 files
129 added 1 changesets with 4 changes to 4 files
140 new changesets 8b6053c928fe
130 new changesets 8b6053c928fe
141 updating to branch default
131 updating to branch default
142 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 $ cd partial
133 $ cd partial
144 $ touch LOCAL
134 $ touch LOCAL
145 $ hg ci -qAm LOCAL
135 $ hg ci -qAm LOCAL
146 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
136 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
147 comparing with http://localhost:$HGPORT1/
137 comparing with http://localhost:$HGPORT1/
148 searching for changes
138 searching for changes
149 2
139 2
150 $ cd ..
140 $ cd ..
151
141
152 pull
142 pull
153
143
154 $ cd copy-pull
144 $ cd copy-pull
155 $ cat >> .hg/hgrc <<EOF
145 $ cat >> .hg/hgrc <<EOF
156 > [hooks]
146 > [hooks]
157 > changegroup = sh -c "printenv.py --line changegroup"
147 > changegroup = sh -c "printenv.py --line changegroup"
158 > EOF
148 > EOF
159 $ hg pull
149 $ hg pull
160 pulling from http://localhost:$HGPORT1/
150 pulling from http://localhost:$HGPORT1/
161 searching for changes
151 searching for changes
162 adding changesets
152 adding changesets
163 adding manifests
153 adding manifests
164 adding file changes
154 adding file changes
165 added 1 changesets with 1 changes to 1 files
155 added 1 changesets with 1 changes to 1 files
166 new changesets 5fed3813f7f5
156 new changesets 5fed3813f7f5
167 changegroup hook: HG_HOOKNAME=changegroup
157 changegroup hook: HG_HOOKNAME=changegroup
168 HG_HOOKTYPE=changegroup
158 HG_HOOKTYPE=changegroup
169 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
159 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
170 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
160 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
171 HG_SOURCE=pull
161 HG_SOURCE=pull
172 HG_TXNID=TXN:$ID$
162 HG_TXNID=TXN:$ID$
173 HG_TXNNAME=pull
163 HG_TXNNAME=pull
174 http://localhost:$HGPORT1/
164 http://localhost:$HGPORT1/
175 HG_URL=http://localhost:$HGPORT1/
165 HG_URL=http://localhost:$HGPORT1/
176
166
177 (run 'hg update' to get a working copy)
167 (run 'hg update' to get a working copy)
178 $ cd ..
168 $ cd ..
179
169
180 clone from invalid URL
170 clone from invalid URL
181
171
182 $ hg clone http://localhost:$HGPORT/bad
172 $ hg clone http://localhost:$HGPORT/bad
183 abort: HTTP Error 404: Not Found
173 abort: HTTP Error 404: Not Found
184 [100]
174 [100]
185
175
186 test http authentication
176 test http authentication
187 + use the same server to test server side streaming preference
177 + use the same server to test server side streaming preference
188
178
189 $ cd test
179 $ cd test
190
180
191 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -p $HGPORT2 -d \
181 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -p $HGPORT2 -d \
192 > --pid-file=pid --config server.preferuncompressed=True \
182 > --pid-file=pid --config server.preferuncompressed=True \
193 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
183 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
194 $ cat pid >> $DAEMON_PIDS
184 $ cat pid >> $DAEMON_PIDS
195
185
196 $ cat << EOF > get_pass.py
186 $ cat << EOF > get_pass.py
197 > from mercurial import util
187 > from mercurial import util
198 > def newgetpass():
188 > def newgetpass():
199 > return "pass"
189 > return "pass"
200 > util.get_password = newgetpass
190 > util.get_password = newgetpass
201 > EOF
191 > EOF
202
192
203 $ hg id http://localhost:$HGPORT2/
193 $ hg id http://localhost:$HGPORT2/
204 abort: http authorization required for http://localhost:$HGPORT2/
194 abort: http authorization required for http://localhost:$HGPORT2/
205 [255]
195 [255]
206 $ hg id http://localhost:$HGPORT2/
196 $ hg id http://localhost:$HGPORT2/
207 abort: http authorization required for http://localhost:$HGPORT2/
197 abort: http authorization required for http://localhost:$HGPORT2/
208 [255]
198 [255]
209 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
199 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
210 http authorization required for http://localhost:$HGPORT2/
200 http authorization required for http://localhost:$HGPORT2/
211 realm: mercurial
201 realm: mercurial
212 user: user
202 user: user
213 password: 5fed3813f7f5
203 password: 5fed3813f7f5
214 $ hg id http://user:pass@localhost:$HGPORT2/
204 $ hg id http://user:pass@localhost:$HGPORT2/
215 5fed3813f7f5
205 5fed3813f7f5
216 $ echo '[auth]' >> .hg/hgrc
206 $ echo '[auth]' >> .hg/hgrc
217 $ echo 'l.schemes=http' >> .hg/hgrc
207 $ echo 'l.schemes=http' >> .hg/hgrc
218 $ echo 'l.prefix=lo' >> .hg/hgrc
208 $ echo 'l.prefix=lo' >> .hg/hgrc
219 $ echo 'l.username=user' >> .hg/hgrc
209 $ echo 'l.username=user' >> .hg/hgrc
220 $ echo 'l.password=pass' >> .hg/hgrc
210 $ echo 'l.password=pass' >> .hg/hgrc
221 $ hg id http://localhost:$HGPORT2/
211 $ hg id http://localhost:$HGPORT2/
222 5fed3813f7f5
212 5fed3813f7f5
223 $ hg id http://localhost:$HGPORT2/
213 $ hg id http://localhost:$HGPORT2/
224 5fed3813f7f5
214 5fed3813f7f5
225 $ hg id http://user@localhost:$HGPORT2/
215 $ hg id http://user@localhost:$HGPORT2/
226 5fed3813f7f5
216 5fed3813f7f5
227
217
228 #if no-reposimplestore
218 #if no-reposimplestore
229 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
219 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
230 streaming all changes
220 streaming all changes
231 7 files to transfer, 916 bytes of data (no-zstd !)
221 7 files to transfer, 916 bytes of data (no-zstd !)
232 7 files to transfer, 919 bytes of data (zstd !)
222 7 files to transfer, 919 bytes of data (zstd !)
233 transferred * bytes in * seconds (*/sec) (glob)
223 transferred * bytes in * seconds (*/sec) (glob)
234 searching for changes
224 searching for changes
235 no changes found
225 no changes found
236 updating to branch default
226 updating to branch default
237 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 #endif
228 #endif
239
229
240 --pull should override server's preferuncompressed
230 --pull should override server's preferuncompressed
241
231
242 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
232 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
243 requesting all changes
233 requesting all changes
244 adding changesets
234 adding changesets
245 adding manifests
235 adding manifests
246 adding file changes
236 adding file changes
247 added 2 changesets with 5 changes to 5 files
237 added 2 changesets with 5 changes to 5 files
248 new changesets 8b6053c928fe:5fed3813f7f5
238 new changesets 8b6053c928fe:5fed3813f7f5
249 updating to branch default
239 updating to branch default
250 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
251
241
252 $ hg id http://user2@localhost:$HGPORT2/
242 $ hg id http://user2@localhost:$HGPORT2/
253 abort: http authorization required for http://localhost:$HGPORT2/
243 abort: http authorization required for http://localhost:$HGPORT2/
254 [255]
244 [255]
255 $ hg id http://user:pass2@localhost:$HGPORT2/
245 $ hg id http://user:pass2@localhost:$HGPORT2/
256 abort: HTTP Error 403: no
246 abort: HTTP Error 403: no
257 [100]
247 [100]
258
248
259 $ hg -R dest-pull tag -r tip top
249 $ hg -R dest-pull tag -r tip top
260 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
250 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
261 pushing to http://user:***@localhost:$HGPORT2/
251 pushing to http://user:***@localhost:$HGPORT2/
262 searching for changes
252 searching for changes
263 remote: adding changesets
253 remote: adding changesets
264 remote: adding manifests
254 remote: adding manifests
265 remote: adding file changes
255 remote: adding file changes
266 remote: added 1 changesets with 1 changes to 1 files
256 remote: added 1 changesets with 1 changes to 1 files
267 $ hg rollback -q
257 $ hg rollback -q
268
258
269 $ sed 's/.*] "/"/' < ../access.log
259 $ sed 's/.*] "/"/' < ../access.log
270 "GET /?cmd=capabilities HTTP/1.1" 401 -
260 "GET /?cmd=capabilities HTTP/1.1" 401 -
271 "GET /?cmd=capabilities HTTP/1.1" 401 -
261 "GET /?cmd=capabilities HTTP/1.1" 401 -
272 "GET /?cmd=capabilities HTTP/1.1" 401 -
262 "GET /?cmd=capabilities HTTP/1.1" 401 -
273 "GET /?cmd=capabilities HTTP/1.1" 200 -
263 "GET /?cmd=capabilities HTTP/1.1" 200 -
274 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
264 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
275 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
265 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
276 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
266 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
277 "GET /?cmd=capabilities HTTP/1.1" 401 -
267 "GET /?cmd=capabilities HTTP/1.1" 401 -
278 "GET /?cmd=capabilities HTTP/1.1" 200 -
268 "GET /?cmd=capabilities HTTP/1.1" 200 -
279 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
269 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
280 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
270 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
281 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
271 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
282 "GET /?cmd=capabilities HTTP/1.1" 401 -
272 "GET /?cmd=capabilities HTTP/1.1" 401 -
283 "GET /?cmd=capabilities HTTP/1.1" 200 -
273 "GET /?cmd=capabilities HTTP/1.1" 200 -
284 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
274 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
285 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
275 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
286 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
276 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
287 "GET /?cmd=capabilities HTTP/1.1" 401 -
277 "GET /?cmd=capabilities HTTP/1.1" 401 -
288 "GET /?cmd=capabilities HTTP/1.1" 200 -
278 "GET /?cmd=capabilities HTTP/1.1" 200 -
289 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
279 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
290 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
280 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
291 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
281 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
292 "GET /?cmd=capabilities HTTP/1.1" 401 -
282 "GET /?cmd=capabilities HTTP/1.1" 401 -
293 "GET /?cmd=capabilities HTTP/1.1" 200 -
283 "GET /?cmd=capabilities HTTP/1.1" 200 -
294 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
284 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
295 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
285 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
296 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
286 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
297 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
287 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
298 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
288 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
299 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
289 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
300 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
290 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
301 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
291 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
302 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
292 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
303 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
293 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
304 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
294 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
305 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
295 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
306 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
296 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
307 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
297 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
308 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
298 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
309 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
299 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
310 "GET /?cmd=capabilities HTTP/1.1" 401 -
300 "GET /?cmd=capabilities HTTP/1.1" 401 -
311 "GET /?cmd=capabilities HTTP/1.1" 401 -
301 "GET /?cmd=capabilities HTTP/1.1" 401 -
312 "GET /?cmd=capabilities HTTP/1.1" 403 -
302 "GET /?cmd=capabilities HTTP/1.1" 403 -
313 "GET /?cmd=capabilities HTTP/1.1" 401 -
303 "GET /?cmd=capabilities HTTP/1.1" 401 -
314 "GET /?cmd=capabilities HTTP/1.1" 200 -
304 "GET /?cmd=capabilities HTTP/1.1" 200 -
315 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
305 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
316 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
306 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
317 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
307 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
318 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
308 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
319 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
309 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
320 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob)
310 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob)
321 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
311 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
322
312
323 $ cd ..
313 $ cd ..
324
314
325 clone of serve with repo in root and unserved subrepo (issue2970)
315 clone of serve with repo in root and unserved subrepo (issue2970)
326
316
327 $ hg --cwd test init sub
317 $ hg --cwd test init sub
328 $ echo empty > test/sub/empty
318 $ echo empty > test/sub/empty
329 $ hg --cwd test/sub add empty
319 $ hg --cwd test/sub add empty
330 $ hg --cwd test/sub commit -qm 'add empty'
320 $ hg --cwd test/sub commit -qm 'add empty'
331 $ hg --cwd test/sub tag -r 0 something
321 $ hg --cwd test/sub tag -r 0 something
332 $ echo sub = sub > test/.hgsub
322 $ echo sub = sub > test/.hgsub
333 $ hg --cwd test add .hgsub
323 $ hg --cwd test add .hgsub
334 $ hg --cwd test commit -qm 'add subrepo'
324 $ hg --cwd test commit -qm 'add subrepo'
335 $ hg clone http://localhost:$HGPORT noslash-clone
325 $ hg clone http://localhost:$HGPORT noslash-clone
336 requesting all changes
326 requesting all changes
337 adding changesets
327 adding changesets
338 adding manifests
328 adding manifests
339 adding file changes
329 adding file changes
340 added 3 changesets with 7 changes to 7 files
330 added 3 changesets with 7 changes to 7 files
341 new changesets 8b6053c928fe:56f9bc90cce6
331 new changesets 8b6053c928fe:56f9bc90cce6
342 updating to branch default
332 updating to branch default
343 cloning subrepo sub from http://localhost:$HGPORT/sub
333 cloning subrepo sub from http://localhost:$HGPORT/sub
344 abort: HTTP Error 404: Not Found
334 abort: HTTP Error 404: Not Found
345 [100]
335 [100]
346 $ hg clone http://localhost:$HGPORT/ slash-clone
336 $ hg clone http://localhost:$HGPORT/ slash-clone
347 requesting all changes
337 requesting all changes
348 adding changesets
338 adding changesets
349 adding manifests
339 adding manifests
350 adding file changes
340 adding file changes
351 added 3 changesets with 7 changes to 7 files
341 added 3 changesets with 7 changes to 7 files
352 new changesets 8b6053c928fe:56f9bc90cce6
342 new changesets 8b6053c928fe:56f9bc90cce6
353 updating to branch default
343 updating to branch default
354 cloning subrepo sub from http://localhost:$HGPORT/sub
344 cloning subrepo sub from http://localhost:$HGPORT/sub
355 abort: HTTP Error 404: Not Found
345 abort: HTTP Error 404: Not Found
356 [100]
346 [100]
357
347
358 check error log
348 check error log
359
349
360 $ cat error.log
350 $ cat error.log
361
351
362 Check error reporting while pulling/cloning
352 Check error reporting while pulling/cloning
363
353
364 $ $RUNTESTDIR/killdaemons.py
354 $ $RUNTESTDIR/killdaemons.py
365 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
355 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
366 $ cat hg3.pid >> $DAEMON_PIDS
356 $ cat hg3.pid >> $DAEMON_PIDS
367 $ hg clone http://localhost:$HGPORT/ abort-clone
357 $ hg clone http://localhost:$HGPORT/ abort-clone
368 requesting all changes
358 requesting all changes
369 abort: remote error:
359 abort: remote error:
370 this is an exercise
360 this is an exercise
371 [100]
361 [100]
372 $ cat error.log
362 $ cat error.log
373
363
374 disable pull-based clones
364 disable pull-based clones
375
365
376 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
366 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
377 $ cat hg4.pid >> $DAEMON_PIDS
367 $ cat hg4.pid >> $DAEMON_PIDS
378 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
368 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
379 requesting all changes
369 requesting all changes
380 abort: remote error:
370 abort: remote error:
381 server has pull-based clones disabled
371 server has pull-based clones disabled
382 [100]
372 [100]
383
373
384 #if no-reposimplestore
374 #if no-reposimplestore
385 ... but keep stream clones working
375 ... but keep stream clones working
386
376
387 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
377 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
388 streaming all changes
378 streaming all changes
389 * files to transfer, * of data (glob)
379 * files to transfer, * of data (glob)
390 transferred 1.36 KB in * seconds (* */sec) (glob) (no-zstd !)
380 transferred 1.36 KB in * seconds (* */sec) (glob) (no-zstd !)
391 transferred 1.38 KB in * seconds (* */sec) (glob) (zstd !)
381 transferred 1.38 KB in * seconds (* */sec) (glob) (zstd !)
392 searching for changes
382 searching for changes
393 no changes found
383 no changes found
394 #endif
384 #endif
395
385
396 ... and also keep partial clones and pulls working
386 ... and also keep partial clones and pulls working
397 $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone
387 $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone
398 adding changesets
388 adding changesets
399 adding manifests
389 adding manifests
400 adding file changes
390 adding file changes
401 added 1 changesets with 4 changes to 4 files
391 added 1 changesets with 4 changes to 4 files
402 new changesets 8b6053c928fe
392 new changesets 8b6053c928fe
403 updating to branch default
393 updating to branch default
404 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
394 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
405 $ hg pull -R test-partial-clone
395 $ hg pull -R test-partial-clone
406 pulling from http://localhost:$HGPORT1/
396 pulling from http://localhost:$HGPORT1/
407 searching for changes
397 searching for changes
408 adding changesets
398 adding changesets
409 adding manifests
399 adding manifests
410 adding file changes
400 adding file changes
411 added 2 changesets with 3 changes to 3 files
401 added 2 changesets with 3 changes to 3 files
412 new changesets 5fed3813f7f5:56f9bc90cce6
402 new changesets 5fed3813f7f5:56f9bc90cce6
413 (run 'hg update' to get a working copy)
403 (run 'hg update' to get a working copy)
414
404
415 $ cat error.log
405 $ cat error.log
@@ -1,222 +1,157
1 #require serve
1 #require serve
2
2
3 creating 'remote
3 creating 'remote
4
4
5 $ hg init remote
5 $ hg init remote
6 $ cd remote
6 $ cd remote
7 $ hg unbundle "$TESTDIR/bundles/remote.hg"
7 $ hg unbundle "$TESTDIR/bundles/remote.hg"
8 adding changesets
8 adding changesets
9 adding manifests
9 adding manifests
10 adding file changes
10 adding file changes
11 added 9 changesets with 7 changes to 4 files (+1 heads)
11 added 9 changesets with 7 changes to 4 files (+1 heads)
12 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
12 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
13 (run 'hg heads' to see heads, 'hg merge' to merge)
13 (run 'hg heads' to see heads, 'hg merge' to merge)
14 $ hg up tip
14 $ hg up tip
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16
16
17 Starting server
17 Starting server
18
18
19 $ hg serve -p $HGPORT -E ../error.log -d --pid-file=../hg1.pid
19 $ hg serve -p $HGPORT -E ../error.log -d --pid-file=../hg1.pid
20 $ cd ..
20 $ cd ..
21 $ cat hg1.pid >> $DAEMON_PIDS
21 $ cat hg1.pid >> $DAEMON_PIDS
22
22
23 clone remote via stream
23 clone remote via stream
24
24
25 $ for i in 0 1 2 3 4 5 6 7 8; do
25 $ for i in 0 1 2 3 4 5 6 7 8; do
26 > hg clone -r "$i" http://localhost:$HGPORT/ test-"$i"
26 > hg clone -r "$i" http://localhost:$HGPORT/ test-"$i"
27 > if cd test-"$i"; then
27 > if cd test-"$i"; then
28 > hg verify
28 > hg verify -q
29 > cd ..
29 > cd ..
30 > fi
30 > fi
31 > done
31 > done
32 adding changesets
32 adding changesets
33 adding manifests
33 adding manifests
34 adding file changes
34 adding file changes
35 added 1 changesets with 1 changes to 1 files
35 added 1 changesets with 1 changes to 1 files
36 new changesets bfaf4b5cbf01
36 new changesets bfaf4b5cbf01
37 updating to branch default
37 updating to branch default
38 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 checking changesets
40 checking manifests
41 crosschecking files in changesets and manifests
42 checking files
43 checked 1 changesets with 1 changes to 1 files
44 adding changesets
39 adding changesets
45 adding manifests
40 adding manifests
46 adding file changes
41 adding file changes
47 added 2 changesets with 2 changes to 1 files
42 added 2 changesets with 2 changes to 1 files
48 new changesets bfaf4b5cbf01:21f32785131f
43 new changesets bfaf4b5cbf01:21f32785131f
49 updating to branch default
44 updating to branch default
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 checking changesets
52 checking manifests
53 crosschecking files in changesets and manifests
54 checking files
55 checked 2 changesets with 2 changes to 1 files
56 adding changesets
46 adding changesets
57 adding manifests
47 adding manifests
58 adding file changes
48 adding file changes
59 added 3 changesets with 3 changes to 1 files
49 added 3 changesets with 3 changes to 1 files
60 new changesets bfaf4b5cbf01:4ce51a113780
50 new changesets bfaf4b5cbf01:4ce51a113780
61 updating to branch default
51 updating to branch default
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 checking changesets
64 checking manifests
65 crosschecking files in changesets and manifests
66 checking files
67 checked 3 changesets with 3 changes to 1 files
68 adding changesets
53 adding changesets
69 adding manifests
54 adding manifests
70 adding file changes
55 adding file changes
71 added 4 changesets with 4 changes to 1 files
56 added 4 changesets with 4 changes to 1 files
72 new changesets bfaf4b5cbf01:93ee6ab32777
57 new changesets bfaf4b5cbf01:93ee6ab32777
73 updating to branch default
58 updating to branch default
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 checking changesets
76 checking manifests
77 crosschecking files in changesets and manifests
78 checking files
79 checked 4 changesets with 4 changes to 1 files
80 adding changesets
60 adding changesets
81 adding manifests
61 adding manifests
82 adding file changes
62 adding file changes
83 added 2 changesets with 2 changes to 1 files
63 added 2 changesets with 2 changes to 1 files
84 new changesets bfaf4b5cbf01:c70afb1ee985
64 new changesets bfaf4b5cbf01:c70afb1ee985
85 updating to branch default
65 updating to branch default
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 checking changesets
88 checking manifests
89 crosschecking files in changesets and manifests
90 checking files
91 checked 2 changesets with 2 changes to 1 files
92 adding changesets
67 adding changesets
93 adding manifests
68 adding manifests
94 adding file changes
69 adding file changes
95 added 3 changesets with 3 changes to 1 files
70 added 3 changesets with 3 changes to 1 files
96 new changesets bfaf4b5cbf01:f03ae5a9b979
71 new changesets bfaf4b5cbf01:f03ae5a9b979
97 updating to branch default
72 updating to branch default
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 checking changesets
100 checking manifests
101 crosschecking files in changesets and manifests
102 checking files
103 checked 3 changesets with 3 changes to 1 files
104 adding changesets
74 adding changesets
105 adding manifests
75 adding manifests
106 adding file changes
76 adding file changes
107 added 4 changesets with 5 changes to 2 files
77 added 4 changesets with 5 changes to 2 files
108 new changesets bfaf4b5cbf01:095cb14b1b4d
78 new changesets bfaf4b5cbf01:095cb14b1b4d
109 updating to branch default
79 updating to branch default
110 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 checking changesets
112 checking manifests
113 crosschecking files in changesets and manifests
114 checking files
115 checked 4 changesets with 5 changes to 2 files
116 adding changesets
81 adding changesets
117 adding manifests
82 adding manifests
118 adding file changes
83 adding file changes
119 added 5 changesets with 6 changes to 3 files
84 added 5 changesets with 6 changes to 3 files
120 new changesets bfaf4b5cbf01:faa2e4234c7a
85 new changesets bfaf4b5cbf01:faa2e4234c7a
121 updating to branch default
86 updating to branch default
122 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 checking changesets
124 checking manifests
125 crosschecking files in changesets and manifests
126 checking files
127 checked 5 changesets with 6 changes to 3 files
128 adding changesets
88 adding changesets
129 adding manifests
89 adding manifests
130 adding file changes
90 adding file changes
131 added 5 changesets with 5 changes to 2 files
91 added 5 changesets with 5 changes to 2 files
132 new changesets bfaf4b5cbf01:916f1afdef90
92 new changesets bfaf4b5cbf01:916f1afdef90
133 updating to branch default
93 updating to branch default
134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
135 checking changesets
136 checking manifests
137 crosschecking files in changesets and manifests
138 checking files
139 checked 5 changesets with 5 changes to 2 files
140 $ cd test-8
95 $ cd test-8
141 $ hg pull ../test-7
96 $ hg pull ../test-7
142 pulling from ../test-7
97 pulling from ../test-7
143 searching for changes
98 searching for changes
144 adding changesets
99 adding changesets
145 adding manifests
100 adding manifests
146 adding file changes
101 adding file changes
147 added 4 changesets with 2 changes to 3 files (+1 heads)
102 added 4 changesets with 2 changes to 3 files (+1 heads)
148 new changesets c70afb1ee985:faa2e4234c7a
103 new changesets c70afb1ee985:faa2e4234c7a
149 (run 'hg heads' to see heads, 'hg merge' to merge)
104 (run 'hg heads' to see heads, 'hg merge' to merge)
150 $ hg verify
105 $ hg verify -q
151 checking changesets
152 checking manifests
153 crosschecking files in changesets and manifests
154 checking files
155 checked 9 changesets with 7 changes to 4 files
156 $ cd ..
106 $ cd ..
157 $ cd test-1
107 $ cd test-1
158 $ hg pull -r 4 http://localhost:$HGPORT/
108 $ hg pull -r 4 http://localhost:$HGPORT/
159 pulling from http://localhost:$HGPORT/
109 pulling from http://localhost:$HGPORT/
160 searching for changes
110 searching for changes
161 adding changesets
111 adding changesets
162 adding manifests
112 adding manifests
163 adding file changes
113 adding file changes
164 added 1 changesets with 0 changes to 0 files (+1 heads)
114 added 1 changesets with 0 changes to 0 files (+1 heads)
165 new changesets c70afb1ee985
115 new changesets c70afb1ee985
166 (run 'hg heads' to see heads, 'hg merge' to merge)
116 (run 'hg heads' to see heads, 'hg merge' to merge)
167 $ hg verify
117 $ hg verify -q
168 checking changesets
169 checking manifests
170 crosschecking files in changesets and manifests
171 checking files
172 checked 3 changesets with 2 changes to 1 files
173 $ hg pull http://localhost:$HGPORT/
118 $ hg pull http://localhost:$HGPORT/
174 pulling from http://localhost:$HGPORT/
119 pulling from http://localhost:$HGPORT/
175 searching for changes
120 searching for changes
176 adding changesets
121 adding changesets
177 adding manifests
122 adding manifests
178 adding file changes
123 adding file changes
179 added 6 changesets with 5 changes to 4 files
124 added 6 changesets with 5 changes to 4 files
180 new changesets 4ce51a113780:916f1afdef90
125 new changesets 4ce51a113780:916f1afdef90
181 (run 'hg update' to get a working copy)
126 (run 'hg update' to get a working copy)
182 $ cd ..
127 $ cd ..
183 $ cd test-2
128 $ cd test-2
184 $ hg pull -r 5 http://localhost:$HGPORT/
129 $ hg pull -r 5 http://localhost:$HGPORT/
185 pulling from http://localhost:$HGPORT/
130 pulling from http://localhost:$HGPORT/
186 searching for changes
131 searching for changes
187 adding changesets
132 adding changesets
188 adding manifests
133 adding manifests
189 adding file changes
134 adding file changes
190 added 2 changesets with 0 changes to 0 files (+1 heads)
135 added 2 changesets with 0 changes to 0 files (+1 heads)
191 new changesets c70afb1ee985:f03ae5a9b979
136 new changesets c70afb1ee985:f03ae5a9b979
192 (run 'hg heads' to see heads, 'hg merge' to merge)
137 (run 'hg heads' to see heads, 'hg merge' to merge)
193 $ hg verify
138 $ hg verify -q
194 checking changesets
195 checking manifests
196 crosschecking files in changesets and manifests
197 checking files
198 checked 5 changesets with 3 changes to 1 files
199 $ hg pull http://localhost:$HGPORT/
139 $ hg pull http://localhost:$HGPORT/
200 pulling from http://localhost:$HGPORT/
140 pulling from http://localhost:$HGPORT/
201 searching for changes
141 searching for changes
202 adding changesets
142 adding changesets
203 adding manifests
143 adding manifests
204 adding file changes
144 adding file changes
205 added 4 changesets with 4 changes to 4 files
145 added 4 changesets with 4 changes to 4 files
206 new changesets 93ee6ab32777:916f1afdef90
146 new changesets 93ee6ab32777:916f1afdef90
207 (run 'hg update' to get a working copy)
147 (run 'hg update' to get a working copy)
208 $ hg verify
148 $ hg verify -q
209 checking changesets
210 checking manifests
211 crosschecking files in changesets and manifests
212 checking files
213 checked 9 changesets with 7 changes to 4 files
214 $ cd ..
149 $ cd ..
215
150
216 no default destination if url has no path:
151 no default destination if url has no path:
217
152
218 $ hg clone http://localhost:$HGPORT/
153 $ hg clone http://localhost:$HGPORT/
219 abort: empty destination path is not valid
154 abort: empty destination path is not valid
220 [10]
155 [10]
221
156
222 $ cat error.log
157 $ cat error.log
@@ -1,131 +1,121
1 #require serve
1 #require serve
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ hg ci -Ama -d '1123456789 0'
6 $ hg ci -Ama -d '1123456789 0'
7 adding a
7 adding a
8 $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid
8 $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid
9 $ cat hg.pid >> $DAEMON_PIDS
9 $ cat hg.pid >> $DAEMON_PIDS
10 $ cd ..
10 $ cd ..
11 $ tinyproxy.py $HGPORT1 localhost 2>proxy.log >/dev/null </dev/null &
11 $ tinyproxy.py $HGPORT1 localhost 2>proxy.log >/dev/null </dev/null &
12 $ while [ ! -f proxy.pid ]; do sleep 0; done
12 $ while [ ! -f proxy.pid ]; do sleep 0; done
13 $ cat proxy.pid >> $DAEMON_PIDS
13 $ cat proxy.pid >> $DAEMON_PIDS
14
14
15 url for proxy, stream
15 url for proxy, stream
16
16
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b
18 streaming all changes
18 streaming all changes
19 6 files to transfer, 412 bytes of data (reporevlogstore !)
19 6 files to transfer, 412 bytes of data (reporevlogstore !)
20 4 files to transfer, 330 bytes of data (reposimplestore !)
20 4 files to transfer, 330 bytes of data (reposimplestore !)
21 transferred * bytes in * seconds (*/sec) (glob)
21 transferred * bytes in * seconds (*/sec) (glob)
22 updating to branch default
22 updating to branch default
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 $ cd b
24 $ cd b
25 $ hg verify
25 $ hg verify -q
26 checking changesets
27 checking manifests
28 crosschecking files in changesets and manifests
29 checking files
30 checked 1 changesets with 1 changes to 1 files
31 $ cd ..
26 $ cd ..
32
27
33 url for proxy, pull
28 url for proxy, pull
34
29
35 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
30 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
36 requesting all changes
31 requesting all changes
37 adding changesets
32 adding changesets
38 adding manifests
33 adding manifests
39 adding file changes
34 adding file changes
40 added 1 changesets with 1 changes to 1 files
35 added 1 changesets with 1 changes to 1 files
41 new changesets 83180e7845de
36 new changesets 83180e7845de
42 updating to branch default
37 updating to branch default
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ cd b-pull
39 $ cd b-pull
45 $ hg verify
40 $ hg verify -q
46 checking changesets
47 checking manifests
48 crosschecking files in changesets and manifests
49 checking files
50 checked 1 changesets with 1 changes to 1 files
51 $ cd ..
41 $ cd ..
52
42
53 host:port for proxy
43 host:port for proxy
54
44
55 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
45 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
56 requesting all changes
46 requesting all changes
57 adding changesets
47 adding changesets
58 adding manifests
48 adding manifests
59 adding file changes
49 adding file changes
60 added 1 changesets with 1 changes to 1 files
50 added 1 changesets with 1 changes to 1 files
61 new changesets 83180e7845de
51 new changesets 83180e7845de
62 updating to branch default
52 updating to branch default
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64
54
65 proxy url with user name and password
55 proxy url with user name and password
66
56
67 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
57 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
68 requesting all changes
58 requesting all changes
69 adding changesets
59 adding changesets
70 adding manifests
60 adding manifests
71 adding file changes
61 adding file changes
72 added 1 changesets with 1 changes to 1 files
62 added 1 changesets with 1 changes to 1 files
73 new changesets 83180e7845de
63 new changesets 83180e7845de
74 updating to branch default
64 updating to branch default
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76
66
77 url with user name and password
67 url with user name and password
78
68
79 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
69 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
80 requesting all changes
70 requesting all changes
81 adding changesets
71 adding changesets
82 adding manifests
72 adding manifests
83 adding file changes
73 adding file changes
84 added 1 changesets with 1 changes to 1 files
74 added 1 changesets with 1 changes to 1 files
85 new changesets 83180e7845de
75 new changesets 83180e7845de
86 updating to branch default
76 updating to branch default
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88
78
89 bad host:port for proxy ("Protocol not supported" can happen on
79 bad host:port for proxy ("Protocol not supported" can happen on
90 misconfigured hosts)
80 misconfigured hosts)
91
81
92 $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
82 $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
93 abort: error: (Connection refused|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$|No route to host) (re)
83 abort: error: (Connection refused|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$|No route to host) (re)
94 [100]
84 [100]
95
85
96 do not use the proxy if it is in the no list
86 do not use the proxy if it is in the no list
97
87
98 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
88 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
99 requesting all changes
89 requesting all changes
100 adding changesets
90 adding changesets
101 adding manifests
91 adding manifests
102 adding file changes
92 adding file changes
103 added 1 changesets with 1 changes to 1 files
93 added 1 changesets with 1 changes to 1 files
104 new changesets 83180e7845de
94 new changesets 83180e7845de
105 updating to branch default
95 updating to branch default
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107
97
108 proxy can't connect to server
98 proxy can't connect to server
109
99
110 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT2/ h
100 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT2/ h
111 abort: HTTP Error 404: Connection refused
101 abort: HTTP Error 404: Connection refused
112 [100]
102 [100]
113
103
114 $ cat proxy.log
104 $ cat proxy.log
115 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
105 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
116 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
106 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
117 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
107 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
118 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
108 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
119 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
109 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
120 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
110 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
121 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
111 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
122 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
112 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
123 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
113 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
124 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
114 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
125 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
115 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
126 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
116 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
127 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
117 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
128 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
118 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
129 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
119 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
130 * - - [*] code 404, message Connection refused (glob)
120 * - - [*] code 404, message Connection refused (glob)
131 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT2/?cmd=capabilities HTTP/1.1" 404 - (glob)
121 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT2/?cmd=capabilities HTTP/1.1" 404 - (glob)
@@ -1,619 +1,609
1 #require serve
1 #require serve
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ echo foo>foo
5 $ echo foo>foo
6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
7 $ echo foo>foo.d/foo
7 $ echo foo>foo.d/foo
8 $ echo bar>foo.d/bAr.hg.d/BaR
8 $ echo bar>foo.d/bAr.hg.d/BaR
9 $ echo bar>foo.d/baR.d.hg/bAR
9 $ echo bar>foo.d/baR.d.hg/bAR
10 $ hg commit -A -m 1
10 $ hg commit -A -m 1
11 adding foo
11 adding foo
12 adding foo.d/bAr.hg.d/BaR
12 adding foo.d/bAr.hg.d/BaR
13 adding foo.d/baR.d.hg/bAR
13 adding foo.d/baR.d.hg/bAR
14 adding foo.d/foo
14 adding foo.d/foo
15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
16 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
16 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
17
17
18 Test server address cannot be reused
18 Test server address cannot be reused
19
19
20 $ hg serve -p $HGPORT1 2>&1
20 $ hg serve -p $HGPORT1 2>&1
21 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
21 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
22 [255]
22 [255]
23
23
24 $ cd ..
24 $ cd ..
25 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
25 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
26
26
27 clone via stream
27 clone via stream
28
28
29 #if no-reposimplestore
29 #if no-reposimplestore
30 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
30 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
31 streaming all changes
31 streaming all changes
32 9 files to transfer, 715 bytes of data (no-zstd !)
32 9 files to transfer, 715 bytes of data (no-zstd !)
33 9 files to transfer, 717 bytes of data (zstd !)
33 9 files to transfer, 717 bytes of data (zstd !)
34 transferred * bytes in * seconds (*/sec) (glob)
34 transferred * bytes in * seconds (*/sec) (glob)
35 updating to branch default
35 updating to branch default
36 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 $ hg verify -R copy
37 $ hg verify -R copy -q
38 checking changesets
39 checking manifests
40 crosschecking files in changesets and manifests
41 checking files
42 checked 1 changesets with 4 changes to 4 files
43 #endif
38 #endif
44
39
45 try to clone via stream, should use pull instead
40 try to clone via stream, should use pull instead
46
41
47 $ hg clone --stream http://localhost:$HGPORT1/ copy2
42 $ hg clone --stream http://localhost:$HGPORT1/ copy2
48 warning: stream clone requested but server has them disabled
43 warning: stream clone requested but server has them disabled
49 requesting all changes
44 requesting all changes
50 adding changesets
45 adding changesets
51 adding manifests
46 adding manifests
52 adding file changes
47 adding file changes
53 added 1 changesets with 4 changes to 4 files
48 added 1 changesets with 4 changes to 4 files
54 new changesets 8b6053c928fe
49 new changesets 8b6053c928fe
55 updating to branch default
50 updating to branch default
56 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
57
52
58 try to clone via stream but missing requirements, so should use pull instead
53 try to clone via stream but missing requirements, so should use pull instead
59
54
60 $ cat > $TESTTMP/removesupportedformat.py << EOF
55 $ cat > $TESTTMP/removesupportedformat.py << EOF
61 > from mercurial import localrepo
56 > from mercurial import localrepo
62 > def reposetup(ui, repo):
57 > def reposetup(ui, repo):
63 > local = repo.local()
58 > local = repo.local()
64 > if local is not None:
59 > if local is not None:
65 > local.supported.remove(b'generaldelta')
60 > local.supported.remove(b'generaldelta')
66 > EOF
61 > EOF
67
62
68 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
63 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
69 warning: stream clone requested but client is missing requirements: generaldelta
64 warning: stream clone requested but client is missing requirements: generaldelta
70 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
65 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
71 requesting all changes
66 requesting all changes
72 adding changesets
67 adding changesets
73 adding manifests
68 adding manifests
74 adding file changes
69 adding file changes
75 added 1 changesets with 4 changes to 4 files
70 added 1 changesets with 4 changes to 4 files
76 new changesets 8b6053c928fe
71 new changesets 8b6053c928fe
77 updating to branch default
72 updating to branch default
78 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
79
74
80 clone via pull
75 clone via pull
81
76
82 $ hg clone http://localhost:$HGPORT1/ copy-pull
77 $ hg clone http://localhost:$HGPORT1/ copy-pull
83 requesting all changes
78 requesting all changes
84 adding changesets
79 adding changesets
85 adding manifests
80 adding manifests
86 adding file changes
81 adding file changes
87 added 1 changesets with 4 changes to 4 files
82 added 1 changesets with 4 changes to 4 files
88 new changesets 8b6053c928fe
83 new changesets 8b6053c928fe
89 updating to branch default
84 updating to branch default
90 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 $ hg verify -R copy-pull
86 $ hg verify -R copy-pull -q
92 checking changesets
93 checking manifests
94 crosschecking files in changesets and manifests
95 checking files
96 checked 1 changesets with 4 changes to 4 files
97 $ cd test
87 $ cd test
98 $ echo bar > bar
88 $ echo bar > bar
99 $ hg commit -A -d '1 0' -m 2
89 $ hg commit -A -d '1 0' -m 2
100 adding bar
90 adding bar
101 $ cd ..
91 $ cd ..
102
92
103 clone over http with --update
93 clone over http with --update
104
94
105 $ hg clone http://localhost:$HGPORT1/ updated --update 0
95 $ hg clone http://localhost:$HGPORT1/ updated --update 0
106 requesting all changes
96 requesting all changes
107 adding changesets
97 adding changesets
108 adding manifests
98 adding manifests
109 adding file changes
99 adding file changes
110 added 2 changesets with 5 changes to 5 files
100 added 2 changesets with 5 changes to 5 files
111 new changesets 8b6053c928fe:5fed3813f7f5
101 new changesets 8b6053c928fe:5fed3813f7f5
112 updating to branch default
102 updating to branch default
113 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 $ hg log -r . -R updated
104 $ hg log -r . -R updated
115 changeset: 0:8b6053c928fe
105 changeset: 0:8b6053c928fe
116 user: test
106 user: test
117 date: Thu Jan 01 00:00:00 1970 +0000
107 date: Thu Jan 01 00:00:00 1970 +0000
118 summary: 1
108 summary: 1
119
109
120 $ rm -rf updated
110 $ rm -rf updated
121
111
122 incoming via HTTP
112 incoming via HTTP
123
113
124 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
114 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
125 adding changesets
115 adding changesets
126 adding manifests
116 adding manifests
127 adding file changes
117 adding file changes
128 added 1 changesets with 4 changes to 4 files
118 added 1 changesets with 4 changes to 4 files
129 new changesets 8b6053c928fe
119 new changesets 8b6053c928fe
130 updating to branch default
120 updating to branch default
131 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 $ cd partial
122 $ cd partial
133 $ touch LOCAL
123 $ touch LOCAL
134 $ hg ci -qAm LOCAL
124 $ hg ci -qAm LOCAL
135 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
125 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
136 comparing with http://localhost:$HGPORT1/
126 comparing with http://localhost:$HGPORT1/
137 searching for changes
127 searching for changes
138 2
128 2
139 $ cd ..
129 $ cd ..
140
130
141 pull
131 pull
142
132
143 $ cd copy-pull
133 $ cd copy-pull
144 $ cat >> .hg/hgrc <<EOF
134 $ cat >> .hg/hgrc <<EOF
145 > [hooks]
135 > [hooks]
146 > changegroup = sh -c "printenv.py --line changegroup"
136 > changegroup = sh -c "printenv.py --line changegroup"
147 > EOF
137 > EOF
148 $ hg pull
138 $ hg pull
149 pulling from http://localhost:$HGPORT1/
139 pulling from http://localhost:$HGPORT1/
150 searching for changes
140 searching for changes
151 adding changesets
141 adding changesets
152 adding manifests
142 adding manifests
153 adding file changes
143 adding file changes
154 added 1 changesets with 1 changes to 1 files
144 added 1 changesets with 1 changes to 1 files
155 new changesets 5fed3813f7f5
145 new changesets 5fed3813f7f5
156 changegroup hook: HG_HOOKNAME=changegroup
146 changegroup hook: HG_HOOKNAME=changegroup
157 HG_HOOKTYPE=changegroup
147 HG_HOOKTYPE=changegroup
158 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
148 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
159 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
149 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
160 HG_SOURCE=pull
150 HG_SOURCE=pull
161 HG_TXNID=TXN:$ID$
151 HG_TXNID=TXN:$ID$
162 HG_TXNNAME=pull
152 HG_TXNNAME=pull
163 http://localhost:$HGPORT1/
153 http://localhost:$HGPORT1/
164 HG_URL=http://localhost:$HGPORT1/
154 HG_URL=http://localhost:$HGPORT1/
165
155
166 (run 'hg update' to get a working copy)
156 (run 'hg update' to get a working copy)
167 $ cd ..
157 $ cd ..
168
158
169 clone from invalid URL
159 clone from invalid URL
170
160
171 $ hg clone http://localhost:$HGPORT/bad
161 $ hg clone http://localhost:$HGPORT/bad
172 abort: HTTP Error 404: Not Found
162 abort: HTTP Error 404: Not Found
173 [100]
163 [100]
174
164
175 test http authentication
165 test http authentication
176 + use the same server to test server side streaming preference
166 + use the same server to test server side streaming preference
177
167
178 $ cd test
168 $ cd test
179
169
180 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -p $HGPORT2 -d \
170 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -p $HGPORT2 -d \
181 > --pid-file=pid --config server.preferuncompressed=True -E ../errors2.log \
171 > --pid-file=pid --config server.preferuncompressed=True -E ../errors2.log \
182 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
172 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
183 $ cat pid >> $DAEMON_PIDS
173 $ cat pid >> $DAEMON_PIDS
184
174
185 $ cat << EOF > get_pass.py
175 $ cat << EOF > get_pass.py
186 > from mercurial import util
176 > from mercurial import util
187 > def newgetpass():
177 > def newgetpass():
188 > return "pass"
178 > return "pass"
189 > util.get_password = newgetpass
179 > util.get_password = newgetpass
190 > EOF
180 > EOF
191
181
192 $ hg id http://localhost:$HGPORT2/
182 $ hg id http://localhost:$HGPORT2/
193 abort: http authorization required for http://localhost:$HGPORT2/
183 abort: http authorization required for http://localhost:$HGPORT2/
194 [255]
184 [255]
195 $ hg id http://localhost:$HGPORT2/
185 $ hg id http://localhost:$HGPORT2/
196 abort: http authorization required for http://localhost:$HGPORT2/
186 abort: http authorization required for http://localhost:$HGPORT2/
197 [255]
187 [255]
198 $ hg id --config ui.interactive=true --debug http://localhost:$HGPORT2/
188 $ hg id --config ui.interactive=true --debug http://localhost:$HGPORT2/
199 using http://localhost:$HGPORT2/
189 using http://localhost:$HGPORT2/
200 sending capabilities command
190 sending capabilities command
201 http authorization required for http://localhost:$HGPORT2/
191 http authorization required for http://localhost:$HGPORT2/
202 realm: mercurial
192 realm: mercurial
203 user: abort: response expected
193 user: abort: response expected
204 [255]
194 [255]
205 $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/
195 $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/
206 >
196 >
207 > EOF
197 > EOF
208 using http://localhost:$HGPORT2/
198 using http://localhost:$HGPORT2/
209 sending capabilities command
199 sending capabilities command
210 http authorization required for http://localhost:$HGPORT2/
200 http authorization required for http://localhost:$HGPORT2/
211 realm: mercurial
201 realm: mercurial
212 user:
202 user:
213 password: abort: response expected
203 password: abort: response expected
214 [255]
204 [255]
215 $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/
205 $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/
216 >
206 >
217 >
207 >
218 > EOF
208 > EOF
219 using http://localhost:$HGPORT2/
209 using http://localhost:$HGPORT2/
220 sending capabilities command
210 sending capabilities command
221 http authorization required for http://localhost:$HGPORT2/
211 http authorization required for http://localhost:$HGPORT2/
222 realm: mercurial
212 realm: mercurial
223 user:
213 user:
224 password: abort: authorization failed
214 password: abort: authorization failed
225 [255]
215 [255]
226 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
216 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
227 http authorization required for http://localhost:$HGPORT2/
217 http authorization required for http://localhost:$HGPORT2/
228 realm: mercurial
218 realm: mercurial
229 user: user
219 user: user
230 password: 5fed3813f7f5
220 password: 5fed3813f7f5
231 $ hg id http://user:pass@localhost:$HGPORT2/
221 $ hg id http://user:pass@localhost:$HGPORT2/
232 5fed3813f7f5
222 5fed3813f7f5
233 $ echo '[auth]' >> .hg/hgrc
223 $ echo '[auth]' >> .hg/hgrc
234 $ echo 'l.schemes=http' >> .hg/hgrc
224 $ echo 'l.schemes=http' >> .hg/hgrc
235 $ echo 'l.prefix=lo' >> .hg/hgrc
225 $ echo 'l.prefix=lo' >> .hg/hgrc
236 $ echo 'l.username=user' >> .hg/hgrc
226 $ echo 'l.username=user' >> .hg/hgrc
237 $ echo 'l.password=pass' >> .hg/hgrc
227 $ echo 'l.password=pass' >> .hg/hgrc
238 $ hg id http://localhost:$HGPORT2/
228 $ hg id http://localhost:$HGPORT2/
239 5fed3813f7f5
229 5fed3813f7f5
240 $ hg id http://localhost:$HGPORT2/
230 $ hg id http://localhost:$HGPORT2/
241 5fed3813f7f5
231 5fed3813f7f5
242 $ hg id http://user@localhost:$HGPORT2/
232 $ hg id http://user@localhost:$HGPORT2/
243 5fed3813f7f5
233 5fed3813f7f5
244
234
245 $ cat > use_digests.py << EOF
235 $ cat > use_digests.py << EOF
246 > from mercurial import (
236 > from mercurial import (
247 > exthelper,
237 > exthelper,
248 > url,
238 > url,
249 > )
239 > )
250 >
240 >
251 > eh = exthelper.exthelper()
241 > eh = exthelper.exthelper()
252 > uisetup = eh.finaluisetup
242 > uisetup = eh.finaluisetup
253 >
243 >
254 > @eh.wrapfunction(url, 'opener')
244 > @eh.wrapfunction(url, 'opener')
255 > def urlopener(orig, *args, **kwargs):
245 > def urlopener(orig, *args, **kwargs):
256 > opener = orig(*args, **kwargs)
246 > opener = orig(*args, **kwargs)
257 > opener.addheaders.append((r'X-HgTest-AuthType', r'Digest'))
247 > opener.addheaders.append((r'X-HgTest-AuthType', r'Digest'))
258 > return opener
248 > return opener
259 > EOF
249 > EOF
260
250
261 $ hg id http://localhost:$HGPORT2/ --config extensions.x=use_digests.py
251 $ hg id http://localhost:$HGPORT2/ --config extensions.x=use_digests.py
262 5fed3813f7f5
252 5fed3813f7f5
263
253
264 #if no-reposimplestore
254 #if no-reposimplestore
265 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
255 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
266 streaming all changes
256 streaming all changes
267 10 files to transfer, 1.01 KB of data
257 10 files to transfer, 1.01 KB of data
268 transferred * KB in * seconds (*/sec) (glob)
258 transferred * KB in * seconds (*/sec) (glob)
269 updating to branch default
259 updating to branch default
270 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
260 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 #endif
261 #endif
272
262
273 --pull should override server's preferuncompressed
263 --pull should override server's preferuncompressed
274 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
264 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
275 requesting all changes
265 requesting all changes
276 adding changesets
266 adding changesets
277 adding manifests
267 adding manifests
278 adding file changes
268 adding file changes
279 added 2 changesets with 5 changes to 5 files
269 added 2 changesets with 5 changes to 5 files
280 new changesets 8b6053c928fe:5fed3813f7f5
270 new changesets 8b6053c928fe:5fed3813f7f5
281 updating to branch default
271 updating to branch default
282 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
283
273
284 $ hg id http://user2@localhost:$HGPORT2/
274 $ hg id http://user2@localhost:$HGPORT2/
285 abort: http authorization required for http://localhost:$HGPORT2/
275 abort: http authorization required for http://localhost:$HGPORT2/
286 [255]
276 [255]
287 $ hg id http://user:pass2@localhost:$HGPORT2/
277 $ hg id http://user:pass2@localhost:$HGPORT2/
288 abort: HTTP Error 403: no
278 abort: HTTP Error 403: no
289 [100]
279 [100]
290
280
291 $ hg -R dest-pull tag -r tip top
281 $ hg -R dest-pull tag -r tip top
292 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
282 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
293 pushing to http://user:***@localhost:$HGPORT2/
283 pushing to http://user:***@localhost:$HGPORT2/
294 searching for changes
284 searching for changes
295 remote: adding changesets
285 remote: adding changesets
296 remote: adding manifests
286 remote: adding manifests
297 remote: adding file changes
287 remote: adding file changes
298 remote: added 1 changesets with 1 changes to 1 files
288 remote: added 1 changesets with 1 changes to 1 files
299 $ hg rollback -q
289 $ hg rollback -q
300 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes
290 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes
301 pushing to http://user:***@localhost:$HGPORT2/
291 pushing to http://user:***@localhost:$HGPORT2/
302 using http://localhost:$HGPORT2/
292 using http://localhost:$HGPORT2/
303 http auth: user user, password ****
293 http auth: user user, password ****
304 sending capabilities command
294 sending capabilities command
305 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
295 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
306 http auth: user user, password ****
296 http auth: user user, password ****
307 devel-peer-request: finished in *.???? seconds (200) (glob)
297 devel-peer-request: finished in *.???? seconds (200) (glob)
308 query 1; heads
298 query 1; heads
309 devel-peer-request: batched-content
299 devel-peer-request: batched-content
310 devel-peer-request: - heads (0 arguments)
300 devel-peer-request: - heads (0 arguments)
311 devel-peer-request: - known (1 arguments)
301 devel-peer-request: - known (1 arguments)
312 sending batch command
302 sending batch command
313 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
303 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
314 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
304 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
315 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
305 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
316 devel-peer-request: 68 bytes of commands arguments in headers
306 devel-peer-request: 68 bytes of commands arguments in headers
317 devel-peer-request: finished in *.???? seconds (200) (glob)
307 devel-peer-request: finished in *.???? seconds (200) (glob)
318 searching for changes
308 searching for changes
319 all remote heads known locally
309 all remote heads known locally
320 preparing listkeys for "phases"
310 preparing listkeys for "phases"
321 sending listkeys command
311 sending listkeys command
322 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
312 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
323 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
313 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
324 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
314 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
325 devel-peer-request: 16 bytes of commands arguments in headers
315 devel-peer-request: 16 bytes of commands arguments in headers
326 devel-peer-request: finished in *.???? seconds (200) (glob)
316 devel-peer-request: finished in *.???? seconds (200) (glob)
327 received listkey for "phases": 58 bytes
317 received listkey for "phases": 58 bytes
328 checking for updated bookmarks
318 checking for updated bookmarks
329 preparing listkeys for "bookmarks"
319 preparing listkeys for "bookmarks"
330 sending listkeys command
320 sending listkeys command
331 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
321 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
332 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
322 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
333 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
323 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
334 devel-peer-request: 19 bytes of commands arguments in headers
324 devel-peer-request: 19 bytes of commands arguments in headers
335 devel-peer-request: finished in *.???? seconds (200) (glob)
325 devel-peer-request: finished in *.???? seconds (200) (glob)
336 received listkey for "bookmarks": 0 bytes
326 received listkey for "bookmarks": 0 bytes
337 sending branchmap command
327 sending branchmap command
338 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
328 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
339 devel-peer-request: Vary X-HgProto-1
329 devel-peer-request: Vary X-HgProto-1
340 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
330 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
341 devel-peer-request: finished in *.???? seconds (200) (glob)
331 devel-peer-request: finished in *.???? seconds (200) (glob)
342 preparing listkeys for "bookmarks"
332 preparing listkeys for "bookmarks"
343 sending listkeys command
333 sending listkeys command
344 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
334 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
345 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
335 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
346 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
336 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
347 devel-peer-request: 19 bytes of commands arguments in headers
337 devel-peer-request: 19 bytes of commands arguments in headers
348 devel-peer-request: finished in *.???? seconds (200) (glob)
338 devel-peer-request: finished in *.???? seconds (200) (glob)
349 received listkey for "bookmarks": 0 bytes
339 received listkey for "bookmarks": 0 bytes
350 1 changesets found
340 1 changesets found
351 list of changesets:
341 list of changesets:
352 7f4e523d01f2cc3765ac8934da3d14db775ff872
342 7f4e523d01f2cc3765ac8934da3d14db775ff872
353 bundle2-output-bundle: "HG20", 5 parts total
343 bundle2-output-bundle: "HG20", 5 parts total
354 bundle2-output-part: "replycaps" 207 bytes payload
344 bundle2-output-part: "replycaps" 207 bytes payload
355 bundle2-output-part: "check:phases" 24 bytes payload
345 bundle2-output-part: "check:phases" 24 bytes payload
356 bundle2-output-part: "check:updated-heads" streamed payload
346 bundle2-output-part: "check:updated-heads" streamed payload
357 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
347 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
358 bundle2-output-part: "phase-heads" 24 bytes payload
348 bundle2-output-part: "phase-heads" 24 bytes payload
359 sending unbundle command
349 sending unbundle command
360 sending 1023 bytes
350 sending 1023 bytes
361 devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle
351 devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle
362 devel-peer-request: Content-length 1023
352 devel-peer-request: Content-length 1023
363 devel-peer-request: Content-type application/mercurial-0.1
353 devel-peer-request: Content-type application/mercurial-0.1
364 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
354 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
365 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
355 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
366 devel-peer-request: 16 bytes of commands arguments in headers
356 devel-peer-request: 16 bytes of commands arguments in headers
367 devel-peer-request: 1023 bytes of data
357 devel-peer-request: 1023 bytes of data
368 devel-peer-request: finished in *.???? seconds (200) (glob)
358 devel-peer-request: finished in *.???? seconds (200) (glob)
369 bundle2-input-bundle: no-transaction
359 bundle2-input-bundle: no-transaction
370 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
360 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
371 bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
361 bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
372 bundle2-input-part: total payload size 55
362 bundle2-input-part: total payload size 55
373 remote: adding changesets
363 remote: adding changesets
374 remote: adding manifests
364 remote: adding manifests
375 remote: adding file changes
365 remote: adding file changes
376 bundle2-input-part: "output" (advisory) supported
366 bundle2-input-part: "output" (advisory) supported
377 bundle2-input-part: total payload size 45
367 bundle2-input-part: total payload size 45
378 remote: added 1 changesets with 1 changes to 1 files
368 remote: added 1 changesets with 1 changes to 1 files
379 bundle2-input-bundle: 3 parts total
369 bundle2-input-bundle: 3 parts total
380 preparing listkeys for "phases"
370 preparing listkeys for "phases"
381 sending listkeys command
371 sending listkeys command
382 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
372 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
383 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
373 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
384 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
374 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
385 devel-peer-request: 16 bytes of commands arguments in headers
375 devel-peer-request: 16 bytes of commands arguments in headers
386 devel-peer-request: finished in *.???? seconds (200) (glob)
376 devel-peer-request: finished in *.???? seconds (200) (glob)
387 received listkey for "phases": 15 bytes
377 received listkey for "phases": 15 bytes
388 (sent 9 HTTP requests and * bytes; received * bytes in responses) (glob) (?)
378 (sent 9 HTTP requests and * bytes; received * bytes in responses) (glob) (?)
389 $ hg rollback -q
379 $ hg rollback -q
390
380
391 $ sed 's/.*] "/"/' < ../access.log
381 $ sed 's/.*] "/"/' < ../access.log
392 "GET /?cmd=capabilities HTTP/1.1" 401 -
382 "GET /?cmd=capabilities HTTP/1.1" 401 -
393 "GET /?cmd=capabilities HTTP/1.1" 401 -
383 "GET /?cmd=capabilities HTTP/1.1" 401 -
394 "GET /?cmd=capabilities HTTP/1.1" 401 -
384 "GET /?cmd=capabilities HTTP/1.1" 401 -
395 "GET /?cmd=capabilities HTTP/1.1" 401 -
385 "GET /?cmd=capabilities HTTP/1.1" 401 -
396 "GET /?cmd=capabilities HTTP/1.1" 401 -
386 "GET /?cmd=capabilities HTTP/1.1" 401 -
397 "GET /?cmd=capabilities HTTP/1.1" 401 -
387 "GET /?cmd=capabilities HTTP/1.1" 401 -
398 "GET /?cmd=capabilities HTTP/1.1" 200 -
388 "GET /?cmd=capabilities HTTP/1.1" 200 -
399 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
389 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
400 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
390 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
401 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
391 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
402 "GET /?cmd=capabilities HTTP/1.1" 401 -
392 "GET /?cmd=capabilities HTTP/1.1" 401 -
403 "GET /?cmd=capabilities HTTP/1.1" 200 -
393 "GET /?cmd=capabilities HTTP/1.1" 200 -
404 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
394 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
405 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
395 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
406 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
396 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
407 "GET /?cmd=capabilities HTTP/1.1" 401 -
397 "GET /?cmd=capabilities HTTP/1.1" 401 -
408 "GET /?cmd=capabilities HTTP/1.1" 200 -
398 "GET /?cmd=capabilities HTTP/1.1" 200 -
409 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
399 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
410 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
400 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
411 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
401 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
412 "GET /?cmd=capabilities HTTP/1.1" 401 -
402 "GET /?cmd=capabilities HTTP/1.1" 401 -
413 "GET /?cmd=capabilities HTTP/1.1" 200 -
403 "GET /?cmd=capabilities HTTP/1.1" 200 -
414 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
404 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
415 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
405 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
416 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
406 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
417 "GET /?cmd=capabilities HTTP/1.1" 401 -
407 "GET /?cmd=capabilities HTTP/1.1" 401 -
418 "GET /?cmd=capabilities HTTP/1.1" 200 -
408 "GET /?cmd=capabilities HTTP/1.1" 200 -
419 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
409 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
420 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
410 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
421 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
411 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
422 "GET /?cmd=capabilities HTTP/1.1" 401 - x-hgtest-authtype:Digest
412 "GET /?cmd=capabilities HTTP/1.1" 401 - x-hgtest-authtype:Digest
423 "GET /?cmd=capabilities HTTP/1.1" 200 - x-hgtest-authtype:Digest
413 "GET /?cmd=capabilities HTTP/1.1" 200 - x-hgtest-authtype:Digest
424 "GET /?cmd=lookup HTTP/1.1" 401 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
414 "GET /?cmd=lookup HTTP/1.1" 401 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
425 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
415 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
426 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
416 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
427 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
417 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
428 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
418 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
429 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
419 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
430 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
420 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
431 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
421 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
432 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
422 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
433 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
423 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
434 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
424 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
435 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
425 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
436 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
426 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
437 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
427 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
438 "GET /?cmd=capabilities HTTP/1.1" 401 -
428 "GET /?cmd=capabilities HTTP/1.1" 401 -
439 "GET /?cmd=capabilities HTTP/1.1" 401 -
429 "GET /?cmd=capabilities HTTP/1.1" 401 -
440 "GET /?cmd=capabilities HTTP/1.1" 403 -
430 "GET /?cmd=capabilities HTTP/1.1" 403 -
441 "GET /?cmd=capabilities HTTP/1.1" 401 -
431 "GET /?cmd=capabilities HTTP/1.1" 401 -
442 "GET /?cmd=capabilities HTTP/1.1" 200 -
432 "GET /?cmd=capabilities HTTP/1.1" 200 -
443 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
433 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
444 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
434 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
445 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
435 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
446 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
436 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
447 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
437 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
448 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
438 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
449 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
439 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
450 "GET /?cmd=capabilities HTTP/1.1" 401 -
440 "GET /?cmd=capabilities HTTP/1.1" 401 -
451 "GET /?cmd=capabilities HTTP/1.1" 200 -
441 "GET /?cmd=capabilities HTTP/1.1" 200 -
452 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
442 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
453 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
443 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
454 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
444 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
455 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
445 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
456 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
446 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
457 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
447 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
458 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
448 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
459
449
460 $ cd ..
450 $ cd ..
461
451
462 clone of serve with repo in root and unserved subrepo (issue2970)
452 clone of serve with repo in root and unserved subrepo (issue2970)
463
453
464 $ hg --cwd test init sub
454 $ hg --cwd test init sub
465 $ echo empty > test/sub/empty
455 $ echo empty > test/sub/empty
466 $ hg --cwd test/sub add empty
456 $ hg --cwd test/sub add empty
467 $ hg --cwd test/sub commit -qm 'add empty'
457 $ hg --cwd test/sub commit -qm 'add empty'
468 $ hg --cwd test/sub tag -r 0 something
458 $ hg --cwd test/sub tag -r 0 something
469 $ echo sub = sub > test/.hgsub
459 $ echo sub = sub > test/.hgsub
470 $ hg --cwd test add .hgsub
460 $ hg --cwd test add .hgsub
471 $ hg --cwd test commit -qm 'add subrepo'
461 $ hg --cwd test commit -qm 'add subrepo'
472 $ hg clone http://localhost:$HGPORT noslash-clone
462 $ hg clone http://localhost:$HGPORT noslash-clone
473 requesting all changes
463 requesting all changes
474 adding changesets
464 adding changesets
475 adding manifests
465 adding manifests
476 adding file changes
466 adding file changes
477 added 3 changesets with 7 changes to 7 files
467 added 3 changesets with 7 changes to 7 files
478 new changesets 8b6053c928fe:56f9bc90cce6
468 new changesets 8b6053c928fe:56f9bc90cce6
479 updating to branch default
469 updating to branch default
480 cloning subrepo sub from http://localhost:$HGPORT/sub
470 cloning subrepo sub from http://localhost:$HGPORT/sub
481 abort: HTTP Error 404: Not Found
471 abort: HTTP Error 404: Not Found
482 [100]
472 [100]
483 $ hg clone http://localhost:$HGPORT/ slash-clone
473 $ hg clone http://localhost:$HGPORT/ slash-clone
484 requesting all changes
474 requesting all changes
485 adding changesets
475 adding changesets
486 adding manifests
476 adding manifests
487 adding file changes
477 adding file changes
488 added 3 changesets with 7 changes to 7 files
478 added 3 changesets with 7 changes to 7 files
489 new changesets 8b6053c928fe:56f9bc90cce6
479 new changesets 8b6053c928fe:56f9bc90cce6
490 updating to branch default
480 updating to branch default
491 cloning subrepo sub from http://localhost:$HGPORT/sub
481 cloning subrepo sub from http://localhost:$HGPORT/sub
492 abort: HTTP Error 404: Not Found
482 abort: HTTP Error 404: Not Found
493 [100]
483 [100]
494
484
495 check error log
485 check error log
496
486
497 $ cat error.log
487 $ cat error.log
498
488
499 $ cat errors2.log
489 $ cat errors2.log
500
490
501 check abort error reporting while pulling/cloning
491 check abort error reporting while pulling/cloning
502
492
503 $ $RUNTESTDIR/killdaemons.py
493 $ $RUNTESTDIR/killdaemons.py
504 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
494 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
505 $ cat hg3.pid >> $DAEMON_PIDS
495 $ cat hg3.pid >> $DAEMON_PIDS
506 $ hg clone http://localhost:$HGPORT/ abort-clone
496 $ hg clone http://localhost:$HGPORT/ abort-clone
507 requesting all changes
497 requesting all changes
508 remote: abort: this is an exercise
498 remote: abort: this is an exercise
509 abort: pull failed on remote
499 abort: pull failed on remote
510 [100]
500 [100]
511 $ cat error.log
501 $ cat error.log
512
502
513 disable pull-based clones
503 disable pull-based clones
514
504
515 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
505 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
516 $ cat hg4.pid >> $DAEMON_PIDS
506 $ cat hg4.pid >> $DAEMON_PIDS
517 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
507 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
518 requesting all changes
508 requesting all changes
519 remote: abort: server has pull-based clones disabled
509 remote: abort: server has pull-based clones disabled
520 abort: pull failed on remote
510 abort: pull failed on remote
521 (remove --pull if specified or upgrade Mercurial)
511 (remove --pull if specified or upgrade Mercurial)
522 [100]
512 [100]
523
513
524 #if no-reposimplestore
514 #if no-reposimplestore
525 ... but keep stream clones working
515 ... but keep stream clones working
526
516
527 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
517 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
528 streaming all changes
518 streaming all changes
529 * files to transfer, * of data (glob)
519 * files to transfer, * of data (glob)
530 transferred * in * seconds (*/sec) (glob)
520 transferred * in * seconds (*/sec) (glob)
531 $ cat error.log
521 $ cat error.log
532 #endif
522 #endif
533
523
534 ... and also keep partial clones and pulls working
524 ... and also keep partial clones and pulls working
535 $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone
525 $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone
536 adding changesets
526 adding changesets
537 adding manifests
527 adding manifests
538 adding file changes
528 adding file changes
539 added 1 changesets with 4 changes to 4 files
529 added 1 changesets with 4 changes to 4 files
540 new changesets 8b6053c928fe
530 new changesets 8b6053c928fe
541 updating to branch default
531 updating to branch default
542 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
532 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
543 $ hg pull -R test/partial/clone
533 $ hg pull -R test/partial/clone
544 pulling from http://localhost:$HGPORT1/
534 pulling from http://localhost:$HGPORT1/
545 searching for changes
535 searching for changes
546 adding changesets
536 adding changesets
547 adding manifests
537 adding manifests
548 adding file changes
538 adding file changes
549 added 2 changesets with 3 changes to 3 files
539 added 2 changesets with 3 changes to 3 files
550 new changesets 5fed3813f7f5:56f9bc90cce6
540 new changesets 5fed3813f7f5:56f9bc90cce6
551 (run 'hg update' to get a working copy)
541 (run 'hg update' to get a working copy)
552
542
553 $ hg clone -U -r 0 test/partial/clone test/another/clone
543 $ hg clone -U -r 0 test/partial/clone test/another/clone
554 adding changesets
544 adding changesets
555 adding manifests
545 adding manifests
556 adding file changes
546 adding file changes
557 added 1 changesets with 4 changes to 4 files
547 added 1 changesets with 4 changes to 4 files
558 new changesets 8b6053c928fe
548 new changesets 8b6053c928fe
559
549
560 corrupt cookies file should yield a warning
550 corrupt cookies file should yield a warning
561
551
562 $ cat > $TESTTMP/cookies.txt << EOF
552 $ cat > $TESTTMP/cookies.txt << EOF
563 > bad format
553 > bad format
564 > EOF
554 > EOF
565
555
566 $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
556 $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
567 (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob)
557 (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob)
568 56f9bc90cce6
558 56f9bc90cce6
569
559
570 $ killdaemons.py
560 $ killdaemons.py
571
561
572 Create dummy authentication handler that looks for cookies. It doesn't do anything
562 Create dummy authentication handler that looks for cookies. It doesn't do anything
573 useful. It just raises an HTTP 500 with details about the Cookie request header.
563 useful. It just raises an HTTP 500 with details about the Cookie request header.
574 We raise HTTP 500 because its message is printed in the abort message.
564 We raise HTTP 500 because its message is printed in the abort message.
575
565
576 $ cat > cookieauth.py << EOF
566 $ cat > cookieauth.py << EOF
577 > from mercurial import util
567 > from mercurial import util
578 > from mercurial.hgweb import common
568 > from mercurial.hgweb import common
579 > def perform_authentication(hgweb, req, op):
569 > def perform_authentication(hgweb, req, op):
580 > cookie = req.headers.get(b'Cookie')
570 > cookie = req.headers.get(b'Cookie')
581 > if not cookie:
571 > if not cookie:
582 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
572 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
583 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie)
573 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie)
584 > def extsetup(ui):
574 > def extsetup(ui):
585 > common.permhooks.insert(0, perform_authentication)
575 > common.permhooks.insert(0, perform_authentication)
586 > EOF
576 > EOF
587
577
588 $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
578 $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
589 $ cat pid > $DAEMON_PIDS
579 $ cat pid > $DAEMON_PIDS
590
580
591 Request without cookie sent should fail due to lack of cookie
581 Request without cookie sent should fail due to lack of cookie
592
582
593 $ hg id http://localhost:$HGPORT
583 $ hg id http://localhost:$HGPORT
594 abort: HTTP Error 500: no-cookie
584 abort: HTTP Error 500: no-cookie
595 [100]
585 [100]
596
586
597 Populate a cookies file
587 Populate a cookies file
598
588
599 $ cat > cookies.txt << EOF
589 $ cat > cookies.txt << EOF
600 > # HTTP Cookie File
590 > # HTTP Cookie File
601 > # Expiration is 2030-01-01 at midnight
591 > # Expiration is 2030-01-01 at midnight
602 > .example.com TRUE / FALSE 1893456000 hgkey examplevalue
592 > .example.com TRUE / FALSE 1893456000 hgkey examplevalue
603 > EOF
593 > EOF
604
594
605 Should not send a cookie for another domain
595 Should not send a cookie for another domain
606
596
607 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
597 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
608 abort: HTTP Error 500: no-cookie
598 abort: HTTP Error 500: no-cookie
609 [100]
599 [100]
610
600
611 Add a cookie entry for our test server and verify it is sent
601 Add a cookie entry for our test server and verify it is sent
612
602
613 $ cat >> cookies.txt << EOF
603 $ cat >> cookies.txt << EOF
614 > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
604 > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
615 > EOF
605 > EOF
616
606
617 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
607 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
618 abort: HTTP Error 500: Cookie: hgkey=localhostvalue
608 abort: HTTP Error 500: Cookie: hgkey=localhostvalue
619 [100]
609 [100]
@@ -1,562 +1,557
1 #require serve ssl
1 #require serve ssl
2
2
3 Proper https client requires the built-in ssl from Python 2.6.
3 Proper https client requires the built-in ssl from Python 2.6.
4
4
5 Disable the system configuration which may set stricter TLS requirements.
5 Disable the system configuration which may set stricter TLS requirements.
6 This test expects that legacy TLS versions are supported.
6 This test expects that legacy TLS versions are supported.
7
7
8 $ OPENSSL_CONF=
8 $ OPENSSL_CONF=
9 $ export OPENSSL_CONF
9 $ export OPENSSL_CONF
10
10
11 Make server certificates:
11 Make server certificates:
12
12
13 $ CERTSDIR="$TESTDIR/sslcerts"
13 $ CERTSDIR="$TESTDIR/sslcerts"
14 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub.pem" >> server.pem
14 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub.pem" >> server.pem
15 $ PRIV=`pwd`/server.pem
15 $ PRIV=`pwd`/server.pem
16 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-not-yet.pem" > server-not-yet.pem
16 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-not-yet.pem" > server-not-yet.pem
17 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-expired.pem" > server-expired.pem
17 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-expired.pem" > server-expired.pem
18
18
19 $ hg init test
19 $ hg init test
20 $ cd test
20 $ cd test
21 $ echo foo>foo
21 $ echo foo>foo
22 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
22 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
23 $ echo foo>foo.d/foo
23 $ echo foo>foo.d/foo
24 $ echo bar>foo.d/bAr.hg.d/BaR
24 $ echo bar>foo.d/bAr.hg.d/BaR
25 $ echo bar>foo.d/baR.d.hg/bAR
25 $ echo bar>foo.d/baR.d.hg/bAR
26 $ hg commit -A -m 1
26 $ hg commit -A -m 1
27 adding foo
27 adding foo
28 adding foo.d/bAr.hg.d/BaR
28 adding foo.d/bAr.hg.d/BaR
29 adding foo.d/baR.d.hg/bAR
29 adding foo.d/baR.d.hg/bAR
30 adding foo.d/foo
30 adding foo.d/foo
31 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV
31 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV
32 $ cat ../hg0.pid >> $DAEMON_PIDS
32 $ cat ../hg0.pid >> $DAEMON_PIDS
33
33
34 cacert not found
34 cacert not found
35
35
36 $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/
36 $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/
37 abort: could not find web.cacerts: no-such.pem
37 abort: could not find web.cacerts: no-such.pem
38 [255]
38 [255]
39
39
40 Test server address cannot be reused
40 Test server address cannot be reused
41
41
42 $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
42 $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
43 abort: cannot start server at 'localhost:$HGPORT': $EADDRINUSE$
43 abort: cannot start server at 'localhost:$HGPORT': $EADDRINUSE$
44 [255]
44 [255]
45
45
46 $ cd ..
46 $ cd ..
47
47
48 Our test cert is not signed by a trusted CA. It should fail to verify if
48 Our test cert is not signed by a trusted CA. It should fail to verify if
49 we are able to load CA certs.
49 we are able to load CA certs.
50
50
51 #if no-defaultcacertsloaded
51 #if no-defaultcacertsloaded
52 $ hg clone https://localhost:$HGPORT/ copy-pull
52 $ hg clone https://localhost:$HGPORT/ copy-pull
53 (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
53 (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
54 abort: error: *certificate verify failed* (glob)
54 abort: error: *certificate verify failed* (glob)
55 [100]
55 [100]
56 #endif
56 #endif
57
57
58 #if defaultcacertsloaded
58 #if defaultcacertsloaded
59 $ hg clone https://localhost:$HGPORT/ copy-pull
59 $ hg clone https://localhost:$HGPORT/ copy-pull
60 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
60 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
61 abort: error: *certificate verify failed* (glob)
61 abort: error: *certificate verify failed* (glob)
62 [100]
62 [100]
63 #endif
63 #endif
64
64
65 Specifying a per-host certificate file that doesn't exist will abort. The full
65 Specifying a per-host certificate file that doesn't exist will abort. The full
66 C:/path/to/msysroot will print on Windows.
66 C:/path/to/msysroot will print on Windows.
67
67
68 $ hg --config hostsecurity.localhost:verifycertsfile=/does/not/exist clone https://localhost:$HGPORT/
68 $ hg --config hostsecurity.localhost:verifycertsfile=/does/not/exist clone https://localhost:$HGPORT/
69 abort: path specified by hostsecurity.localhost:verifycertsfile does not exist: */does/not/exist (glob)
69 abort: path specified by hostsecurity.localhost:verifycertsfile does not exist: */does/not/exist (glob)
70 [255]
70 [255]
71
71
72 A malformed per-host certificate file will raise an error
72 A malformed per-host certificate file will raise an error
73
73
74 $ echo baddata > badca.pem
74 $ echo baddata > badca.pem
75 $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
75 $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
76 abort: error loading CA file badca.pem: * (glob)
76 abort: error loading CA file badca.pem: * (glob)
77 (file is empty or malformed?)
77 (file is empty or malformed?)
78 [255]
78 [255]
79
79
80 A per-host certificate mismatching the server will fail verification
80 A per-host certificate mismatching the server will fail verification
81
81
82 (modern ssl is able to discern whether the loaded cert is a CA cert)
82 (modern ssl is able to discern whether the loaded cert is a CA cert)
83 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
83 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
84 (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
84 (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
85 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
85 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
86 abort: error: *certificate verify failed* (glob)
86 abort: error: *certificate verify failed* (glob)
87 [100]
87 [100]
88
88
89 A per-host certificate matching the server's cert will be accepted
89 A per-host certificate matching the server's cert will be accepted
90
90
91 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1
91 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1
92 requesting all changes
92 requesting all changes
93 adding changesets
93 adding changesets
94 adding manifests
94 adding manifests
95 adding file changes
95 adding file changes
96 added 1 changesets with 4 changes to 4 files
96 added 1 changesets with 4 changes to 4 files
97 new changesets 8b6053c928fe
97 new changesets 8b6053c928fe
98
98
99 A per-host certificate with multiple certs and one matching will be accepted
99 A per-host certificate with multiple certs and one matching will be accepted
100
100
101 $ cat "$CERTSDIR/client-cert.pem" "$CERTSDIR/pub.pem" > perhost.pem
101 $ cat "$CERTSDIR/client-cert.pem" "$CERTSDIR/pub.pem" > perhost.pem
102 $ hg --config hostsecurity.localhost:verifycertsfile=perhost.pem clone -U https://localhost:$HGPORT/ perhostgood2
102 $ hg --config hostsecurity.localhost:verifycertsfile=perhost.pem clone -U https://localhost:$HGPORT/ perhostgood2
103 requesting all changes
103 requesting all changes
104 adding changesets
104 adding changesets
105 adding manifests
105 adding manifests
106 adding file changes
106 adding file changes
107 added 1 changesets with 4 changes to 4 files
107 added 1 changesets with 4 changes to 4 files
108 new changesets 8b6053c928fe
108 new changesets 8b6053c928fe
109
109
110 Defining both per-host certificate and a fingerprint will print a warning
110 Defining both per-host certificate and a fingerprint will print a warning
111
111
112 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 clone -U https://localhost:$HGPORT/ caandfingerwarning
112 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 clone -U https://localhost:$HGPORT/ caandfingerwarning
113 (hostsecurity.localhost:verifycertsfile ignored when host fingerprints defined; using host fingerprints for verification)
113 (hostsecurity.localhost:verifycertsfile ignored when host fingerprints defined; using host fingerprints for verification)
114 requesting all changes
114 requesting all changes
115 adding changesets
115 adding changesets
116 adding manifests
116 adding manifests
117 adding file changes
117 adding file changes
118 added 1 changesets with 4 changes to 4 files
118 added 1 changesets with 4 changes to 4 files
119 new changesets 8b6053c928fe
119 new changesets 8b6053c928fe
120
120
121 $ DISABLECACERTS="--config devel.disableloaddefaultcerts=true"
121 $ DISABLECACERTS="--config devel.disableloaddefaultcerts=true"
122
122
123 Inability to verify peer certificate will result in abort
123 Inability to verify peer certificate will result in abort
124
124
125 $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLECACERTS
125 $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLECACERTS
126 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
126 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
127 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)
127 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)
128 [150]
128 [150]
129
129
130 $ hg clone --insecure https://localhost:$HGPORT/ copy-pull
130 $ hg clone --insecure https://localhost:$HGPORT/ copy-pull
131 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
131 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
132 requesting all changes
132 requesting all changes
133 adding changesets
133 adding changesets
134 adding manifests
134 adding manifests
135 adding file changes
135 adding file changes
136 added 1 changesets with 4 changes to 4 files
136 added 1 changesets with 4 changes to 4 files
137 new changesets 8b6053c928fe
137 new changesets 8b6053c928fe
138 updating to branch default
138 updating to branch default
139 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 $ hg verify -R copy-pull
140 $ hg verify -R copy-pull -q
141 checking changesets
142 checking manifests
143 crosschecking files in changesets and manifests
144 checking files
145 checked 1 changesets with 4 changes to 4 files
146 $ cd test
141 $ cd test
147 $ echo bar > bar
142 $ echo bar > bar
148 $ hg commit -A -d '1 0' -m 2
143 $ hg commit -A -d '1 0' -m 2
149 adding bar
144 adding bar
150 $ cd ..
145 $ cd ..
151
146
152 pull without cacert
147 pull without cacert
153
148
154 $ cd copy-pull
149 $ cd copy-pull
155 $ cat >> .hg/hgrc <<EOF
150 $ cat >> .hg/hgrc <<EOF
156 > [hooks]
151 > [hooks]
157 > changegroup = sh -c "printenv.py --line changegroup"
152 > changegroup = sh -c "printenv.py --line changegroup"
158 > EOF
153 > EOF
159 $ hg pull $DISABLECACERTS
154 $ hg pull $DISABLECACERTS
160 pulling from https://localhost:$HGPORT/
155 pulling from https://localhost:$HGPORT/
161 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
156 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
162 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)
157 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)
163 [150]
158 [150]
164
159
165 $ hg pull --insecure
160 $ hg pull --insecure
166 pulling from https://localhost:$HGPORT/
161 pulling from https://localhost:$HGPORT/
167 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
162 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
168 searching for changes
163 searching for changes
169 adding changesets
164 adding changesets
170 adding manifests
165 adding manifests
171 adding file changes
166 adding file changes
172 added 1 changesets with 1 changes to 1 files
167 added 1 changesets with 1 changes to 1 files
173 new changesets 5fed3813f7f5
168 new changesets 5fed3813f7f5
174 changegroup hook: HG_HOOKNAME=changegroup
169 changegroup hook: HG_HOOKNAME=changegroup
175 HG_HOOKTYPE=changegroup
170 HG_HOOKTYPE=changegroup
176 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
171 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
177 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
172 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
178 HG_SOURCE=pull
173 HG_SOURCE=pull
179 HG_TXNID=TXN:$ID$
174 HG_TXNID=TXN:$ID$
180 HG_TXNNAME=pull
175 HG_TXNNAME=pull
181 https://localhost:$HGPORT/
176 https://localhost:$HGPORT/
182 HG_URL=https://localhost:$HGPORT/
177 HG_URL=https://localhost:$HGPORT/
183
178
184 (run 'hg update' to get a working copy)
179 (run 'hg update' to get a working copy)
185 $ cd ..
180 $ cd ..
186
181
187 cacert configured in local repo
182 cacert configured in local repo
188
183
189 $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu
184 $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu
190 $ echo "[web]" >> copy-pull/.hg/hgrc
185 $ echo "[web]" >> copy-pull/.hg/hgrc
191 $ echo "cacerts=$CERTSDIR/pub.pem" >> copy-pull/.hg/hgrc
186 $ echo "cacerts=$CERTSDIR/pub.pem" >> copy-pull/.hg/hgrc
192 $ hg -R copy-pull pull
187 $ hg -R copy-pull pull
193 pulling from https://localhost:$HGPORT/
188 pulling from https://localhost:$HGPORT/
194 searching for changes
189 searching for changes
195 no changes found
190 no changes found
196 $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc
191 $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc
197
192
198 cacert configured globally, also testing expansion of environment
193 cacert configured globally, also testing expansion of environment
199 variables in the filename
194 variables in the filename
200
195
201 $ echo "[web]" >> $HGRCPATH
196 $ echo "[web]" >> $HGRCPATH
202 $ echo 'cacerts=$P/pub.pem' >> $HGRCPATH
197 $ echo 'cacerts=$P/pub.pem' >> $HGRCPATH
203 $ P="$CERTSDIR" hg -R copy-pull pull
198 $ P="$CERTSDIR" hg -R copy-pull pull
204 pulling from https://localhost:$HGPORT/
199 pulling from https://localhost:$HGPORT/
205 searching for changes
200 searching for changes
206 no changes found
201 no changes found
207 $ P="$CERTSDIR" hg -R copy-pull pull --insecure
202 $ P="$CERTSDIR" hg -R copy-pull pull --insecure
208 pulling from https://localhost:$HGPORT/
203 pulling from https://localhost:$HGPORT/
209 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
204 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
210 searching for changes
205 searching for changes
211 no changes found
206 no changes found
212
207
213 empty cacert file
208 empty cacert file
214
209
215 $ touch emptycafile
210 $ touch emptycafile
216
211
217 $ hg --config web.cacerts=emptycafile -R copy-pull pull
212 $ hg --config web.cacerts=emptycafile -R copy-pull pull
218 pulling from https://localhost:$HGPORT/
213 pulling from https://localhost:$HGPORT/
219 abort: error loading CA file emptycafile: * (glob)
214 abort: error loading CA file emptycafile: * (glob)
220 (file is empty or malformed?)
215 (file is empty or malformed?)
221 [255]
216 [255]
222
217
223 cacert mismatch
218 cacert mismatch
224
219
225 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
220 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
226 > https://$LOCALIP:$HGPORT/
221 > https://$LOCALIP:$HGPORT/
227 pulling from https://*:$HGPORT/ (glob)
222 pulling from https://*:$HGPORT/ (glob)
228 abort: $LOCALIP certificate error: certificate is for localhost (glob)
223 abort: $LOCALIP certificate error: certificate is for localhost (glob)
229 (set hostsecurity.$LOCALIP:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
224 (set hostsecurity.$LOCALIP:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
230 [150]
225 [150]
231 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
226 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
232 > https://$LOCALIP:$HGPORT/ --insecure
227 > https://$LOCALIP:$HGPORT/ --insecure
233 pulling from https://*:$HGPORT/ (glob)
228 pulling from https://*:$HGPORT/ (glob)
234 warning: connection security to $LOCALIP is disabled per current settings; communication is susceptible to eavesdropping and tampering (glob)
229 warning: connection security to $LOCALIP is disabled per current settings; communication is susceptible to eavesdropping and tampering (glob)
235 searching for changes
230 searching for changes
236 no changes found
231 no changes found
237 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem"
232 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem"
238 pulling from https://localhost:$HGPORT/
233 pulling from https://localhost:$HGPORT/
239 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
234 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
240 abort: error: *certificate verify failed* (glob)
235 abort: error: *certificate verify failed* (glob)
241 [100]
236 [100]
242 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" \
237 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" \
243 > --insecure
238 > --insecure
244 pulling from https://localhost:$HGPORT/
239 pulling from https://localhost:$HGPORT/
245 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
240 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
246 searching for changes
241 searching for changes
247 no changes found
242 no changes found
248
243
249 Test server cert which isn't valid yet
244 Test server cert which isn't valid yet
250
245
251 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg1.pid --certificate=server-not-yet.pem
246 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg1.pid --certificate=server-not-yet.pem
252 $ cat hg1.pid >> $DAEMON_PIDS
247 $ cat hg1.pid >> $DAEMON_PIDS
253 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-not-yet.pem" \
248 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-not-yet.pem" \
254 > https://localhost:$HGPORT1/
249 > https://localhost:$HGPORT1/
255 pulling from https://localhost:$HGPORT1/
250 pulling from https://localhost:$HGPORT1/
256 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
251 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
257 abort: error: *certificate verify failed* (glob)
252 abort: error: *certificate verify failed* (glob)
258 [100]
253 [100]
259
254
260 Test server cert which no longer is valid
255 Test server cert which no longer is valid
261
256
262 $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
257 $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
263 $ cat hg2.pid >> $DAEMON_PIDS
258 $ cat hg2.pid >> $DAEMON_PIDS
264 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-expired.pem" \
259 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-expired.pem" \
265 > https://localhost:$HGPORT2/
260 > https://localhost:$HGPORT2/
266 pulling from https://localhost:$HGPORT2/
261 pulling from https://localhost:$HGPORT2/
267 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
262 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
268 abort: error: *certificate verify failed* (glob)
263 abort: error: *certificate verify failed* (glob)
269 [100]
264 [100]
270
265
271 Setting ciphers to an invalid value aborts
266 Setting ciphers to an invalid value aborts
272 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
267 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
273 abort: could not set ciphers: No cipher can be selected.
268 abort: could not set ciphers: No cipher can be selected.
274 (change cipher string (invalid) in config)
269 (change cipher string (invalid) in config)
275 [255]
270 [255]
276
271
277 $ P="$CERTSDIR" hg --config hostsecurity.localhost:ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
272 $ P="$CERTSDIR" hg --config hostsecurity.localhost:ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
278 abort: could not set ciphers: No cipher can be selected.
273 abort: could not set ciphers: No cipher can be selected.
279 (change cipher string (invalid) in config)
274 (change cipher string (invalid) in config)
280 [255]
275 [255]
281
276
282 Changing the cipher string works
277 Changing the cipher string works
283
278
284 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/
279 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/
285 5fed3813f7f5
280 5fed3813f7f5
286
281
287 Fingerprints
282 Fingerprints
288
283
289 - works without cacerts (hostfingerprints)
284 - works without cacerts (hostfingerprints)
290 $ hg -R copy-pull id https://localhost:$HGPORT/ --insecure --config hostfingerprints.localhost=ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
285 $ hg -R copy-pull id https://localhost:$HGPORT/ --insecure --config hostfingerprints.localhost=ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
291 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
286 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
292 5fed3813f7f5
287 5fed3813f7f5
293
288
294 - works without cacerts (hostsecurity)
289 - works without cacerts (hostsecurity)
295 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
290 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
296 5fed3813f7f5
291 5fed3813f7f5
297
292
298 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e
293 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e
299 5fed3813f7f5
294 5fed3813f7f5
300
295
301 - multiple fingerprints specified and first matches
296 - multiple fingerprints specified and first matches
302 $ hg --config 'hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
297 $ hg --config 'hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
303 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
298 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
304 5fed3813f7f5
299 5fed3813f7f5
305
300
306 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/
301 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/
307 5fed3813f7f5
302 5fed3813f7f5
308
303
309 - multiple fingerprints specified and last matches
304 - multiple fingerprints specified and last matches
310 $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ --insecure
305 $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ --insecure
311 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
306 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
312 5fed3813f7f5
307 5fed3813f7f5
313
308
314 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/
309 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/
315 5fed3813f7f5
310 5fed3813f7f5
316
311
317 - multiple fingerprints specified and none match
312 - multiple fingerprints specified and none match
318
313
319 $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
314 $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
320 abort: certificate for localhost has unexpected fingerprint ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
315 abort: certificate for localhost has unexpected fingerprint ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
321 (check hostfingerprint configuration)
316 (check hostfingerprint configuration)
322 [150]
317 [150]
323
318
324 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/
319 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/
325 abort: certificate for localhost has unexpected fingerprint sha1:ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
320 abort: certificate for localhost has unexpected fingerprint sha1:ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
326 (check hostsecurity configuration)
321 (check hostsecurity configuration)
327 [150]
322 [150]
328
323
329 - fails when cert doesn't match hostname (port is ignored)
324 - fails when cert doesn't match hostname (port is ignored)
330 $ hg -R copy-pull id https://localhost:$HGPORT1/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
325 $ hg -R copy-pull id https://localhost:$HGPORT1/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
331 abort: certificate for localhost has unexpected fingerprint f4:2f:5a:0c:3e:52:5b:db:e7:24:a8:32:1d:18:97:6d:69:b5:87:84
326 abort: certificate for localhost has unexpected fingerprint f4:2f:5a:0c:3e:52:5b:db:e7:24:a8:32:1d:18:97:6d:69:b5:87:84
332 (check hostfingerprint configuration)
327 (check hostfingerprint configuration)
333 [150]
328 [150]
334
329
335
330
336 - ignores that certificate doesn't match hostname
331 - ignores that certificate doesn't match hostname
337 $ hg -R copy-pull id https://$LOCALIP:$HGPORT/ --config hostfingerprints.$LOCALIP=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
332 $ hg -R copy-pull id https://$LOCALIP:$HGPORT/ --config hostfingerprints.$LOCALIP=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
338 (SHA-1 fingerprint for $LOCALIP found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: $LOCALIP:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
333 (SHA-1 fingerprint for $LOCALIP found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: $LOCALIP:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
339 5fed3813f7f5
334 5fed3813f7f5
340
335
341 Ports used by next test. Kill servers.
336 Ports used by next test. Kill servers.
342
337
343 $ killdaemons.py hg0.pid
338 $ killdaemons.py hg0.pid
344 $ killdaemons.py hg1.pid
339 $ killdaemons.py hg1.pid
345 $ killdaemons.py hg2.pid
340 $ killdaemons.py hg2.pid
346
341
347 #if tls1.2
342 #if tls1.2
348 Start servers running supported TLS versions
343 Start servers running supported TLS versions
349
344
350 $ cd test
345 $ cd test
351 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
346 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
352 > --config devel.serverexactprotocol=tls1.0
347 > --config devel.serverexactprotocol=tls1.0
353 $ cat ../hg0.pid >> $DAEMON_PIDS
348 $ cat ../hg0.pid >> $DAEMON_PIDS
354 $ hg serve -p $HGPORT1 -d --pid-file=../hg1.pid --certificate=$PRIV \
349 $ hg serve -p $HGPORT1 -d --pid-file=../hg1.pid --certificate=$PRIV \
355 > --config devel.serverexactprotocol=tls1.1
350 > --config devel.serverexactprotocol=tls1.1
356 $ cat ../hg1.pid >> $DAEMON_PIDS
351 $ cat ../hg1.pid >> $DAEMON_PIDS
357 $ hg serve -p $HGPORT2 -d --pid-file=../hg2.pid --certificate=$PRIV \
352 $ hg serve -p $HGPORT2 -d --pid-file=../hg2.pid --certificate=$PRIV \
358 > --config devel.serverexactprotocol=tls1.2
353 > --config devel.serverexactprotocol=tls1.2
359 $ cat ../hg2.pid >> $DAEMON_PIDS
354 $ cat ../hg2.pid >> $DAEMON_PIDS
360 $ cd ..
355 $ cd ..
361
356
362 Clients talking same TLS versions work
357 Clients talking same TLS versions work
363
358
364 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 --config hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT/
359 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 --config hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT/
365 5fed3813f7f5
360 5fed3813f7f5
366 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 --config hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT1/
361 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 --config hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT1/
367 5fed3813f7f5
362 5fed3813f7f5
368 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/
363 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/
369 5fed3813f7f5
364 5fed3813f7f5
370
365
371 Clients requiring newer TLS version than what server supports fail
366 Clients requiring newer TLS version than what server supports fail
372
367
373 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
368 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
374 (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
369 (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
375 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
370 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
376 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
371 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
377 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
372 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
378 [100]
373 [100]
379
374
380 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT/
375 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT/
381 (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
376 (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
382 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
377 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
383 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
378 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
384 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
379 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
385 [100]
380 [100]
386 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT/
381 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT/
387 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
382 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
388 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
383 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
389 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
384 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
390 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
385 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
391 [100]
386 [100]
392 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT1/
387 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT1/
393 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
388 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
394 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
389 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
395 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
390 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
396 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
391 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
397 [100]
392 [100]
398
393
399 --insecure will allow TLS 1.0 connections and override configs
394 --insecure will allow TLS 1.0 connections and override configs
400
395
401 $ hg --config hostsecurity.minimumprotocol=tls1.2 id --insecure https://localhost:$HGPORT1/
396 $ hg --config hostsecurity.minimumprotocol=tls1.2 id --insecure https://localhost:$HGPORT1/
402 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
397 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
403 5fed3813f7f5
398 5fed3813f7f5
404
399
405 The per-host config option overrides the default
400 The per-host config option overrides the default
406
401
407 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
402 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
408 > --config hostsecurity.ciphers=DEFAULT \
403 > --config hostsecurity.ciphers=DEFAULT \
409 > --config hostsecurity.minimumprotocol=tls1.2 \
404 > --config hostsecurity.minimumprotocol=tls1.2 \
410 > --config hostsecurity.localhost:minimumprotocol=tls1.0
405 > --config hostsecurity.localhost:minimumprotocol=tls1.0
411 5fed3813f7f5
406 5fed3813f7f5
412
407
413 The per-host config option by itself works
408 The per-host config option by itself works
414
409
415 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
410 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
416 > --config hostsecurity.localhost:minimumprotocol=tls1.2
411 > --config hostsecurity.localhost:minimumprotocol=tls1.2
417 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
412 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
418 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
413 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
419 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
414 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
420 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
415 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
421 [100]
416 [100]
422
417
423 .hg/hgrc file [hostsecurity] settings are applied to remote ui instances (issue5305)
418 .hg/hgrc file [hostsecurity] settings are applied to remote ui instances (issue5305)
424
419
425 $ cat >> copy-pull/.hg/hgrc << EOF
420 $ cat >> copy-pull/.hg/hgrc << EOF
426 > [hostsecurity]
421 > [hostsecurity]
427 > localhost:minimumprotocol=tls1.2
422 > localhost:minimumprotocol=tls1.2
428 > EOF
423 > EOF
429 $ P="$CERTSDIR" hg -R copy-pull id https://localhost:$HGPORT/
424 $ P="$CERTSDIR" hg -R copy-pull id https://localhost:$HGPORT/
430 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
425 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
431 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
426 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
432 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
427 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
433 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
428 abort: error: .*(unsupported protocol|wrong ssl version|alert protocol version).* (re)
434 [100]
429 [100]
435
430
436 $ killdaemons.py hg0.pid
431 $ killdaemons.py hg0.pid
437 $ killdaemons.py hg1.pid
432 $ killdaemons.py hg1.pid
438 $ killdaemons.py hg2.pid
433 $ killdaemons.py hg2.pid
439 #endif
434 #endif
440
435
441 Prepare for connecting through proxy
436 Prepare for connecting through proxy
442
437
443 $ hg serve -R test -p $HGPORT -d --pid-file=hg0.pid --certificate=$PRIV
438 $ hg serve -R test -p $HGPORT -d --pid-file=hg0.pid --certificate=$PRIV
444 $ cat hg0.pid >> $DAEMON_PIDS
439 $ cat hg0.pid >> $DAEMON_PIDS
445 $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
440 $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
446 $ cat hg2.pid >> $DAEMON_PIDS
441 $ cat hg2.pid >> $DAEMON_PIDS
447 tinyproxy.py doesn't fully detach, so killing it may result in extra output
442 tinyproxy.py doesn't fully detach, so killing it may result in extra output
448 from the shell. So don't kill it.
443 from the shell. So don't kill it.
449 $ tinyproxy.py $HGPORT1 localhost >proxy.log </dev/null 2>&1 &
444 $ tinyproxy.py $HGPORT1 localhost >proxy.log </dev/null 2>&1 &
450 $ while [ ! -f proxy.pid ]; do sleep 0; done
445 $ while [ ! -f proxy.pid ]; do sleep 0; done
451 $ cat proxy.pid >> $DAEMON_PIDS
446 $ cat proxy.pid >> $DAEMON_PIDS
452
447
453 $ echo "[http_proxy]" >> copy-pull/.hg/hgrc
448 $ echo "[http_proxy]" >> copy-pull/.hg/hgrc
454 $ echo "always=True" >> copy-pull/.hg/hgrc
449 $ echo "always=True" >> copy-pull/.hg/hgrc
455 $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc
450 $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc
456 $ echo "localhost =" >> copy-pull/.hg/hgrc
451 $ echo "localhost =" >> copy-pull/.hg/hgrc
457
452
458 Test unvalidated https through proxy
453 Test unvalidated https through proxy
459
454
460 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure
455 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure
461 pulling from https://localhost:$HGPORT/
456 pulling from https://localhost:$HGPORT/
462 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
457 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
463 searching for changes
458 searching for changes
464 no changes found
459 no changes found
465
460
466 Test https with cacert and fingerprint through proxy
461 Test https with cacert and fingerprint through proxy
467
462
468 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
463 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
469 > --config web.cacerts="$CERTSDIR/pub.pem"
464 > --config web.cacerts="$CERTSDIR/pub.pem"
470 pulling from https://localhost:$HGPORT/
465 pulling from https://localhost:$HGPORT/
471 searching for changes
466 searching for changes
472 no changes found
467 no changes found
473 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull https://localhost:$HGPORT/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 --trace
468 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull https://localhost:$HGPORT/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 --trace
474 pulling from https://*:$HGPORT/ (glob)
469 pulling from https://*:$HGPORT/ (glob)
475 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
470 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
476 searching for changes
471 searching for changes
477 no changes found
472 no changes found
478
473
479 Test https with cert problems through proxy
474 Test https with cert problems through proxy
480
475
481 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
476 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
482 > --config web.cacerts="$CERTSDIR/pub-other.pem"
477 > --config web.cacerts="$CERTSDIR/pub-other.pem"
483 pulling from https://localhost:$HGPORT/
478 pulling from https://localhost:$HGPORT/
484 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
479 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
485 abort: error: *certificate verify failed* (glob)
480 abort: error: *certificate verify failed* (glob)
486 [100]
481 [100]
487 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
482 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
488 > --config web.cacerts="$CERTSDIR/pub-expired.pem" https://localhost:$HGPORT2/
483 > --config web.cacerts="$CERTSDIR/pub-expired.pem" https://localhost:$HGPORT2/
489 pulling from https://localhost:$HGPORT2/
484 pulling from https://localhost:$HGPORT2/
490 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
485 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
491 abort: error: *certificate verify failed* (glob)
486 abort: error: *certificate verify failed* (glob)
492 [100]
487 [100]
493
488
494 Test when proxy can't connect to server
489 Test when proxy can't connect to server
495
490
496 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure https://localhost:0/
491 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure https://localhost:0/
497 pulling from https://localhost:0/
492 pulling from https://localhost:0/
498 abort: error: Tunnel connection failed: 404 (Connection refused|\$EADDRNOTAVAIL\$) (re)
493 abort: error: Tunnel connection failed: 404 (Connection refused|\$EADDRNOTAVAIL\$) (re)
499 [100]
494 [100]
500
495
501
496
502 $ killdaemons.py hg0.pid
497 $ killdaemons.py hg0.pid
503
498
504 $ cd test
499 $ cd test
505
500
506 Missing certificate file(s) are detected
501 Missing certificate file(s) are detected
507
502
508 $ hg serve -p $HGPORT --certificate=/missing/certificate \
503 $ hg serve -p $HGPORT --certificate=/missing/certificate \
509 > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true
504 > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true
510 abort: referenced certificate file (*/missing/certificate) does not exist (glob)
505 abort: referenced certificate file (*/missing/certificate) does not exist (glob)
511 [255]
506 [255]
512
507
513 $ hg serve -p $HGPORT --certificate=$PRIV \
508 $ hg serve -p $HGPORT --certificate=$PRIV \
514 > --config devel.servercafile=/missing/cafile --config devel.serverrequirecert=true
509 > --config devel.servercafile=/missing/cafile --config devel.serverrequirecert=true
515 abort: referenced certificate file (*/missing/cafile) does not exist (glob)
510 abort: referenced certificate file (*/missing/cafile) does not exist (glob)
516 [255]
511 [255]
517
512
518 Start hgweb that requires client certificates:
513 Start hgweb that requires client certificates:
519
514
520 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
515 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
521 > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true
516 > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true
522 $ cat ../hg0.pid >> $DAEMON_PIDS
517 $ cat ../hg0.pid >> $DAEMON_PIDS
523 $ cd ..
518 $ cd ..
524
519
525 without client certificate:
520 without client certificate:
526
521
527 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
522 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
528 abort: error: .*(\$ECONNRESET\$|certificate required|handshake failure|EOF occurred).* (re)
523 abort: error: .*(\$ECONNRESET\$|certificate required|handshake failure|EOF occurred).* (re)
529 [100]
524 [100]
530
525
531 with client certificate:
526 with client certificate:
532
527
533 $ cat << EOT >> $HGRCPATH
528 $ cat << EOT >> $HGRCPATH
534 > [auth]
529 > [auth]
535 > l.prefix = localhost
530 > l.prefix = localhost
536 > l.cert = $CERTSDIR/client-cert.pem
531 > l.cert = $CERTSDIR/client-cert.pem
537 > l.key = $CERTSDIR/client-key.pem
532 > l.key = $CERTSDIR/client-key.pem
538 > EOT
533 > EOT
539
534
540 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
535 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
541 > --config auth.l.key="$CERTSDIR/client-key-decrypted.pem"
536 > --config auth.l.key="$CERTSDIR/client-key-decrypted.pem"
542 5fed3813f7f5
537 5fed3813f7f5
543
538
544 $ printf '1234\n' | env P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
539 $ printf '1234\n' | env P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
545 > --config ui.interactive=True --config ui.nontty=True
540 > --config ui.interactive=True --config ui.nontty=True
546 passphrase for */client-key.pem: 5fed3813f7f5 (glob)
541 passphrase for */client-key.pem: 5fed3813f7f5 (glob)
547
542
548 $ env P="$CERTSDIR" hg id https://localhost:$HGPORT/
543 $ env P="$CERTSDIR" hg id https://localhost:$HGPORT/
549 abort: error: * (glob)
544 abort: error: * (glob)
550 [100]
545 [100]
551
546
552 Missing certficate and key files result in error
547 Missing certficate and key files result in error
553
548
554 $ hg id https://localhost:$HGPORT/ --config auth.l.cert=/missing/cert
549 $ hg id https://localhost:$HGPORT/ --config auth.l.cert=/missing/cert
555 abort: certificate file (*/missing/cert) does not exist; cannot connect to localhost (glob)
550 abort: certificate file (*/missing/cert) does not exist; cannot connect to localhost (glob)
556 (restore missing file or fix references in Mercurial config)
551 (restore missing file or fix references in Mercurial config)
557 [255]
552 [255]
558
553
559 $ hg id https://localhost:$HGPORT/ --config auth.l.key=/missing/key
554 $ hg id https://localhost:$HGPORT/ --config auth.l.key=/missing/key
560 abort: certificate file (*/missing/key) does not exist; cannot connect to localhost (glob)
555 abort: certificate file (*/missing/key) does not exist; cannot connect to localhost (glob)
561 (restore missing file or fix references in Mercurial config)
556 (restore missing file or fix references in Mercurial config)
562 [255]
557 [255]
@@ -1,167 +1,162
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
3
3
4 $ tipparents() {
4 $ tipparents() {
5 > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip
5 > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip
6 > }
6 > }
7
7
8 Test import and merge diffs
8 Test import and merge diffs
9
9
10 $ hg init repo
10 $ hg init repo
11 $ cd repo
11 $ cd repo
12 $ echo a > a
12 $ echo a > a
13 $ hg ci -Am adda
13 $ hg ci -Am adda
14 adding a
14 adding a
15 $ echo a >> a
15 $ echo a >> a
16 $ hg ci -m changea
16 $ hg ci -m changea
17 $ echo c > c
17 $ echo c > c
18 $ hg ci -Am addc
18 $ hg ci -Am addc
19 adding c
19 adding c
20 $ hg up 0
20 $ hg up 0
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 $ echo b > b
22 $ echo b > b
23 $ hg ci -Am addb
23 $ hg ci -Am addb
24 adding b
24 adding b
25 created new head
25 created new head
26 $ hg up 1
26 $ hg up 1
27 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
28 $ hg merge 3
28 $ hg merge 3
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 (branch merge, don't forget to commit)
30 (branch merge, don't forget to commit)
31 $ hg ci -m merge
31 $ hg ci -m merge
32 $ hg export . > ../merge.diff
32 $ hg export . > ../merge.diff
33 $ grep -v '^merge$' ../merge.diff > ../merge.nomsg.diff
33 $ grep -v '^merge$' ../merge.diff > ../merge.nomsg.diff
34 $ cd ..
34 $ cd ..
35 $ hg clone -r2 repo repo2
35 $ hg clone -r2 repo repo2
36 adding changesets
36 adding changesets
37 adding manifests
37 adding manifests
38 adding file changes
38 adding file changes
39 added 3 changesets with 3 changes to 2 files
39 added 3 changesets with 3 changes to 2 files
40 new changesets 07f494440405:890ecaa90481
40 new changesets 07f494440405:890ecaa90481
41 updating to branch default
41 updating to branch default
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 $ cd repo2
43 $ cd repo2
44 $ hg pull -r3 ../repo
44 $ hg pull -r3 ../repo
45 pulling from ../repo
45 pulling from ../repo
46 searching for changes
46 searching for changes
47 adding changesets
47 adding changesets
48 adding manifests
48 adding manifests
49 adding file changes
49 adding file changes
50 added 1 changesets with 1 changes to 1 files (+1 heads)
50 added 1 changesets with 1 changes to 1 files (+1 heads)
51 new changesets 102a90ea7b4a
51 new changesets 102a90ea7b4a
52 (run 'hg heads' to see heads, 'hg merge' to merge)
52 (run 'hg heads' to see heads, 'hg merge' to merge)
53
53
54 Test without --exact and diff.p1 == workingdir.p1
54 Test without --exact and diff.p1 == workingdir.p1
55
55
56 $ hg up 1
56 $ hg up 1
57 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
57 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
58 $ cat > $TESTTMP/editor.sh <<EOF
58 $ cat > $TESTTMP/editor.sh <<EOF
59 > env | grep HGEDITFORM
59 > env | grep HGEDITFORM
60 > echo merge > \$1
60 > echo merge > \$1
61 > EOF
61 > EOF
62 $ HGEDITOR="sh $TESTTMP/editor.sh" hg import --edit ../merge.nomsg.diff
62 $ HGEDITOR="sh $TESTTMP/editor.sh" hg import --edit ../merge.nomsg.diff
63 applying ../merge.nomsg.diff
63 applying ../merge.nomsg.diff
64 HGEDITFORM=import.normal.merge
64 HGEDITFORM=import.normal.merge
65 $ tipparents
65 $ tipparents
66 1:540395c44225 changea
66 1:540395c44225 changea
67 3:102a90ea7b4a addb
67 3:102a90ea7b4a addb
68 $ hg strip --no-backup tip
68 $ hg strip --no-backup tip
69 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
69 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
70
70
71 Test without --exact and diff.p1 != workingdir.p1
71 Test without --exact and diff.p1 != workingdir.p1
72
72
73 $ hg up 2
73 $ hg up 2
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 $ hg import ../merge.diff
75 $ hg import ../merge.diff
76 applying ../merge.diff
76 applying ../merge.diff
77 warning: import the patch as a normal revision
77 warning: import the patch as a normal revision
78 (use --exact to import the patch as a merge)
78 (use --exact to import the patch as a merge)
79 $ tipparents
79 $ tipparents
80 2:890ecaa90481 addc
80 2:890ecaa90481 addc
81 $ hg strip --no-backup tip
81 $ hg strip --no-backup tip
82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
83
83
84 Test with --exact
84 Test with --exact
85
85
86 $ hg import --exact ../merge.diff
86 $ hg import --exact ../merge.diff
87 applying ../merge.diff
87 applying ../merge.diff
88 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
88 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
89 $ tipparents
89 $ tipparents
90 1:540395c44225 changea
90 1:540395c44225 changea
91 3:102a90ea7b4a addb
91 3:102a90ea7b4a addb
92 $ hg strip --no-backup tip
92 $ hg strip --no-backup tip
93 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
93 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
94
94
95 Test with --bypass and diff.p1 == workingdir.p1
95 Test with --bypass and diff.p1 == workingdir.p1
96
96
97 $ hg up 1
97 $ hg up 1
98 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 $ hg import --bypass ../merge.diff
99 $ hg import --bypass ../merge.diff
100 applying ../merge.diff
100 applying ../merge.diff
101 $ tipparents
101 $ tipparents
102 1:540395c44225 changea
102 1:540395c44225 changea
103 3:102a90ea7b4a addb
103 3:102a90ea7b4a addb
104 $ hg strip --no-backup tip
104 $ hg strip --no-backup tip
105
105
106 Test with --bypass and diff.p1 != workingdir.p1
106 Test with --bypass and diff.p1 != workingdir.p1
107
107
108 $ hg up 2
108 $ hg up 2
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 $ hg import --bypass ../merge.diff
110 $ hg import --bypass ../merge.diff
111 applying ../merge.diff
111 applying ../merge.diff
112 warning: import the patch as a normal revision
112 warning: import the patch as a normal revision
113 (use --exact to import the patch as a merge)
113 (use --exact to import the patch as a merge)
114 $ tipparents
114 $ tipparents
115 2:890ecaa90481 addc
115 2:890ecaa90481 addc
116 $ hg strip --no-backup tip
116 $ hg strip --no-backup tip
117
117
118 Test with --bypass and --exact
118 Test with --bypass and --exact
119
119
120 $ hg import --bypass --exact ../merge.diff
120 $ hg import --bypass --exact ../merge.diff
121 applying ../merge.diff
121 applying ../merge.diff
122 $ tipparents
122 $ tipparents
123 1:540395c44225 changea
123 1:540395c44225 changea
124 3:102a90ea7b4a addb
124 3:102a90ea7b4a addb
125 $ hg strip --no-backup tip
125 $ hg strip --no-backup tip
126
126
127 $ cd ..
127 $ cd ..
128
128
129 Test that --exact on a bad header doesn't corrupt the repo (issue3616)
129 Test that --exact on a bad header doesn't corrupt the repo (issue3616)
130
130
131 $ hg init repo3
131 $ hg init repo3
132 $ cd repo3
132 $ cd repo3
133 $ echo a>a
133 $ echo a>a
134 $ hg ci -Aqm0
134 $ hg ci -Aqm0
135 $ echo a>>a
135 $ echo a>>a
136 $ hg ci -m1
136 $ hg ci -m1
137 $ echo a>>a
137 $ echo a>>a
138 $ hg ci -m2
138 $ hg ci -m2
139 $ echo a>a
139 $ echo a>a
140 $ echo b>>a
140 $ echo b>>a
141 $ echo a>>a
141 $ echo a>>a
142 $ hg ci -m3
142 $ hg ci -m3
143 $ hg export 2 | head -7 > ../a.patch
143 $ hg export 2 | head -7 > ../a.patch
144 $ hg export tip > out
144 $ hg export tip > out
145 >>> apatch = open("../a.patch", "ab")
145 >>> apatch = open("../a.patch", "ab")
146 >>> apatch.write(b"".join(open("out", 'rb').readlines()[7:])) and None
146 >>> apatch.write(b"".join(open("out", 'rb').readlines()[7:])) and None
147
147
148 $ cd ..
148 $ cd ..
149 $ hg clone -qr0 repo3 repo3-clone
149 $ hg clone -qr0 repo3 repo3-clone
150 $ cd repo3-clone
150 $ cd repo3-clone
151 $ hg pull -qr1 ../repo3
151 $ hg pull -qr1 ../repo3
152
152
153 $ hg import --exact ../a.patch
153 $ hg import --exact ../a.patch
154 applying ../a.patch
154 applying ../a.patch
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 patching file a
156 patching file a
157 Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
157 Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
158 transaction abort!
158 transaction abort!
159 rollback completed
159 rollback completed
160 abort: patch is damaged or loses information
160 abort: patch is damaged or loses information
161 [255]
161 [255]
162 $ hg verify
162 $ hg verify -q
163 checking changesets
164 checking manifests
165 crosschecking files in changesets and manifests
166 checking files
167 checked 2 changesets with 2 changes to 1 files
@@ -1,553 +1,543
1 #require serve
1 #require serve
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ for i in 0 1 2 3 4 5 6 7 8; do
5 $ for i in 0 1 2 3 4 5 6 7 8; do
6 > echo $i >> foo
6 > echo $i >> foo
7 > hg commit -A -m $i
7 > hg commit -A -m $i
8 > done
8 > done
9 adding foo
9 adding foo
10 $ hg verify
10 $ hg verify -q
11 checking changesets
12 checking manifests
13 crosschecking files in changesets and manifests
14 checking files
15 checked 9 changesets with 9 changes to 1 files
16 $ hg serve -p $HGPORT -d --pid-file=hg.pid
11 $ hg serve -p $HGPORT -d --pid-file=hg.pid
17 $ cat hg.pid >> $DAEMON_PIDS
12 $ cat hg.pid >> $DAEMON_PIDS
18 $ cd ..
13 $ cd ..
19
14
20 $ hg init new
15 $ hg init new
21
16
22 http incoming
17 http incoming
23
18
24 $ hg -R new incoming http://localhost:$HGPORT/
19 $ hg -R new incoming http://localhost:$HGPORT/
25 comparing with http://localhost:$HGPORT/
20 comparing with http://localhost:$HGPORT/
26 changeset: 0:00a43fa82f62
21 changeset: 0:00a43fa82f62
27 user: test
22 user: test
28 date: Thu Jan 01 00:00:00 1970 +0000
23 date: Thu Jan 01 00:00:00 1970 +0000
29 summary: 0
24 summary: 0
30
25
31 changeset: 1:5460a410df01
26 changeset: 1:5460a410df01
32 user: test
27 user: test
33 date: Thu Jan 01 00:00:00 1970 +0000
28 date: Thu Jan 01 00:00:00 1970 +0000
34 summary: 1
29 summary: 1
35
30
36 changeset: 2:d9f42cd1a1ec
31 changeset: 2:d9f42cd1a1ec
37 user: test
32 user: test
38 date: Thu Jan 01 00:00:00 1970 +0000
33 date: Thu Jan 01 00:00:00 1970 +0000
39 summary: 2
34 summary: 2
40
35
41 changeset: 3:376476025137
36 changeset: 3:376476025137
42 user: test
37 user: test
43 date: Thu Jan 01 00:00:00 1970 +0000
38 date: Thu Jan 01 00:00:00 1970 +0000
44 summary: 3
39 summary: 3
45
40
46 changeset: 4:70d7eb252d49
41 changeset: 4:70d7eb252d49
47 user: test
42 user: test
48 date: Thu Jan 01 00:00:00 1970 +0000
43 date: Thu Jan 01 00:00:00 1970 +0000
49 summary: 4
44 summary: 4
50
45
51 changeset: 5:ad284ee3b5ee
46 changeset: 5:ad284ee3b5ee
52 user: test
47 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
48 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: 5
49 summary: 5
55
50
56 changeset: 6:e9229f2de384
51 changeset: 6:e9229f2de384
57 user: test
52 user: test
58 date: Thu Jan 01 00:00:00 1970 +0000
53 date: Thu Jan 01 00:00:00 1970 +0000
59 summary: 6
54 summary: 6
60
55
61 changeset: 7:d152815bb8db
56 changeset: 7:d152815bb8db
62 user: test
57 user: test
63 date: Thu Jan 01 00:00:00 1970 +0000
58 date: Thu Jan 01 00:00:00 1970 +0000
64 summary: 7
59 summary: 7
65
60
66 changeset: 8:e4feb4ac9035
61 changeset: 8:e4feb4ac9035
67 tag: tip
62 tag: tip
68 user: test
63 user: test
69 date: Thu Jan 01 00:00:00 1970 +0000
64 date: Thu Jan 01 00:00:00 1970 +0000
70 summary: 8
65 summary: 8
71
66
72 $ hg -R new incoming -r 4 http://localhost:$HGPORT/
67 $ hg -R new incoming -r 4 http://localhost:$HGPORT/
73 comparing with http://localhost:$HGPORT/
68 comparing with http://localhost:$HGPORT/
74 changeset: 0:00a43fa82f62
69 changeset: 0:00a43fa82f62
75 user: test
70 user: test
76 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
77 summary: 0
72 summary: 0
78
73
79 changeset: 1:5460a410df01
74 changeset: 1:5460a410df01
80 user: test
75 user: test
81 date: Thu Jan 01 00:00:00 1970 +0000
76 date: Thu Jan 01 00:00:00 1970 +0000
82 summary: 1
77 summary: 1
83
78
84 changeset: 2:d9f42cd1a1ec
79 changeset: 2:d9f42cd1a1ec
85 user: test
80 user: test
86 date: Thu Jan 01 00:00:00 1970 +0000
81 date: Thu Jan 01 00:00:00 1970 +0000
87 summary: 2
82 summary: 2
88
83
89 changeset: 3:376476025137
84 changeset: 3:376476025137
90 user: test
85 user: test
91 date: Thu Jan 01 00:00:00 1970 +0000
86 date: Thu Jan 01 00:00:00 1970 +0000
92 summary: 3
87 summary: 3
93
88
94 changeset: 4:70d7eb252d49
89 changeset: 4:70d7eb252d49
95 tag: tip
90 tag: tip
96 user: test
91 user: test
97 date: Thu Jan 01 00:00:00 1970 +0000
92 date: Thu Jan 01 00:00:00 1970 +0000
98 summary: 4
93 summary: 4
99
94
100
95
101 local incoming
96 local incoming
102
97
103 $ hg -R new incoming test
98 $ hg -R new incoming test
104 comparing with test
99 comparing with test
105 changeset: 0:00a43fa82f62
100 changeset: 0:00a43fa82f62
106 user: test
101 user: test
107 date: Thu Jan 01 00:00:00 1970 +0000
102 date: Thu Jan 01 00:00:00 1970 +0000
108 summary: 0
103 summary: 0
109
104
110 changeset: 1:5460a410df01
105 changeset: 1:5460a410df01
111 user: test
106 user: test
112 date: Thu Jan 01 00:00:00 1970 +0000
107 date: Thu Jan 01 00:00:00 1970 +0000
113 summary: 1
108 summary: 1
114
109
115 changeset: 2:d9f42cd1a1ec
110 changeset: 2:d9f42cd1a1ec
116 user: test
111 user: test
117 date: Thu Jan 01 00:00:00 1970 +0000
112 date: Thu Jan 01 00:00:00 1970 +0000
118 summary: 2
113 summary: 2
119
114
120 changeset: 3:376476025137
115 changeset: 3:376476025137
121 user: test
116 user: test
122 date: Thu Jan 01 00:00:00 1970 +0000
117 date: Thu Jan 01 00:00:00 1970 +0000
123 summary: 3
118 summary: 3
124
119
125 changeset: 4:70d7eb252d49
120 changeset: 4:70d7eb252d49
126 user: test
121 user: test
127 date: Thu Jan 01 00:00:00 1970 +0000
122 date: Thu Jan 01 00:00:00 1970 +0000
128 summary: 4
123 summary: 4
129
124
130 changeset: 5:ad284ee3b5ee
125 changeset: 5:ad284ee3b5ee
131 user: test
126 user: test
132 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
133 summary: 5
128 summary: 5
134
129
135 changeset: 6:e9229f2de384
130 changeset: 6:e9229f2de384
136 user: test
131 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
132 date: Thu Jan 01 00:00:00 1970 +0000
138 summary: 6
133 summary: 6
139
134
140 changeset: 7:d152815bb8db
135 changeset: 7:d152815bb8db
141 user: test
136 user: test
142 date: Thu Jan 01 00:00:00 1970 +0000
137 date: Thu Jan 01 00:00:00 1970 +0000
143 summary: 7
138 summary: 7
144
139
145 changeset: 8:e4feb4ac9035
140 changeset: 8:e4feb4ac9035
146 tag: tip
141 tag: tip
147 user: test
142 user: test
148 date: Thu Jan 01 00:00:00 1970 +0000
143 date: Thu Jan 01 00:00:00 1970 +0000
149 summary: 8
144 summary: 8
150
145
151 $ hg -R new incoming -r 4 test
146 $ hg -R new incoming -r 4 test
152 comparing with test
147 comparing with test
153 changeset: 0:00a43fa82f62
148 changeset: 0:00a43fa82f62
154 user: test
149 user: test
155 date: Thu Jan 01 00:00:00 1970 +0000
150 date: Thu Jan 01 00:00:00 1970 +0000
156 summary: 0
151 summary: 0
157
152
158 changeset: 1:5460a410df01
153 changeset: 1:5460a410df01
159 user: test
154 user: test
160 date: Thu Jan 01 00:00:00 1970 +0000
155 date: Thu Jan 01 00:00:00 1970 +0000
161 summary: 1
156 summary: 1
162
157
163 changeset: 2:d9f42cd1a1ec
158 changeset: 2:d9f42cd1a1ec
164 user: test
159 user: test
165 date: Thu Jan 01 00:00:00 1970 +0000
160 date: Thu Jan 01 00:00:00 1970 +0000
166 summary: 2
161 summary: 2
167
162
168 changeset: 3:376476025137
163 changeset: 3:376476025137
169 user: test
164 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
165 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: 3
166 summary: 3
172
167
173 changeset: 4:70d7eb252d49
168 changeset: 4:70d7eb252d49
174 user: test
169 user: test
175 date: Thu Jan 01 00:00:00 1970 +0000
170 date: Thu Jan 01 00:00:00 1970 +0000
176 summary: 4
171 summary: 4
177
172
178
173
179 limit to 2 changesets
174 limit to 2 changesets
180
175
181 $ hg -R new incoming -l 2 test
176 $ hg -R new incoming -l 2 test
182 comparing with test
177 comparing with test
183 changeset: 0:00a43fa82f62
178 changeset: 0:00a43fa82f62
184 user: test
179 user: test
185 date: Thu Jan 01 00:00:00 1970 +0000
180 date: Thu Jan 01 00:00:00 1970 +0000
186 summary: 0
181 summary: 0
187
182
188 changeset: 1:5460a410df01
183 changeset: 1:5460a410df01
189 user: test
184 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
185 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: 1
186 summary: 1
192
187
193
188
194 limit to 2 changesets, test with -p --git
189 limit to 2 changesets, test with -p --git
195
190
196 $ hg -R new incoming -l 2 -p --git test
191 $ hg -R new incoming -l 2 -p --git test
197 comparing with test
192 comparing with test
198 changeset: 0:00a43fa82f62
193 changeset: 0:00a43fa82f62
199 user: test
194 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
195 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: 0
196 summary: 0
202
197
203 diff --git a/foo b/foo
198 diff --git a/foo b/foo
204 new file mode 100644
199 new file mode 100644
205 --- /dev/null
200 --- /dev/null
206 +++ b/foo
201 +++ b/foo
207 @@ -0,0 +1,1 @@
202 @@ -0,0 +1,1 @@
208 +0
203 +0
209
204
210 changeset: 1:5460a410df01
205 changeset: 1:5460a410df01
211 user: test
206 user: test
212 date: Thu Jan 01 00:00:00 1970 +0000
207 date: Thu Jan 01 00:00:00 1970 +0000
213 summary: 1
208 summary: 1
214
209
215 diff --git a/foo b/foo
210 diff --git a/foo b/foo
216 --- a/foo
211 --- a/foo
217 +++ b/foo
212 +++ b/foo
218 @@ -1,1 +1,2 @@
213 @@ -1,1 +1,2 @@
219 0
214 0
220 +1
215 +1
221
216
222
217
223 test with --bundle
218 test with --bundle
224
219
225 $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/
220 $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/
226 comparing with http://localhost:$HGPORT/
221 comparing with http://localhost:$HGPORT/
227 changeset: 0:00a43fa82f62
222 changeset: 0:00a43fa82f62
228 user: test
223 user: test
229 date: Thu Jan 01 00:00:00 1970 +0000
224 date: Thu Jan 01 00:00:00 1970 +0000
230 summary: 0
225 summary: 0
231
226
232 changeset: 1:5460a410df01
227 changeset: 1:5460a410df01
233 user: test
228 user: test
234 date: Thu Jan 01 00:00:00 1970 +0000
229 date: Thu Jan 01 00:00:00 1970 +0000
235 summary: 1
230 summary: 1
236
231
237 changeset: 2:d9f42cd1a1ec
232 changeset: 2:d9f42cd1a1ec
238 user: test
233 user: test
239 date: Thu Jan 01 00:00:00 1970 +0000
234 date: Thu Jan 01 00:00:00 1970 +0000
240 summary: 2
235 summary: 2
241
236
242 changeset: 3:376476025137
237 changeset: 3:376476025137
243 user: test
238 user: test
244 date: Thu Jan 01 00:00:00 1970 +0000
239 date: Thu Jan 01 00:00:00 1970 +0000
245 summary: 3
240 summary: 3
246
241
247 changeset: 4:70d7eb252d49
242 changeset: 4:70d7eb252d49
248 user: test
243 user: test
249 date: Thu Jan 01 00:00:00 1970 +0000
244 date: Thu Jan 01 00:00:00 1970 +0000
250 summary: 4
245 summary: 4
251
246
252 changeset: 5:ad284ee3b5ee
247 changeset: 5:ad284ee3b5ee
253 user: test
248 user: test
254 date: Thu Jan 01 00:00:00 1970 +0000
249 date: Thu Jan 01 00:00:00 1970 +0000
255 summary: 5
250 summary: 5
256
251
257 changeset: 6:e9229f2de384
252 changeset: 6:e9229f2de384
258 user: test
253 user: test
259 date: Thu Jan 01 00:00:00 1970 +0000
254 date: Thu Jan 01 00:00:00 1970 +0000
260 summary: 6
255 summary: 6
261
256
262 changeset: 7:d152815bb8db
257 changeset: 7:d152815bb8db
263 user: test
258 user: test
264 date: Thu Jan 01 00:00:00 1970 +0000
259 date: Thu Jan 01 00:00:00 1970 +0000
265 summary: 7
260 summary: 7
266
261
267 changeset: 8:e4feb4ac9035
262 changeset: 8:e4feb4ac9035
268 tag: tip
263 tag: tip
269 user: test
264 user: test
270 date: Thu Jan 01 00:00:00 1970 +0000
265 date: Thu Jan 01 00:00:00 1970 +0000
271 summary: 8
266 summary: 8
272
267
273 $ hg -R new incoming --bundle test2.hg test
268 $ hg -R new incoming --bundle test2.hg test
274 comparing with test
269 comparing with test
275 changeset: 0:00a43fa82f62
270 changeset: 0:00a43fa82f62
276 user: test
271 user: test
277 date: Thu Jan 01 00:00:00 1970 +0000
272 date: Thu Jan 01 00:00:00 1970 +0000
278 summary: 0
273 summary: 0
279
274
280 changeset: 1:5460a410df01
275 changeset: 1:5460a410df01
281 user: test
276 user: test
282 date: Thu Jan 01 00:00:00 1970 +0000
277 date: Thu Jan 01 00:00:00 1970 +0000
283 summary: 1
278 summary: 1
284
279
285 changeset: 2:d9f42cd1a1ec
280 changeset: 2:d9f42cd1a1ec
286 user: test
281 user: test
287 date: Thu Jan 01 00:00:00 1970 +0000
282 date: Thu Jan 01 00:00:00 1970 +0000
288 summary: 2
283 summary: 2
289
284
290 changeset: 3:376476025137
285 changeset: 3:376476025137
291 user: test
286 user: test
292 date: Thu Jan 01 00:00:00 1970 +0000
287 date: Thu Jan 01 00:00:00 1970 +0000
293 summary: 3
288 summary: 3
294
289
295 changeset: 4:70d7eb252d49
290 changeset: 4:70d7eb252d49
296 user: test
291 user: test
297 date: Thu Jan 01 00:00:00 1970 +0000
292 date: Thu Jan 01 00:00:00 1970 +0000
298 summary: 4
293 summary: 4
299
294
300 changeset: 5:ad284ee3b5ee
295 changeset: 5:ad284ee3b5ee
301 user: test
296 user: test
302 date: Thu Jan 01 00:00:00 1970 +0000
297 date: Thu Jan 01 00:00:00 1970 +0000
303 summary: 5
298 summary: 5
304
299
305 changeset: 6:e9229f2de384
300 changeset: 6:e9229f2de384
306 user: test
301 user: test
307 date: Thu Jan 01 00:00:00 1970 +0000
302 date: Thu Jan 01 00:00:00 1970 +0000
308 summary: 6
303 summary: 6
309
304
310 changeset: 7:d152815bb8db
305 changeset: 7:d152815bb8db
311 user: test
306 user: test
312 date: Thu Jan 01 00:00:00 1970 +0000
307 date: Thu Jan 01 00:00:00 1970 +0000
313 summary: 7
308 summary: 7
314
309
315 changeset: 8:e4feb4ac9035
310 changeset: 8:e4feb4ac9035
316 tag: tip
311 tag: tip
317 user: test
312 user: test
318 date: Thu Jan 01 00:00:00 1970 +0000
313 date: Thu Jan 01 00:00:00 1970 +0000
319 summary: 8
314 summary: 8
320
315
321
316
322
317
323 test the resulting bundles
318 test the resulting bundles
324
319
325 $ hg init temp
320 $ hg init temp
326 $ hg init temp2
321 $ hg init temp2
327 $ hg -R temp unbundle test.hg
322 $ hg -R temp unbundle test.hg
328 adding changesets
323 adding changesets
329 adding manifests
324 adding manifests
330 adding file changes
325 adding file changes
331 added 9 changesets with 9 changes to 1 files
326 added 9 changesets with 9 changes to 1 files
332 new changesets 00a43fa82f62:e4feb4ac9035 (9 drafts)
327 new changesets 00a43fa82f62:e4feb4ac9035 (9 drafts)
333 (run 'hg update' to get a working copy)
328 (run 'hg update' to get a working copy)
334 $ hg -R temp2 unbundle test2.hg
329 $ hg -R temp2 unbundle test2.hg
335 adding changesets
330 adding changesets
336 adding manifests
331 adding manifests
337 adding file changes
332 adding file changes
338 added 9 changesets with 9 changes to 1 files
333 added 9 changesets with 9 changes to 1 files
339 new changesets 00a43fa82f62:e4feb4ac9035 (9 drafts)
334 new changesets 00a43fa82f62:e4feb4ac9035 (9 drafts)
340 (run 'hg update' to get a working copy)
335 (run 'hg update' to get a working copy)
341 $ hg -R temp tip
336 $ hg -R temp tip
342 changeset: 8:e4feb4ac9035
337 changeset: 8:e4feb4ac9035
343 tag: tip
338 tag: tip
344 user: test
339 user: test
345 date: Thu Jan 01 00:00:00 1970 +0000
340 date: Thu Jan 01 00:00:00 1970 +0000
346 summary: 8
341 summary: 8
347
342
348 $ hg -R temp2 tip
343 $ hg -R temp2 tip
349 changeset: 8:e4feb4ac9035
344 changeset: 8:e4feb4ac9035
350 tag: tip
345 tag: tip
351 user: test
346 user: test
352 date: Thu Jan 01 00:00:00 1970 +0000
347 date: Thu Jan 01 00:00:00 1970 +0000
353 summary: 8
348 summary: 8
354
349
355
350
356 $ rm -r temp temp2 new
351 $ rm -r temp temp2 new
357
352
358 test outgoing
353 test outgoing
359
354
360 $ hg clone test test-dev
355 $ hg clone test test-dev
361 updating to branch default
356 updating to branch default
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
357 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 $ cd test-dev
358 $ cd test-dev
364 $ for i in 9 10 11 12 13; do
359 $ for i in 9 10 11 12 13; do
365 > echo $i >> foo
360 > echo $i >> foo
366 > hg commit -A -m $i
361 > hg commit -A -m $i
367 > done
362 > done
368 $ hg verify
363 $ hg verify -q
369 checking changesets
370 checking manifests
371 crosschecking files in changesets and manifests
372 checking files
373 checked 14 changesets with 14 changes to 1 files
374 $ cd ..
364 $ cd ..
375 $ hg -R test-dev outgoing test
365 $ hg -R test-dev outgoing test
376 comparing with test
366 comparing with test
377 searching for changes
367 searching for changes
378 changeset: 9:d89d4abea5bc
368 changeset: 9:d89d4abea5bc
379 user: test
369 user: test
380 date: Thu Jan 01 00:00:00 1970 +0000
370 date: Thu Jan 01 00:00:00 1970 +0000
381 summary: 9
371 summary: 9
382
372
383 changeset: 10:820095aa7158
373 changeset: 10:820095aa7158
384 user: test
374 user: test
385 date: Thu Jan 01 00:00:00 1970 +0000
375 date: Thu Jan 01 00:00:00 1970 +0000
386 summary: 10
376 summary: 10
387
377
388 changeset: 11:09ede2f3a638
378 changeset: 11:09ede2f3a638
389 user: test
379 user: test
390 date: Thu Jan 01 00:00:00 1970 +0000
380 date: Thu Jan 01 00:00:00 1970 +0000
391 summary: 11
381 summary: 11
392
382
393 changeset: 12:e576b1bed305
383 changeset: 12:e576b1bed305
394 user: test
384 user: test
395 date: Thu Jan 01 00:00:00 1970 +0000
385 date: Thu Jan 01 00:00:00 1970 +0000
396 summary: 12
386 summary: 12
397
387
398 changeset: 13:96bbff09a7cc
388 changeset: 13:96bbff09a7cc
399 tag: tip
389 tag: tip
400 user: test
390 user: test
401 date: Thu Jan 01 00:00:00 1970 +0000
391 date: Thu Jan 01 00:00:00 1970 +0000
402 summary: 13
392 summary: 13
403
393
404 test outgoing with secret changesets
394 test outgoing with secret changesets
405
395
406 $ hg -R test-dev phase --force --secret 9
396 $ hg -R test-dev phase --force --secret 9
407 $ hg -R test-dev outgoing test
397 $ hg -R test-dev outgoing test
408 comparing with test
398 comparing with test
409 searching for changes
399 searching for changes
410 no changes found (ignored 5 secret changesets)
400 no changes found (ignored 5 secret changesets)
411 [1]
401 [1]
412 $ hg -R test-dev phase --draft -r 'head()'
402 $ hg -R test-dev phase --draft -r 'head()'
413
403
414 limit to 3 changesets
404 limit to 3 changesets
415
405
416 $ hg -R test-dev outgoing -l 3 test
406 $ hg -R test-dev outgoing -l 3 test
417 comparing with test
407 comparing with test
418 searching for changes
408 searching for changes
419 changeset: 9:d89d4abea5bc
409 changeset: 9:d89d4abea5bc
420 user: test
410 user: test
421 date: Thu Jan 01 00:00:00 1970 +0000
411 date: Thu Jan 01 00:00:00 1970 +0000
422 summary: 9
412 summary: 9
423
413
424 changeset: 10:820095aa7158
414 changeset: 10:820095aa7158
425 user: test
415 user: test
426 date: Thu Jan 01 00:00:00 1970 +0000
416 date: Thu Jan 01 00:00:00 1970 +0000
427 summary: 10
417 summary: 10
428
418
429 changeset: 11:09ede2f3a638
419 changeset: 11:09ede2f3a638
430 user: test
420 user: test
431 date: Thu Jan 01 00:00:00 1970 +0000
421 date: Thu Jan 01 00:00:00 1970 +0000
432 summary: 11
422 summary: 11
433
423
434 $ hg -R test-dev outgoing http://localhost:$HGPORT/
424 $ hg -R test-dev outgoing http://localhost:$HGPORT/
435 comparing with http://localhost:$HGPORT/
425 comparing with http://localhost:$HGPORT/
436 searching for changes
426 searching for changes
437 changeset: 9:d89d4abea5bc
427 changeset: 9:d89d4abea5bc
438 user: test
428 user: test
439 date: Thu Jan 01 00:00:00 1970 +0000
429 date: Thu Jan 01 00:00:00 1970 +0000
440 summary: 9
430 summary: 9
441
431
442 changeset: 10:820095aa7158
432 changeset: 10:820095aa7158
443 user: test
433 user: test
444 date: Thu Jan 01 00:00:00 1970 +0000
434 date: Thu Jan 01 00:00:00 1970 +0000
445 summary: 10
435 summary: 10
446
436
447 changeset: 11:09ede2f3a638
437 changeset: 11:09ede2f3a638
448 user: test
438 user: test
449 date: Thu Jan 01 00:00:00 1970 +0000
439 date: Thu Jan 01 00:00:00 1970 +0000
450 summary: 11
440 summary: 11
451
441
452 changeset: 12:e576b1bed305
442 changeset: 12:e576b1bed305
453 user: test
443 user: test
454 date: Thu Jan 01 00:00:00 1970 +0000
444 date: Thu Jan 01 00:00:00 1970 +0000
455 summary: 12
445 summary: 12
456
446
457 changeset: 13:96bbff09a7cc
447 changeset: 13:96bbff09a7cc
458 tag: tip
448 tag: tip
459 user: test
449 user: test
460 date: Thu Jan 01 00:00:00 1970 +0000
450 date: Thu Jan 01 00:00:00 1970 +0000
461 summary: 13
451 summary: 13
462
452
463 $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/
453 $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/
464 comparing with http://localhost:$HGPORT/
454 comparing with http://localhost:$HGPORT/
465 searching for changes
455 searching for changes
466 changeset: 9:d89d4abea5bc
456 changeset: 9:d89d4abea5bc
467 user: test
457 user: test
468 date: Thu Jan 01 00:00:00 1970 +0000
458 date: Thu Jan 01 00:00:00 1970 +0000
469 summary: 9
459 summary: 9
470
460
471 changeset: 10:820095aa7158
461 changeset: 10:820095aa7158
472 user: test
462 user: test
473 date: Thu Jan 01 00:00:00 1970 +0000
463 date: Thu Jan 01 00:00:00 1970 +0000
474 summary: 10
464 summary: 10
475
465
476 changeset: 11:09ede2f3a638
466 changeset: 11:09ede2f3a638
477 user: test
467 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
468 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: 11
469 summary: 11
480
470
481
471
482 incoming from empty remote repository
472 incoming from empty remote repository
483
473
484 $ hg init r1
474 $ hg init r1
485 $ hg init r2
475 $ hg init r2
486 $ echo a > r1/foo
476 $ echo a > r1/foo
487 $ hg -R r1 ci -Ama
477 $ hg -R r1 ci -Ama
488 adding foo
478 adding foo
489 $ hg -R r1 incoming r2 --bundle x.hg
479 $ hg -R r1 incoming r2 --bundle x.hg
490 comparing with r2
480 comparing with r2
491 searching for changes
481 searching for changes
492 no changes found
482 no changes found
493 [1]
483 [1]
494
484
495 Create a "split" repo that pulls from r1 and pushes to r2, using default-push
485 Create a "split" repo that pulls from r1 and pushes to r2, using default-push
496
486
497 $ hg clone r1 split
487 $ hg clone r1 split
498 updating to branch default
488 updating to branch default
499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 $ cat > split/.hg/hgrc << EOF
490 $ cat > split/.hg/hgrc << EOF
501 > [paths]
491 > [paths]
502 > default = $TESTTMP/r3
492 > default = $TESTTMP/r3
503 > default-push = $TESTTMP/r2
493 > default-push = $TESTTMP/r2
504 > EOF
494 > EOF
505 $ hg -R split outgoing
495 $ hg -R split outgoing
506 comparing with $TESTTMP/r2
496 comparing with $TESTTMP/r2
507 searching for changes
497 searching for changes
508 changeset: 0:3e92d79f743a
498 changeset: 0:3e92d79f743a
509 tag: tip
499 tag: tip
510 user: test
500 user: test
511 date: Thu Jan 01 00:00:00 1970 +0000
501 date: Thu Jan 01 00:00:00 1970 +0000
512 summary: a
502 summary: a
513
503
514
504
515 Use default:pushurl instead of default-push
505 Use default:pushurl instead of default-push
516
506
517 Windows needs a leading slash to make a URL that passes all of the checks
507 Windows needs a leading slash to make a URL that passes all of the checks
518 $ WD=`pwd`
508 $ WD=`pwd`
519 #if windows
509 #if windows
520 $ WD="/$WD"
510 $ WD="/$WD"
521 #endif
511 #endif
522 $ cat > split/.hg/hgrc << EOF
512 $ cat > split/.hg/hgrc << EOF
523 > [paths]
513 > [paths]
524 > default = $WD/r3
514 > default = $WD/r3
525 > default:pushurl = file://$WD/r2
515 > default:pushurl = file://$WD/r2
526 > EOF
516 > EOF
527 $ hg -R split outgoing
517 $ hg -R split outgoing
528 comparing with file:/*/$TESTTMP/r2 (glob)
518 comparing with file:/*/$TESTTMP/r2 (glob)
529 searching for changes
519 searching for changes
530 changeset: 0:3e92d79f743a
520 changeset: 0:3e92d79f743a
531 tag: tip
521 tag: tip
532 user: test
522 user: test
533 date: Thu Jan 01 00:00:00 1970 +0000
523 date: Thu Jan 01 00:00:00 1970 +0000
534 summary: a
524 summary: a
535
525
536
526
537 Push and then double-check outgoing
527 Push and then double-check outgoing
538
528
539 $ echo a >> split/foo
529 $ echo a >> split/foo
540 $ hg -R split commit -Ama
530 $ hg -R split commit -Ama
541 $ hg -R split push
531 $ hg -R split push
542 pushing to file:/*/$TESTTMP/r2 (glob)
532 pushing to file:/*/$TESTTMP/r2 (glob)
543 searching for changes
533 searching for changes
544 adding changesets
534 adding changesets
545 adding manifests
535 adding manifests
546 adding file changes
536 adding file changes
547 added 2 changesets with 2 changes to 1 files
537 added 2 changesets with 2 changes to 1 files
548 $ hg -R split outgoing
538 $ hg -R split outgoing
549 comparing with file:/*/$TESTTMP/r2 (glob)
539 comparing with file:/*/$TESTTMP/r2 (glob)
550 searching for changes
540 searching for changes
551 no changes found
541 no changes found
552 [1]
542 [1]
553
543
@@ -1,97 +1,92
1 https://bz.mercurial-scm.org/1175
1 https://bz.mercurial-scm.org/1175
2
2
3 $ hg init repo
3 $ hg init repo
4 $ cd repo
4 $ cd repo
5 $ touch a
5 $ touch a
6 $ hg ci -Am0
6 $ hg ci -Am0
7 adding a
7 adding a
8
8
9 $ hg mv a a1
9 $ hg mv a a1
10 $ hg ci -m1
10 $ hg ci -m1
11
11
12 $ hg co 0
12 $ hg co 0
13 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
13 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
14
14
15 $ hg mv a a2
15 $ hg mv a a2
16 $ hg up
16 $ hg up
17 note: possible conflict - a was renamed multiple times to:
17 note: possible conflict - a was renamed multiple times to:
18 a1
18 a1
19 a2
19 a2
20 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21
21
22 $ hg ci -m2
22 $ hg ci -m2
23
23
24 $ touch a
24 $ touch a
25 $ hg ci -Am3
25 $ hg ci -Am3
26 adding a
26 adding a
27
27
28 $ hg mv a b
28 $ hg mv a b
29 $ hg ci -Am4 a
29 $ hg ci -Am4 a
30
30
31 $ hg ci --debug --traceback -Am5 b
31 $ hg ci --debug --traceback -Am5 b
32 committing files:
32 committing files:
33 b
33 b
34 warning: can't find ancestor for 'b' copied from 'a'!
34 warning: can't find ancestor for 'b' copied from 'a'!
35 committing manifest
35 committing manifest
36 committing changelog
36 committing changelog
37 updating the branch cache
37 updating the branch cache
38 committed changeset 5:83a687e8a97c80992ba385bbfd766be181bfb1d1
38 committed changeset 5:83a687e8a97c80992ba385bbfd766be181bfb1d1
39
39
40 $ hg verify
40 $ hg verify -q
41 checking changesets
42 checking manifests
43 crosschecking files in changesets and manifests
44 checking files
45 checked 6 changesets with 4 changes to 4 files
46
41
47 $ hg export --git tip
42 $ hg export --git tip
48 # HG changeset patch
43 # HG changeset patch
49 # User test
44 # User test
50 # Date 0 0
45 # Date 0 0
51 # Thu Jan 01 00:00:00 1970 +0000
46 # Thu Jan 01 00:00:00 1970 +0000
52 # Node ID 83a687e8a97c80992ba385bbfd766be181bfb1d1
47 # Node ID 83a687e8a97c80992ba385bbfd766be181bfb1d1
53 # Parent 1d1625283f71954f21d14c3d44d0ad3c019c597f
48 # Parent 1d1625283f71954f21d14c3d44d0ad3c019c597f
54 5
49 5
55
50
56 diff --git a/b b/b
51 diff --git a/b b/b
57 new file mode 100644
52 new file mode 100644
58
53
59 https://bz.mercurial-scm.org/show_bug.cgi?id=4476
54 https://bz.mercurial-scm.org/show_bug.cgi?id=4476
60
55
61 $ hg init foo
56 $ hg init foo
62 $ cd foo
57 $ cd foo
63 $ touch a && hg ci -Aqm a
58 $ touch a && hg ci -Aqm a
64 $ hg mv a b
59 $ hg mv a b
65 $ echo b1 >> b
60 $ echo b1 >> b
66 $ hg ci -Aqm b1
61 $ hg ci -Aqm b1
67 $ hg up 0
62 $ hg up 0
68 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
63 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
69 $ hg mv a b
64 $ hg mv a b
70 $ echo b2 >> b
65 $ echo b2 >> b
71 $ hg ci -Aqm b2
66 $ hg ci -Aqm b2
72 $ hg graft 1
67 $ hg graft 1
73 grafting 1:5974126fad84 "b1"
68 grafting 1:5974126fad84 "b1"
74 merging b
69 merging b
75 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
70 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
76 abort: unresolved conflicts, can't continue
71 abort: unresolved conflicts, can't continue
77 (use 'hg resolve' and 'hg graft --continue')
72 (use 'hg resolve' and 'hg graft --continue')
78 [1]
73 [1]
79 $ echo a > b
74 $ echo a > b
80 $ echo b3 >> b
75 $ echo b3 >> b
81 $ hg resolve --mark b
76 $ hg resolve --mark b
82 (no more unresolved files)
77 (no more unresolved files)
83 continue: hg graft --continue
78 continue: hg graft --continue
84 $ hg graft --continue
79 $ hg graft --continue
85 grafting 1:5974126fad84 "b1"
80 grafting 1:5974126fad84 "b1"
86 $ hg log -f b -T 'changeset: {rev}:{node|short}\nsummary: {desc}\n\n'
81 $ hg log -f b -T 'changeset: {rev}:{node|short}\nsummary: {desc}\n\n'
87 changeset: 3:376d30ccffc0
82 changeset: 3:376d30ccffc0
88 summary: b1
83 summary: b1
89
84
90 changeset: 2:416baaa2e5e4
85 changeset: 2:416baaa2e5e4
91 summary: b2
86 summary: b2
92
87
93 changeset: 0:3903775176ed
88 changeset: 0:3903775176ed
94 summary: a
89 summary: a
95
90
96
91
97
92
@@ -1,61 +1,55
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ echo a > a
3 $ echo a > a
4 $ hg ci -Am0
4 $ hg ci -Am0
5 adding a
5 adding a
6
6
7 $ hg -q clone . foo
7 $ hg -q clone . foo
8
8
9 $ touch .hg/store/journal
9 $ touch .hg/store/journal
10
10
11 $ echo foo > a
11 $ echo foo > a
12 $ hg ci -Am0
12 $ hg ci -Am0
13 abort: abandoned transaction found
13 abort: abandoned transaction found
14 (run 'hg recover' to clean up transaction)
14 (run 'hg recover' to clean up transaction)
15 [255]
15 [255]
16
16
17 $ hg recover
17 $ hg recover
18 rolling back interrupted transaction
18 rolling back interrupted transaction
19 (verify step skipped, run `hg verify` to check your repository content)
19 (verify step skipped, run `hg verify` to check your repository content)
20
20
21 recover, explicit verify
21 recover, explicit verify
22
22
23 $ touch .hg/store/journal
23 $ touch .hg/store/journal
24 $ hg ci -Am0
24 $ hg ci -Am0
25 abort: abandoned transaction found
25 abort: abandoned transaction found
26 (run 'hg recover' to clean up transaction)
26 (run 'hg recover' to clean up transaction)
27 [255]
27 [255]
28 $ hg recover --verify
28 $ hg recover --verify -q
29 rolling back interrupted transaction
30 checking changesets
31 checking manifests
32 crosschecking files in changesets and manifests
33 checking files
34 checked 1 changesets with 1 changes to 1 files
35
29
36 recover, no verify
30 recover, no verify
37
31
38 $ touch .hg/store/journal
32 $ touch .hg/store/journal
39 $ hg ci -Am0
33 $ hg ci -Am0
40 abort: abandoned transaction found
34 abort: abandoned transaction found
41 (run 'hg recover' to clean up transaction)
35 (run 'hg recover' to clean up transaction)
42 [255]
36 [255]
43 $ hg recover --no-verify
37 $ hg recover --no-verify
44 rolling back interrupted transaction
38 rolling back interrupted transaction
45 (verify step skipped, run `hg verify` to check your repository content)
39 (verify step skipped, run `hg verify` to check your repository content)
46
40
47
41
48 Check that zero-size journals are correctly aborted:
42 Check that zero-size journals are correctly aborted:
49
43
50 #if unix-permissions no-root
44 #if unix-permissions no-root
51 $ hg bundle -qa repo.hg
45 $ hg bundle -qa repo.hg
52 $ chmod -w foo/.hg/store/00changelog.i
46 $ chmod -w foo/.hg/store/00changelog.i
53
47
54 $ hg -R foo unbundle repo.hg
48 $ hg -R foo unbundle repo.hg
55 adding changesets
49 adding changesets
56 abort: Permission denied: '$TESTTMP/repo/foo/.hg/store/.00changelog.i-*' (glob)
50 abort: Permission denied: '$TESTTMP/repo/foo/.hg/store/.00changelog.i-*' (glob)
57 [255]
51 [255]
58
52
59 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
53 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
60 #endif
54 #endif
61
55
@@ -1,1475 +1,1470
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 Run kwdemo outside a repo
3 Run kwdemo outside a repo
4 $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo
4 $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo
5 [extensions]
5 [extensions]
6 keyword =
6 keyword =
7 [keyword]
7 [keyword]
8 demo.txt =
8 demo.txt =
9 [keywordset]
9 [keywordset]
10 svn = False
10 svn = False
11 [keywordmaps]
11 [keywordmaps]
12 Foo = {author|user}
12 Foo = {author|user}
13 $Foo: test $
13 $Foo: test $
14
14
15 $ cat <<EOF >> $HGRCPATH
15 $ cat <<EOF >> $HGRCPATH
16 > [extensions]
16 > [extensions]
17 > keyword =
17 > keyword =
18 > mq =
18 > mq =
19 > notify =
19 > notify =
20 > record =
20 > record =
21 > transplant =
21 > transplant =
22 > [ui]
22 > [ui]
23 > interactive = true
23 > interactive = true
24 > EOF
24 > EOF
25
25
26 hide outer repo
26 hide outer repo
27 $ hg init
27 $ hg init
28
28
29 Run kwdemo before [keyword] files are set up
29 Run kwdemo before [keyword] files are set up
30 as it would succeed without uisetup otherwise
30 as it would succeed without uisetup otherwise
31
31
32 $ hg --quiet kwdemo
32 $ hg --quiet kwdemo
33 [extensions]
33 [extensions]
34 keyword =
34 keyword =
35 [keyword]
35 [keyword]
36 demo.txt =
36 demo.txt =
37 [keywordset]
37 [keywordset]
38 svn = False
38 svn = False
39 [keywordmaps]
39 [keywordmaps]
40 Author = {author|user}
40 Author = {author|user}
41 Date = {date|utcdate}
41 Date = {date|utcdate}
42 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
42 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
43 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
43 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
44 RCSFile = {file|basename},v
44 RCSFile = {file|basename},v
45 RCSfile = {file|basename},v
45 RCSfile = {file|basename},v
46 Revision = {node|short}
46 Revision = {node|short}
47 Source = {root}/{file},v
47 Source = {root}/{file},v
48 $Author: test $
48 $Author: test $
49 $Date: ????/??/?? ??:??:?? $ (glob)
49 $Date: ????/??/?? ??:??:?? $ (glob)
50 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
50 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
51 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
51 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
52 $RCSFile: demo.txt,v $
52 $RCSFile: demo.txt,v $
53 $RCSfile: demo.txt,v $
53 $RCSfile: demo.txt,v $
54 $Revision: ???????????? $ (glob)
54 $Revision: ???????????? $ (glob)
55 $Source: */demo.txt,v $ (glob)
55 $Source: */demo.txt,v $ (glob)
56
56
57 $ hg --quiet kwdemo "Branch = {branches}"
57 $ hg --quiet kwdemo "Branch = {branches}"
58 [extensions]
58 [extensions]
59 keyword =
59 keyword =
60 [keyword]
60 [keyword]
61 demo.txt =
61 demo.txt =
62 [keywordset]
62 [keywordset]
63 svn = False
63 svn = False
64 [keywordmaps]
64 [keywordmaps]
65 Branch = {branches}
65 Branch = {branches}
66 $Branch: demobranch $
66 $Branch: demobranch $
67
67
68 (test template filter svnisodate and svnutcdate)
68 (test template filter svnisodate and svnutcdate)
69
69
70 $ hg --quiet kwdemo --config keywordset.svn=True
70 $ hg --quiet kwdemo --config keywordset.svn=True
71 [extensions]
71 [extensions]
72 keyword =
72 keyword =
73 [keyword]
73 [keyword]
74 demo.txt =
74 demo.txt =
75 [keywordset]
75 [keywordset]
76 svn = True
76 svn = True
77 [keywordmaps]
77 [keywordmaps]
78 Author = {author|user}
78 Author = {author|user}
79 Date = {date|svnisodate}
79 Date = {date|svnisodate}
80 Id = {file|basename},v {node|short} {date|svnutcdate} {author|user}
80 Id = {file|basename},v {node|short} {date|svnutcdate} {author|user}
81 LastChangedBy = {author|user}
81 LastChangedBy = {author|user}
82 LastChangedDate = {date|svnisodate}
82 LastChangedDate = {date|svnisodate}
83 LastChangedRevision = {node|short}
83 LastChangedRevision = {node|short}
84 Revision = {node|short}
84 Revision = {node|short}
85 $Author: test $
85 $Author: test $
86 $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
86 $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
87 $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob)
87 $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob)
88 $LastChangedBy: test $
88 $LastChangedBy: test $
89 $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
89 $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
90 $LastChangedRevision: ???????????? $ (glob)
90 $LastChangedRevision: ???????????? $ (glob)
91 $Revision: ???????????? $ (glob)
91 $Revision: ???????????? $ (glob)
92
92
93 $ cat <<EOF >> $HGRCPATH
93 $ cat <<EOF >> $HGRCPATH
94 > [keyword]
94 > [keyword]
95 > ** =
95 > ** =
96 > b = ignore
96 > b = ignore
97 > i = ignore
97 > i = ignore
98 > [hooks]
98 > [hooks]
99 > EOF
99 > EOF
100 $ cp $HGRCPATH $HGRCPATH.nohooks
100 $ cp $HGRCPATH $HGRCPATH.nohooks
101 > cat <<EOF >> $HGRCPATH
101 > cat <<EOF >> $HGRCPATH
102 > commit=
102 > commit=
103 > commit.test=cp a hooktest
103 > commit.test=cp a hooktest
104 > EOF
104 > EOF
105
105
106 $ hg init Test-bndl
106 $ hg init Test-bndl
107 $ cd Test-bndl
107 $ cd Test-bndl
108
108
109 kwshrink should exit silently in empty/invalid repo
109 kwshrink should exit silently in empty/invalid repo
110
110
111 $ hg kwshrink
111 $ hg kwshrink
112
112
113 Symlinks cannot be created on Windows.
113 Symlinks cannot be created on Windows.
114 A bundle to test this was made with:
114 A bundle to test this was made with:
115 hg init t
115 hg init t
116 cd t
116 cd t
117 echo a > a
117 echo a > a
118 ln -s a sym
118 ln -s a sym
119 hg add sym
119 hg add sym
120 hg ci -m addsym -u mercurial
120 hg ci -m addsym -u mercurial
121 hg bundle --base null ../test-keyword.hg
121 hg bundle --base null ../test-keyword.hg
122
122
123 $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg
123 $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg
124 adding changesets
124 adding changesets
125 adding manifests
125 adding manifests
126 adding file changes
126 adding file changes
127 added 1 changesets with 1 changes to 1 files
127 added 1 changesets with 1 changes to 1 files
128 new changesets a2392c293916 (1 drafts)
128 new changesets a2392c293916 (1 drafts)
129 (run 'hg update' to get a working copy)
129 (run 'hg update' to get a working copy)
130 $ hg up a2392c293916
130 $ hg up a2392c293916
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132
132
133 $ echo 'expand $Id$' > a
133 $ echo 'expand $Id$' > a
134 $ echo 'do not process $Id:' >> a
134 $ echo 'do not process $Id:' >> a
135 $ echo 'xxx $' >> a
135 $ echo 'xxx $' >> a
136 $ echo 'ignore $Id$' > b
136 $ echo 'ignore $Id$' > b
137
137
138 Output files as they were created
138 Output files as they were created
139
139
140 $ cat a b
140 $ cat a b
141 expand $Id$
141 expand $Id$
142 do not process $Id:
142 do not process $Id:
143 xxx $
143 xxx $
144 ignore $Id$
144 ignore $Id$
145
145
146 no kwfiles
146 no kwfiles
147
147
148 $ hg kwfiles
148 $ hg kwfiles
149
149
150 untracked candidates
150 untracked candidates
151
151
152 $ hg -v kwfiles --unknown
152 $ hg -v kwfiles --unknown
153 k a
153 k a
154
154
155 Add files and check status
155 Add files and check status
156
156
157 $ hg addremove
157 $ hg addremove
158 adding a
158 adding a
159 adding b
159 adding b
160 $ hg status
160 $ hg status
161 A a
161 A a
162 A b
162 A b
163
163
164
164
165 Default keyword expansion including commit hook
165 Default keyword expansion including commit hook
166 Interrupted commit should not change state or run commit hook
166 Interrupted commit should not change state or run commit hook
167
167
168 $ hg --debug commit
168 $ hg --debug commit
169 abort: empty commit message
169 abort: empty commit message
170 [10]
170 [10]
171 $ hg status
171 $ hg status
172 A a
172 A a
173 A b
173 A b
174
174
175 Commit with several checks
175 Commit with several checks
176
176
177 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
177 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
178 committing files:
178 committing files:
179 a
179 a
180 b
180 b
181 committing manifest
181 committing manifest
182 committing changelog
182 committing changelog
183 overwriting a expanding keywords
183 overwriting a expanding keywords
184 updating the branch cache
184 updating the branch cache
185 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
185 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
186 running hook commit.test: cp a hooktest
186 running hook commit.test: cp a hooktest
187 $ hg status
187 $ hg status
188 ? hooktest
188 ? hooktest
189 $ hg debugrebuildstate
189 $ hg debugrebuildstate
190 $ hg --quiet identify
190 $ hg --quiet identify
191 ef63ca68695b
191 ef63ca68695b
192
192
193 cat files in working directory with keywords expanded
193 cat files in working directory with keywords expanded
194
194
195 $ cat a b
195 $ cat a b
196 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
196 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
197 do not process $Id:
197 do not process $Id:
198 xxx $
198 xxx $
199 ignore $Id$
199 ignore $Id$
200
200
201 hg cat files and symlink, no expansion
201 hg cat files and symlink, no expansion
202
202
203 $ hg cat sym a b && echo
203 $ hg cat sym a b && echo
204 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
204 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
205 do not process $Id:
205 do not process $Id:
206 xxx $
206 xxx $
207 ignore $Id$
207 ignore $Id$
208 a
208 a
209
209
210 $ diff a hooktest
210 $ diff a hooktest
211
211
212 $ cp $HGRCPATH.nohooks $HGRCPATH
212 $ cp $HGRCPATH.nohooks $HGRCPATH
213 $ rm hooktest
213 $ rm hooktest
214
214
215 hg status of kw-ignored binary file starting with '\1\n'
215 hg status of kw-ignored binary file starting with '\1\n'
216
216
217 >>> open("i", "wb").write(b"\1\nfoo") and None
217 >>> open("i", "wb").write(b"\1\nfoo") and None
218 $ hg -q commit -Am metasep i
218 $ hg -q commit -Am metasep i
219 $ hg status
219 $ hg status
220 >>> open("i", "wb").write(b"\1\nbar") and None
220 >>> open("i", "wb").write(b"\1\nbar") and None
221 $ hg status
221 $ hg status
222 M i
222 M i
223 $ hg -q commit -m "modify metasep" i
223 $ hg -q commit -m "modify metasep" i
224 $ hg status --rev 2:3
224 $ hg status --rev 2:3
225 M i
225 M i
226 $ touch empty
226 $ touch empty
227 $ hg -q commit -A -m "another file"
227 $ hg -q commit -A -m "another file"
228 $ hg status -A --rev 3:4 i
228 $ hg status -A --rev 3:4 i
229 C i
229 C i
230
230
231 $ hg -q strip --no-backup 2
231 $ hg -q strip --no-backup 2
232
232
233 Test hook execution
233 Test hook execution
234
234
235 bundle
235 bundle
236
236
237 $ hg bundle --base null ../kw.hg
237 $ hg bundle --base null ../kw.hg
238 2 changesets found
238 2 changesets found
239 $ cd ..
239 $ cd ..
240 $ hg init Test
240 $ hg init Test
241 $ cd Test
241 $ cd Test
242
242
243 Notify on pull to check whether keywords stay as is in email
243 Notify on pull to check whether keywords stay as is in email
244 ie. if patch.diff wrapper acts as it should
244 ie. if patch.diff wrapper acts as it should
245
245
246 $ cat <<EOF >> $HGRCPATH
246 $ cat <<EOF >> $HGRCPATH
247 > [hooks]
247 > [hooks]
248 > incoming.notify = python:hgext.notify.hook
248 > incoming.notify = python:hgext.notify.hook
249 > [notify]
249 > [notify]
250 > sources = pull
250 > sources = pull
251 > diffstat = False
251 > diffstat = False
252 > maxsubject = 15
252 > maxsubject = 15
253 > [reposubs]
253 > [reposubs]
254 > * = Test
254 > * = Test
255 > EOF
255 > EOF
256
256
257 Pull from bundle and trigger notify
257 Pull from bundle and trigger notify
258
258
259 $ hg pull -u ../kw.hg | \
259 $ hg pull -u ../kw.hg | \
260 > "$PYTHON" $TESTDIR/unwrap-message-id.py
260 > "$PYTHON" $TESTDIR/unwrap-message-id.py
261 pulling from ../kw.hg
261 pulling from ../kw.hg
262 requesting all changes
262 requesting all changes
263 adding changesets
263 adding changesets
264 adding manifests
264 adding manifests
265 adding file changes
265 adding file changes
266 added 2 changesets with 3 changes to 3 files
266 added 2 changesets with 3 changes to 3 files
267 new changesets a2392c293916:ef63ca68695b (2 drafts)
267 new changesets a2392c293916:ef63ca68695b (2 drafts)
268 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 MIME-Version: 1.0
269 MIME-Version: 1.0
270 Content-Type: text/plain; charset="us-ascii"
270 Content-Type: text/plain; charset="us-ascii"
271 Content-Transfer-Encoding: 7bit
271 Content-Transfer-Encoding: 7bit
272 Date: * (glob)
272 Date: * (glob)
273 Subject: changeset in...
273 Subject: changeset in...
274 From: mercurial
274 From: mercurial
275 X-Hg-Notification: changeset a2392c293916
275 X-Hg-Notification: changeset a2392c293916
276 Message-Id: <hg.a2392c293916*> (glob)
276 Message-Id: <hg.a2392c293916*> (glob)
277 To: Test
277 To: Test
278
278
279 changeset a2392c293916 in $TESTTMP/Test
279 changeset a2392c293916 in $TESTTMP/Test
280 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
280 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
281 description:
281 description:
282 addsym
282 addsym
283
283
284 diffs (6 lines):
284 diffs (6 lines):
285
285
286 diff -r 000000000000 -r a2392c293916 sym
286 diff -r 000000000000 -r a2392c293916 sym
287 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
287 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
288 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
288 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
289 @@ -0,0 +1,1 @@
289 @@ -0,0 +1,1 @@
290 +a
290 +a
291 \ No newline at end of file
291 \ No newline at end of file
292 MIME-Version: 1.0
292 MIME-Version: 1.0
293 Content-Type: text/plain; charset="us-ascii"
293 Content-Type: text/plain; charset="us-ascii"
294 Content-Transfer-Encoding: 7bit
294 Content-Transfer-Encoding: 7bit
295 Date:* (glob)
295 Date:* (glob)
296 Subject: changeset in...
296 Subject: changeset in...
297 From: User Name <user@example.com>
297 From: User Name <user@example.com>
298 X-Hg-Notification: changeset ef63ca68695b
298 X-Hg-Notification: changeset ef63ca68695b
299 Message-Id: <hg.ef63ca68695b*> (glob)
299 Message-Id: <hg.ef63ca68695b*> (glob)
300 To: Test
300 To: Test
301
301
302 changeset ef63ca68695b in $TESTTMP/Test
302 changeset ef63ca68695b in $TESTTMP/Test
303 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
303 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
304 description:
304 description:
305 absym
305 absym
306
306
307 diffs (12 lines):
307 diffs (12 lines):
308
308
309 diff -r a2392c293916 -r ef63ca68695b a
309 diff -r a2392c293916 -r ef63ca68695b a
310 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
310 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
311 +++ b/a Thu Jan 01 00:00:00 1970 +0000
311 +++ b/a Thu Jan 01 00:00:00 1970 +0000
312 @@ -0,0 +1,3 @@
312 @@ -0,0 +1,3 @@
313 +expand $Id$
313 +expand $Id$
314 +do not process $Id:
314 +do not process $Id:
315 +xxx $
315 +xxx $
316 diff -r a2392c293916 -r ef63ca68695b b
316 diff -r a2392c293916 -r ef63ca68695b b
317 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
317 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
318 +++ b/b Thu Jan 01 00:00:00 1970 +0000
318 +++ b/b Thu Jan 01 00:00:00 1970 +0000
319 @@ -0,0 +1,1 @@
319 @@ -0,0 +1,1 @@
320 +ignore $Id$
320 +ignore $Id$
321
321
322 $ cp $HGRCPATH.nohooks $HGRCPATH
322 $ cp $HGRCPATH.nohooks $HGRCPATH
323
323
324 Touch files and check with status
324 Touch files and check with status
325
325
326 $ touch a b
326 $ touch a b
327 $ hg status
327 $ hg status
328
328
329 Update and expand
329 Update and expand
330
330
331 $ rm sym a b
331 $ rm sym a b
332 $ hg update -C
332 $ hg update -C
333 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
334 $ cat a b
334 $ cat a b
335 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
335 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
336 do not process $Id:
336 do not process $Id:
337 xxx $
337 xxx $
338 ignore $Id$
338 ignore $Id$
339
339
340 Check whether expansion is filewise and file mode is preserved
340 Check whether expansion is filewise and file mode is preserved
341
341
342 $ echo '$Id$' > c
342 $ echo '$Id$' > c
343 $ echo 'tests for different changenodes' >> c
343 $ echo 'tests for different changenodes' >> c
344 #if unix-permissions
344 #if unix-permissions
345 $ chmod 600 c
345 $ chmod 600 c
346 $ ls -l c | cut -b 1-10
346 $ ls -l c | cut -b 1-10
347 -rw-------
347 -rw-------
348 #endif
348 #endif
349
349
350 commit file c
350 commit file c
351
351
352 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
352 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
353 adding c
353 adding c
354 #if unix-permissions
354 #if unix-permissions
355 $ ls -l c | cut -b 1-10
355 $ ls -l c | cut -b 1-10
356 -rw-------
356 -rw-------
357 #endif
357 #endif
358
358
359 force expansion
359 force expansion
360
360
361 $ hg -v kwexpand
361 $ hg -v kwexpand
362 overwriting a expanding keywords
362 overwriting a expanding keywords
363 overwriting c expanding keywords
363 overwriting c expanding keywords
364
364
365 compare changenodes in a and c
365 compare changenodes in a and c
366
366
367 $ cat a c
367 $ cat a c
368 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
368 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
369 do not process $Id:
369 do not process $Id:
370 xxx $
370 xxx $
371 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
371 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
372 tests for different changenodes
372 tests for different changenodes
373
373
374 record
374 record
375
375
376 $ echo '$Id$' > r
376 $ echo '$Id$' > r
377 $ hg add r
377 $ hg add r
378
378
379 record chunk
379 record chunk
380
380
381 >>> lines = open('a', 'rb').readlines()
381 >>> lines = open('a', 'rb').readlines()
382 >>> lines.insert(1, b'foo\n')
382 >>> lines.insert(1, b'foo\n')
383 >>> lines.append(b'bar\n')
383 >>> lines.append(b'bar\n')
384 >>> open('a', 'wb').writelines(lines)
384 >>> open('a', 'wb').writelines(lines)
385 $ hg record -d '10 1' -m rectest a<<EOF
385 $ hg record -d '10 1' -m rectest a<<EOF
386 > y
386 > y
387 > n
387 > n
388 > EOF
388 > EOF
389 diff --git a/a b/a
389 diff --git a/a b/a
390 2 hunks, 2 lines changed
390 2 hunks, 2 lines changed
391 @@ -1,3 +1,4 @@
391 @@ -1,3 +1,4 @@
392 expand $Id$
392 expand $Id$
393 +foo
393 +foo
394 do not process $Id:
394 do not process $Id:
395 xxx $
395 xxx $
396 record change 1/2 to 'a'?
396 record change 1/2 to 'a'?
397 (enter ? for help) [Ynesfdaq?] y
397 (enter ? for help) [Ynesfdaq?] y
398
398
399 @@ -2,2 +3,3 @@
399 @@ -2,2 +3,3 @@
400 do not process $Id:
400 do not process $Id:
401 xxx $
401 xxx $
402 +bar
402 +bar
403 record change 2/2 to 'a'?
403 record change 2/2 to 'a'?
404 (enter ? for help) [Ynesfdaq?] n
404 (enter ? for help) [Ynesfdaq?] n
405
405
406
406
407 $ hg identify
407 $ hg identify
408 5f5eb23505c3+ tip
408 5f5eb23505c3+ tip
409 $ hg status
409 $ hg status
410 M a
410 M a
411 A r
411 A r
412
412
413 Cat modified file a
413 Cat modified file a
414
414
415 $ cat a
415 $ cat a
416 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
416 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
417 foo
417 foo
418 do not process $Id:
418 do not process $Id:
419 xxx $
419 xxx $
420 bar
420 bar
421
421
422 Diff remaining chunk
422 Diff remaining chunk
423
423
424 $ hg diff a
424 $ hg diff a
425 diff -r 5f5eb23505c3 a
425 diff -r 5f5eb23505c3 a
426 --- a/a Thu Jan 01 00:00:09 1970 -0000
426 --- a/a Thu Jan 01 00:00:09 1970 -0000
427 +++ b/a * (glob)
427 +++ b/a * (glob)
428 @@ -2,3 +2,4 @@
428 @@ -2,3 +2,4 @@
429 foo
429 foo
430 do not process $Id:
430 do not process $Id:
431 xxx $
431 xxx $
432 +bar
432 +bar
433
433
434 $ hg rollback
434 $ hg rollback
435 repository tip rolled back to revision 2 (undo commit)
435 repository tip rolled back to revision 2 (undo commit)
436 working directory now based on revision 2
436 working directory now based on revision 2
437
437
438 Record all chunks in file a
438 Record all chunks in file a
439
439
440 $ echo foo > msg
440 $ echo foo > msg
441
441
442 - do not use "hg record -m" here!
442 - do not use "hg record -m" here!
443
443
444 $ hg record -l msg -d '11 1' a<<EOF
444 $ hg record -l msg -d '11 1' a<<EOF
445 > y
445 > y
446 > y
446 > y
447 > y
447 > y
448 > EOF
448 > EOF
449 diff --git a/a b/a
449 diff --git a/a b/a
450 2 hunks, 2 lines changed
450 2 hunks, 2 lines changed
451 @@ -1,3 +1,4 @@
451 @@ -1,3 +1,4 @@
452 expand $Id$
452 expand $Id$
453 +foo
453 +foo
454 do not process $Id:
454 do not process $Id:
455 xxx $
455 xxx $
456 record change 1/2 to 'a'?
456 record change 1/2 to 'a'?
457 (enter ? for help) [Ynesfdaq?] y
457 (enter ? for help) [Ynesfdaq?] y
458
458
459 @@ -2,2 +3,3 @@
459 @@ -2,2 +3,3 @@
460 do not process $Id:
460 do not process $Id:
461 xxx $
461 xxx $
462 +bar
462 +bar
463 record change 2/2 to 'a'?
463 record change 2/2 to 'a'?
464 (enter ? for help) [Ynesfdaq?] y
464 (enter ? for help) [Ynesfdaq?] y
465
465
466
466
467 File a should be clean
467 File a should be clean
468
468
469 $ hg status -A a
469 $ hg status -A a
470 C a
470 C a
471
471
472 rollback and revert expansion
472 rollback and revert expansion
473
473
474 $ cat a
474 $ cat a
475 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
475 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
476 foo
476 foo
477 do not process $Id:
477 do not process $Id:
478 xxx $
478 xxx $
479 bar
479 bar
480 $ hg --verbose rollback
480 $ hg --verbose rollback
481 repository tip rolled back to revision 2 (undo commit)
481 repository tip rolled back to revision 2 (undo commit)
482 working directory now based on revision 2
482 working directory now based on revision 2
483 overwriting a expanding keywords
483 overwriting a expanding keywords
484 $ hg status a
484 $ hg status a
485 M a
485 M a
486 $ cat a
486 $ cat a
487 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
487 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
488 foo
488 foo
489 do not process $Id:
489 do not process $Id:
490 xxx $
490 xxx $
491 bar
491 bar
492 $ echo '$Id$' > y
492 $ echo '$Id$' > y
493 $ echo '$Id$' > z
493 $ echo '$Id$' > z
494 $ hg add y
494 $ hg add y
495 $ hg commit -Am "rollback only" z
495 $ hg commit -Am "rollback only" z
496 $ cat z
496 $ cat z
497 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
497 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
498 $ hg --verbose rollback
498 $ hg --verbose rollback
499 repository tip rolled back to revision 2 (undo commit)
499 repository tip rolled back to revision 2 (undo commit)
500 working directory now based on revision 2
500 working directory now based on revision 2
501 overwriting z shrinking keywords
501 overwriting z shrinking keywords
502
502
503 Only z should be overwritten
503 Only z should be overwritten
504
504
505 $ hg status a y z
505 $ hg status a y z
506 M a
506 M a
507 A y
507 A y
508 A z
508 A z
509 $ cat z
509 $ cat z
510 $Id$
510 $Id$
511 $ hg forget y z
511 $ hg forget y z
512 $ rm y z
512 $ rm y z
513
513
514 record added file alone
514 record added file alone
515
515
516 $ hg -v record -l msg -d '12 2' r<<EOF
516 $ hg -v record -l msg -d '12 2' r<<EOF
517 > y
517 > y
518 > y
518 > y
519 > EOF
519 > EOF
520 diff --git a/r b/r
520 diff --git a/r b/r
521 new file mode 100644
521 new file mode 100644
522 @@ -0,0 +1,1 @@
522 @@ -0,0 +1,1 @@
523 +$Id$
523 +$Id$
524 record this change to 'r'?
524 record this change to 'r'?
525 (enter ? for help) [Ynesfdaq?] y
525 (enter ? for help) [Ynesfdaq?] y
526
526
527 resolving manifests
527 resolving manifests
528 patching file r
528 patching file r
529 committing files:
529 committing files:
530 r
530 r
531 committing manifest
531 committing manifest
532 committing changelog
532 committing changelog
533 committed changeset 3:82a2f715724d
533 committed changeset 3:82a2f715724d
534 overwriting r expanding keywords
534 overwriting r expanding keywords
535 $ hg status r
535 $ hg status r
536 $ hg --verbose rollback
536 $ hg --verbose rollback
537 repository tip rolled back to revision 2 (undo commit)
537 repository tip rolled back to revision 2 (undo commit)
538 working directory now based on revision 2
538 working directory now based on revision 2
539 overwriting r shrinking keywords
539 overwriting r shrinking keywords
540 $ hg forget r
540 $ hg forget r
541 $ rm msg r
541 $ rm msg r
542 $ hg update -C
542 $ hg update -C
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
544
544
545 record added keyword ignored file
545 record added keyword ignored file
546
546
547 $ echo '$Id$' > i
547 $ echo '$Id$' > i
548 $ hg add i
548 $ hg add i
549 $ hg --verbose record -d '13 1' -m recignored<<EOF
549 $ hg --verbose record -d '13 1' -m recignored<<EOF
550 > y
550 > y
551 > y
551 > y
552 > EOF
552 > EOF
553 diff --git a/i b/i
553 diff --git a/i b/i
554 new file mode 100644
554 new file mode 100644
555 examine changes to 'i'?
555 examine changes to 'i'?
556 (enter ? for help) [Ynesfdaq?] y
556 (enter ? for help) [Ynesfdaq?] y
557
557
558 @@ -0,0 +1,1 @@
558 @@ -0,0 +1,1 @@
559 +$Id$
559 +$Id$
560 record this change to 'i'?
560 record this change to 'i'?
561 (enter ? for help) [Ynesfdaq?] y
561 (enter ? for help) [Ynesfdaq?] y
562
562
563 resolving manifests
563 resolving manifests
564 patching file i
564 patching file i
565 committing files:
565 committing files:
566 i
566 i
567 committing manifest
567 committing manifest
568 committing changelog
568 committing changelog
569 committed changeset 3:9f40ceb5a072
569 committed changeset 3:9f40ceb5a072
570 $ cat i
570 $ cat i
571 $Id$
571 $Id$
572 $ hg -q rollback
572 $ hg -q rollback
573 $ hg forget i
573 $ hg forget i
574 $ rm i
574 $ rm i
575
575
576 amend
576 amend
577
577
578 $ echo amend >> a
578 $ echo amend >> a
579 $ echo amend >> b
579 $ echo amend >> b
580 $ hg -q commit -d '14 1' -m 'prepare amend'
580 $ hg -q commit -d '14 1' -m 'prepare amend'
581
581
582 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
582 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
583 overwriting a expanding keywords
583 overwriting a expanding keywords
584 $ hg -q id
584 $ hg -q id
585 67d8c481a6be
585 67d8c481a6be
586 $ head -1 a
586 $ head -1 a
587 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
587 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
588
588
589 $ hg -q strip --no-backup tip
589 $ hg -q strip --no-backup tip
590
590
591 Test patch queue repo
591 Test patch queue repo
592
592
593 $ hg init --mq
593 $ hg init --mq
594 $ hg qimport -r tip -n mqtest.diff
594 $ hg qimport -r tip -n mqtest.diff
595 $ hg commit --mq -m mqtest
595 $ hg commit --mq -m mqtest
596
596
597 Keywords should not be expanded in patch
597 Keywords should not be expanded in patch
598
598
599 $ cat .hg/patches/mqtest.diff
599 $ cat .hg/patches/mqtest.diff
600 # HG changeset patch
600 # HG changeset patch
601 # User User Name <user@example.com>
601 # User User Name <user@example.com>
602 # Date 1 0
602 # Date 1 0
603 # Thu Jan 01 00:00:01 1970 +0000
603 # Thu Jan 01 00:00:01 1970 +0000
604 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
604 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
605 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
605 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
606 cndiff
606 cndiff
607
607
608 diff -r ef63ca68695b -r 40a904bbbe4c c
608 diff -r ef63ca68695b -r 40a904bbbe4c c
609 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
609 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
610 +++ b/c Thu Jan 01 00:00:01 1970 +0000
610 +++ b/c Thu Jan 01 00:00:01 1970 +0000
611 @@ -0,0 +1,2 @@
611 @@ -0,0 +1,2 @@
612 +$Id$
612 +$Id$
613 +tests for different changenodes
613 +tests for different changenodes
614
614
615 $ hg qpop
615 $ hg qpop
616 popping mqtest.diff
616 popping mqtest.diff
617 patch queue now empty
617 patch queue now empty
618
618
619 qgoto, implying qpush, should expand
619 qgoto, implying qpush, should expand
620
620
621 $ hg qgoto mqtest.diff
621 $ hg qgoto mqtest.diff
622 applying mqtest.diff
622 applying mqtest.diff
623 now at: mqtest.diff
623 now at: mqtest.diff
624 $ cat c
624 $ cat c
625 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
625 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
626 tests for different changenodes
626 tests for different changenodes
627 $ hg cat c
627 $ hg cat c
628 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
628 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
629 tests for different changenodes
629 tests for different changenodes
630
630
631 Keywords should not be expanded in filelog
631 Keywords should not be expanded in filelog
632
632
633 $ hg --config 'extensions.keyword=!' cat c
633 $ hg --config 'extensions.keyword=!' cat c
634 $Id$
634 $Id$
635 tests for different changenodes
635 tests for different changenodes
636
636
637 qpop and move on
637 qpop and move on
638
638
639 $ hg qpop
639 $ hg qpop
640 popping mqtest.diff
640 popping mqtest.diff
641 patch queue now empty
641 patch queue now empty
642
642
643 Copy and show added kwfiles
643 Copy and show added kwfiles
644
644
645 $ hg cp a c
645 $ hg cp a c
646 $ hg kwfiles
646 $ hg kwfiles
647 a
647 a
648 c
648 c
649
649
650 Commit and show expansion in original and copy
650 Commit and show expansion in original and copy
651
651
652 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
652 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
653 committing files:
653 committing files:
654 c
654 c
655 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
655 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
656 committing manifest
656 committing manifest
657 committing changelog
657 committing changelog
658 overwriting c expanding keywords
658 overwriting c expanding keywords
659 updating the branch cache
659 updating the branch cache
660 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
660 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
661 $ cat a c
661 $ cat a c
662 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
662 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
663 do not process $Id:
663 do not process $Id:
664 xxx $
664 xxx $
665 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
665 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
666 do not process $Id:
666 do not process $Id:
667 xxx $
667 xxx $
668
668
669 Touch copied c and check its status
669 Touch copied c and check its status
670
670
671 $ touch c
671 $ touch c
672 $ hg status
672 $ hg status
673
673
674 Copy kwfile to keyword ignored file unexpanding keywords
674 Copy kwfile to keyword ignored file unexpanding keywords
675
675
676 $ hg --verbose copy a i
676 $ hg --verbose copy a i
677 copying a to i
677 copying a to i
678 overwriting i shrinking keywords
678 overwriting i shrinking keywords
679 $ head -n 1 i
679 $ head -n 1 i
680 expand $Id$
680 expand $Id$
681 $ hg forget i
681 $ hg forget i
682 $ rm i
682 $ rm i
683
683
684 Copy ignored file to ignored file: no overwriting
684 Copy ignored file to ignored file: no overwriting
685
685
686 $ hg --verbose copy b i
686 $ hg --verbose copy b i
687 copying b to i
687 copying b to i
688 $ hg forget i
688 $ hg forget i
689 $ rm i
689 $ rm i
690
690
691 cp symlink file; hg cp -A symlink file (part1)
691 cp symlink file; hg cp -A symlink file (part1)
692 - copied symlink points to kwfile: overwrite
692 - copied symlink points to kwfile: overwrite
693
693
694 #if symlink
694 #if symlink
695 $ cp sym i
695 $ cp sym i
696 $ ls -l i
696 $ ls -l i
697 -rw-r--r--* (glob)
697 -rw-r--r--* (glob)
698 $ head -1 i
698 $ head -1 i
699 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
699 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
700 $ hg copy --after --verbose sym i
700 $ hg copy --after --verbose sym i
701 copying sym to i
701 copying sym to i
702 overwriting i shrinking keywords
702 overwriting i shrinking keywords
703 $ head -1 i
703 $ head -1 i
704 expand $Id$
704 expand $Id$
705 $ hg forget i
705 $ hg forget i
706 $ rm i
706 $ rm i
707 #endif
707 #endif
708
708
709 Test different options of hg kwfiles
709 Test different options of hg kwfiles
710
710
711 $ hg kwfiles
711 $ hg kwfiles
712 a
712 a
713 c
713 c
714 $ hg -v kwfiles --ignore
714 $ hg -v kwfiles --ignore
715 I b
715 I b
716 I sym
716 I sym
717 $ hg kwfiles --all
717 $ hg kwfiles --all
718 K a
718 K a
719 K c
719 K c
720 I b
720 I b
721 I sym
721 I sym
722
722
723 Diff specific revision
723 Diff specific revision
724
724
725 $ hg diff --rev 1
725 $ hg diff --rev 1
726 diff -r ef63ca68695b c
726 diff -r ef63ca68695b c
727 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
727 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
728 +++ b/c * (glob)
728 +++ b/c * (glob)
729 @@ -0,0 +1,3 @@
729 @@ -0,0 +1,3 @@
730 +expand $Id$
730 +expand $Id$
731 +do not process $Id:
731 +do not process $Id:
732 +xxx $
732 +xxx $
733
733
734 Status after rollback:
734 Status after rollback:
735
735
736 $ hg rollback
736 $ hg rollback
737 repository tip rolled back to revision 1 (undo commit)
737 repository tip rolled back to revision 1 (undo commit)
738 working directory now based on revision 1
738 working directory now based on revision 1
739 $ hg status
739 $ hg status
740 A c
740 A c
741 $ hg update --clean
741 $ hg update --clean
742 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
742 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
743
743
744 #if symlink
744 #if symlink
745
745
746 cp symlink file; hg cp -A symlink file (part2)
746 cp symlink file; hg cp -A symlink file (part2)
747 - copied symlink points to kw ignored file: do not overwrite
747 - copied symlink points to kw ignored file: do not overwrite
748
748
749 $ cat a > i
749 $ cat a > i
750 $ ln -s i symignored
750 $ ln -s i symignored
751 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
751 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
752 $ cp symignored x
752 $ cp symignored x
753 $ hg copy --after --verbose symignored x
753 $ hg copy --after --verbose symignored x
754 copying symignored to x
754 copying symignored to x
755 $ head -n 1 x
755 $ head -n 1 x
756 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
756 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
757 $ hg forget x
757 $ hg forget x
758 $ rm x
758 $ rm x
759
759
760 $ hg rollback
760 $ hg rollback
761 repository tip rolled back to revision 1 (undo commit)
761 repository tip rolled back to revision 1 (undo commit)
762 working directory now based on revision 1
762 working directory now based on revision 1
763 $ hg update --clean
763 $ hg update --clean
764 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
764 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
765 $ rm i symignored
765 $ rm i symignored
766
766
767 #endif
767 #endif
768
768
769 Custom keywordmaps as argument to kwdemo
769 Custom keywordmaps as argument to kwdemo
770
770
771 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
771 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
772 [extensions]
772 [extensions]
773 keyword =
773 keyword =
774 [keyword]
774 [keyword]
775 ** =
775 ** =
776 b = ignore
776 b = ignore
777 demo.txt =
777 demo.txt =
778 i = ignore
778 i = ignore
779 [keywordset]
779 [keywordset]
780 svn = False
780 svn = False
781 [keywordmaps]
781 [keywordmaps]
782 Xinfo = {author}: {desc}
782 Xinfo = {author}: {desc}
783 $Xinfo: test: hg keyword configuration and expansion example $
783 $Xinfo: test: hg keyword configuration and expansion example $
784
784
785 Configure custom keywordmaps
785 Configure custom keywordmaps
786
786
787 $ cat <<EOF >>$HGRCPATH
787 $ cat <<EOF >>$HGRCPATH
788 > [keywordmaps]
788 > [keywordmaps]
789 > Id = {file} {node|short} {date|rfc822date} {author|user}
789 > Id = {file} {node|short} {date|rfc822date} {author|user}
790 > Xinfo = {author}: {desc}
790 > Xinfo = {author}: {desc}
791 > EOF
791 > EOF
792
792
793 Cat and hg cat files before custom expansion
793 Cat and hg cat files before custom expansion
794
794
795 $ cat a b
795 $ cat a b
796 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
796 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
797 do not process $Id:
797 do not process $Id:
798 xxx $
798 xxx $
799 ignore $Id$
799 ignore $Id$
800 $ hg cat sym a b && echo
800 $ hg cat sym a b && echo
801 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
801 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
802 do not process $Id:
802 do not process $Id:
803 xxx $
803 xxx $
804 ignore $Id$
804 ignore $Id$
805 a
805 a
806
806
807 Write custom keyword and prepare multi-line commit message
807 Write custom keyword and prepare multi-line commit message
808
808
809 $ echo '$Xinfo$' >> a
809 $ echo '$Xinfo$' >> a
810 $ cat <<EOF >> log
810 $ cat <<EOF >> log
811 > firstline
811 > firstline
812 > secondline
812 > secondline
813 > EOF
813 > EOF
814
814
815 Interrupted commit should not change state
815 Interrupted commit should not change state
816
816
817 $ hg commit
817 $ hg commit
818 abort: empty commit message
818 abort: empty commit message
819 [10]
819 [10]
820 $ hg status
820 $ hg status
821 M a
821 M a
822 ? c
822 ? c
823 ? log
823 ? log
824
824
825 Commit with multi-line message and custom expansion
825 Commit with multi-line message and custom expansion
826
826
827 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
827 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
828 committing files:
828 committing files:
829 a
829 a
830 committing manifest
830 committing manifest
831 committing changelog
831 committing changelog
832 overwriting a expanding keywords
832 overwriting a expanding keywords
833 updating the branch cache
833 updating the branch cache
834 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
834 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
835 $ rm log
835 $ rm log
836
836
837 Stat, verify and show custom expansion (firstline)
837 Stat, verify and show custom expansion (firstline)
838
838
839 $ hg status
839 $ hg status
840 ? c
840 ? c
841 $ hg verify
841 $ hg verify -q
842 checking changesets
843 checking manifests
844 crosschecking files in changesets and manifests
845 checking files
846 checked 3 changesets with 4 changes to 3 files
847 $ cat a b
842 $ cat a b
848 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
843 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
849 do not process $Id:
844 do not process $Id:
850 xxx $
845 xxx $
851 $Xinfo: User Name <user@example.com>: firstline $
846 $Xinfo: User Name <user@example.com>: firstline $
852 ignore $Id$
847 ignore $Id$
853 $ hg cat sym a b && echo
848 $ hg cat sym a b && echo
854 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
849 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
855 do not process $Id:
850 do not process $Id:
856 xxx $
851 xxx $
857 $Xinfo: User Name <user@example.com>: firstline $
852 $Xinfo: User Name <user@example.com>: firstline $
858 ignore $Id$
853 ignore $Id$
859 a
854 a
860
855
861 annotate
856 annotate
862
857
863 $ hg annotate a
858 $ hg annotate a
864 1: expand $Id$
859 1: expand $Id$
865 1: do not process $Id:
860 1: do not process $Id:
866 1: xxx $
861 1: xxx $
867 2: $Xinfo$
862 2: $Xinfo$
868
863
869 remove with status checks
864 remove with status checks
870
865
871 $ hg debugrebuildstate
866 $ hg debugrebuildstate
872 $ hg remove a
867 $ hg remove a
873 $ hg --debug commit -m rma
868 $ hg --debug commit -m rma
874 committing files:
869 committing files:
875 committing manifest
870 committing manifest
876 committing changelog
871 committing changelog
877 updating the branch cache
872 updating the branch cache
878 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
873 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
879 $ hg status
874 $ hg status
880 ? c
875 ? c
881
876
882 Rollback, revert, and check expansion
877 Rollback, revert, and check expansion
883
878
884 $ hg rollback
879 $ hg rollback
885 repository tip rolled back to revision 2 (undo commit)
880 repository tip rolled back to revision 2 (undo commit)
886 working directory now based on revision 2
881 working directory now based on revision 2
887 $ hg status
882 $ hg status
888 R a
883 R a
889 ? c
884 ? c
890 $ hg revert --no-backup --rev tip a
885 $ hg revert --no-backup --rev tip a
891 $ cat a
886 $ cat a
892 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
887 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
893 do not process $Id:
888 do not process $Id:
894 xxx $
889 xxx $
895 $Xinfo: User Name <user@example.com>: firstline $
890 $Xinfo: User Name <user@example.com>: firstline $
896
891
897 Clone to test global and local configurations
892 Clone to test global and local configurations
898
893
899 $ cd ..
894 $ cd ..
900
895
901 Expansion in destination with global configuration
896 Expansion in destination with global configuration
902
897
903 $ hg --quiet clone Test globalconf
898 $ hg --quiet clone Test globalconf
904 $ cat globalconf/a
899 $ cat globalconf/a
905 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
900 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
906 do not process $Id:
901 do not process $Id:
907 xxx $
902 xxx $
908 $Xinfo: User Name <user@example.com>: firstline $
903 $Xinfo: User Name <user@example.com>: firstline $
909
904
910 No expansion in destination with local configuration in origin only
905 No expansion in destination with local configuration in origin only
911
906
912 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
907 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
913 $ cat localconf/a
908 $ cat localconf/a
914 expand $Id$
909 expand $Id$
915 do not process $Id:
910 do not process $Id:
916 xxx $
911 xxx $
917 $Xinfo$
912 $Xinfo$
918
913
919 Clone to test incoming
914 Clone to test incoming
920
915
921 $ hg clone -r1 Test Test-a
916 $ hg clone -r1 Test Test-a
922 adding changesets
917 adding changesets
923 adding manifests
918 adding manifests
924 adding file changes
919 adding file changes
925 added 2 changesets with 3 changes to 3 files
920 added 2 changesets with 3 changes to 3 files
926 new changesets a2392c293916:ef63ca68695b
921 new changesets a2392c293916:ef63ca68695b
927 updating to branch default
922 updating to branch default
928 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
923 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
929 $ cd Test-a
924 $ cd Test-a
930 $ cat <<EOF >> .hg/hgrc
925 $ cat <<EOF >> .hg/hgrc
931 > [paths]
926 > [paths]
932 > default = ../Test
927 > default = ../Test
933 > EOF
928 > EOF
934 $ hg incoming
929 $ hg incoming
935 comparing with $TESTTMP/Test
930 comparing with $TESTTMP/Test
936 searching for changes
931 searching for changes
937 changeset: 2:bb948857c743
932 changeset: 2:bb948857c743
938 tag: tip
933 tag: tip
939 user: User Name <user@example.com>
934 user: User Name <user@example.com>
940 date: Thu Jan 01 00:00:02 1970 +0000
935 date: Thu Jan 01 00:00:02 1970 +0000
941 summary: firstline
936 summary: firstline
942
937
943 Imported patch should not be rejected
938 Imported patch should not be rejected
944
939
945 >>> import re
940 >>> import re
946 >>> text = re.sub(br'(Id.*)', br'\1 rejecttest', open('a', 'rb').read())
941 >>> text = re.sub(br'(Id.*)', br'\1 rejecttest', open('a', 'rb').read())
947 >>> open('a', 'wb').write(text) and None
942 >>> open('a', 'wb').write(text) and None
948 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
943 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
949 committing files:
944 committing files:
950 a
945 a
951 committing manifest
946 committing manifest
952 committing changelog
947 committing changelog
953 overwriting a expanding keywords
948 overwriting a expanding keywords
954 updating the branch cache
949 updating the branch cache
955 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
950 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
956 $ hg export -o ../rejecttest.diff tip
951 $ hg export -o ../rejecttest.diff tip
957 $ cd ../Test
952 $ cd ../Test
958 $ hg import ../rejecttest.diff
953 $ hg import ../rejecttest.diff
959 applying ../rejecttest.diff
954 applying ../rejecttest.diff
960 $ cat a b
955 $ cat a b
961 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
956 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
962 do not process $Id: rejecttest
957 do not process $Id: rejecttest
963 xxx $
958 xxx $
964 $Xinfo: User Name <user@example.com>: rejects? $
959 $Xinfo: User Name <user@example.com>: rejects? $
965 ignore $Id$
960 ignore $Id$
966
961
967 $ hg rollback
962 $ hg rollback
968 repository tip rolled back to revision 2 (undo import)
963 repository tip rolled back to revision 2 (undo import)
969 working directory now based on revision 2
964 working directory now based on revision 2
970 $ hg update --clean
965 $ hg update --clean
971 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
966 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
972
967
973 kwexpand/kwshrink on selected files
968 kwexpand/kwshrink on selected files
974
969
975 $ mkdir x
970 $ mkdir x
976 $ hg copy a x/a
971 $ hg copy a x/a
977 $ hg --verbose kwshrink a
972 $ hg --verbose kwshrink a
978 overwriting a shrinking keywords
973 overwriting a shrinking keywords
979 - sleep required for dirstate.normal() check
974 - sleep required for dirstate.normal() check
980 $ sleep 1
975 $ sleep 1
981 $ hg status a
976 $ hg status a
982 $ hg --verbose kwexpand a
977 $ hg --verbose kwexpand a
983 overwriting a expanding keywords
978 overwriting a expanding keywords
984 $ hg status a
979 $ hg status a
985
980
986 kwexpand x/a should abort
981 kwexpand x/a should abort
987
982
988 $ hg --verbose kwexpand x/a
983 $ hg --verbose kwexpand x/a
989 abort: outstanding uncommitted changes
984 abort: outstanding uncommitted changes
990 [255]
985 [255]
991 $ cd x
986 $ cd x
992 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
987 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
993 committing files:
988 committing files:
994 x/a
989 x/a
995 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
990 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
996 committing manifest
991 committing manifest
997 committing changelog
992 committing changelog
998 overwriting x/a expanding keywords
993 overwriting x/a expanding keywords
999 updating the branch cache
994 updating the branch cache
1000 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
995 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
1001 $ cat a
996 $ cat a
1002 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
997 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
1003 do not process $Id:
998 do not process $Id:
1004 xxx $
999 xxx $
1005 $Xinfo: User Name <user@example.com>: xa $
1000 $Xinfo: User Name <user@example.com>: xa $
1006
1001
1007 kwshrink a inside directory x
1002 kwshrink a inside directory x
1008
1003
1009 $ hg --verbose kwshrink a
1004 $ hg --verbose kwshrink a
1010 overwriting x/a shrinking keywords
1005 overwriting x/a shrinking keywords
1011 $ cat a
1006 $ cat a
1012 expand $Id$
1007 expand $Id$
1013 do not process $Id:
1008 do not process $Id:
1014 xxx $
1009 xxx $
1015 $Xinfo$
1010 $Xinfo$
1016 $ cd ..
1011 $ cd ..
1017
1012
1018 kwexpand nonexistent
1013 kwexpand nonexistent
1019
1014
1020 $ hg kwexpand nonexistent
1015 $ hg kwexpand nonexistent
1021 nonexistent:* (glob)
1016 nonexistent:* (glob)
1022
1017
1023
1018
1024 #if serve
1019 #if serve
1025 hg serve
1020 hg serve
1026 - expand with hgweb file
1021 - expand with hgweb file
1027 - no expansion with hgweb annotate/changeset/filediff/comparison
1022 - no expansion with hgweb annotate/changeset/filediff/comparison
1028 - expand with hgweb file, again
1023 - expand with hgweb file, again
1029 - check errors
1024 - check errors
1030
1025
1031 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1026 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1032 $ cat hg.pid >> $DAEMON_PIDS
1027 $ cat hg.pid >> $DAEMON_PIDS
1033 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1028 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1034 200 Script output follows
1029 200 Script output follows
1035
1030
1036 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1031 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1037 do not process $Id:
1032 do not process $Id:
1038 xxx $
1033 xxx $
1039 $Xinfo: User Name <user@example.com>: firstline $
1034 $Xinfo: User Name <user@example.com>: firstline $
1040 $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw'
1035 $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw'
1041 200 Script output follows
1036 200 Script output follows
1042
1037
1043
1038
1044 user@1: expand $Id$
1039 user@1: expand $Id$
1045 user@1: do not process $Id:
1040 user@1: do not process $Id:
1046 user@1: xxx $
1041 user@1: xxx $
1047 user@2: $Xinfo$
1042 user@2: $Xinfo$
1048
1043
1049
1044
1050
1045
1051
1046
1052 $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw'
1047 $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw'
1053 200 Script output follows
1048 200 Script output follows
1054
1049
1055
1050
1056 # HG changeset patch
1051 # HG changeset patch
1057 # User User Name <user@example.com>
1052 # User User Name <user@example.com>
1058 # Date 3 0
1053 # Date 3 0
1059 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
1054 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
1060 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
1055 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
1061 xa
1056 xa
1062
1057
1063 diff -r bb948857c743 -r b4560182a3f9 x/a
1058 diff -r bb948857c743 -r b4560182a3f9 x/a
1064 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1059 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1065 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
1060 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
1066 @@ -0,0 +1,4 @@
1061 @@ -0,0 +1,4 @@
1067 +expand $Id$
1062 +expand $Id$
1068 +do not process $Id:
1063 +do not process $Id:
1069 +xxx $
1064 +xxx $
1070 +$Xinfo$
1065 +$Xinfo$
1071
1066
1072 $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
1067 $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
1073 200 Script output follows
1068 200 Script output follows
1074
1069
1075
1070
1076 diff -r ef63ca68695b -r bb948857c743 a
1071 diff -r ef63ca68695b -r bb948857c743 a
1077 --- a/a Thu Jan 01 00:00:00 1970 +0000
1072 --- a/a Thu Jan 01 00:00:00 1970 +0000
1078 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1073 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1079 @@ -1,3 +1,4 @@
1074 @@ -1,3 +1,4 @@
1080 expand $Id$
1075 expand $Id$
1081 do not process $Id:
1076 do not process $Id:
1082 xxx $
1077 xxx $
1083 +$Xinfo$
1078 +$Xinfo$
1084
1079
1085
1080
1086
1081
1087
1082
1088 $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]'
1083 $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]'
1089 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1084 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1090 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1085 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1091 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1086 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1092 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1087 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1093 <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td>
1088 <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td>
1094
1089
1095 (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords
1090 (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords
1096 at subsequent webcommands)
1091 at subsequent webcommands)
1097
1092
1098 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1093 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1099 200 Script output follows
1094 200 Script output follows
1100
1095
1101 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1096 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1102 do not process $Id:
1097 do not process $Id:
1103 xxx $
1098 xxx $
1104 $Xinfo: User Name <user@example.com>: firstline $
1099 $Xinfo: User Name <user@example.com>: firstline $
1105
1100
1106 $ killdaemons.py
1101 $ killdaemons.py
1107 $ cat errors.log
1102 $ cat errors.log
1108 #endif
1103 #endif
1109
1104
1110 Prepare merge and resolve tests
1105 Prepare merge and resolve tests
1111
1106
1112 $ echo '$Id$' > m
1107 $ echo '$Id$' > m
1113 $ hg add m
1108 $ hg add m
1114 $ hg commit -m 4kw
1109 $ hg commit -m 4kw
1115 $ echo foo >> m
1110 $ echo foo >> m
1116 $ hg commit -m 5foo
1111 $ hg commit -m 5foo
1117
1112
1118 simplemerge
1113 simplemerge
1119
1114
1120 $ hg update 4
1115 $ hg update 4
1121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1122 $ echo foo >> m
1117 $ echo foo >> m
1123 $ hg commit -m 6foo
1118 $ hg commit -m 6foo
1124 created new head
1119 created new head
1125 $ hg merge
1120 $ hg merge
1126 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1121 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1127 (branch merge, don't forget to commit)
1122 (branch merge, don't forget to commit)
1128 $ hg commit -m simplemerge
1123 $ hg commit -m simplemerge
1129 $ cat m
1124 $ cat m
1130 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1125 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1131 foo
1126 foo
1132
1127
1133 conflict: keyword should stay outside conflict zone
1128 conflict: keyword should stay outside conflict zone
1134
1129
1135 $ hg update 4
1130 $ hg update 4
1136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1137 $ echo bar >> m
1132 $ echo bar >> m
1138 $ hg commit -m 8bar
1133 $ hg commit -m 8bar
1139 created new head
1134 created new head
1140 $ hg merge
1135 $ hg merge
1141 merging m
1136 merging m
1142 warning: conflicts while merging m! (edit, then use 'hg resolve --mark')
1137 warning: conflicts while merging m! (edit, then use 'hg resolve --mark')
1143 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1138 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1144 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1139 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1145 [1]
1140 [1]
1146 $ cat m
1141 $ cat m
1147 $Id$
1142 $Id$
1148 <<<<<<< working copy: 88a80c8d172e - test: 8bar
1143 <<<<<<< working copy: 88a80c8d172e - test: 8bar
1149 bar
1144 bar
1150 =======
1145 =======
1151 foo
1146 foo
1152 >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge
1147 >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge
1153
1148
1154 resolve to local, m must contain hash of last change (local parent)
1149 resolve to local, m must contain hash of last change (local parent)
1155
1150
1156 $ hg resolve -t internal:local -a
1151 $ hg resolve -t internal:local -a
1157 (no more unresolved files)
1152 (no more unresolved files)
1158 $ hg commit -m localresolve
1153 $ hg commit -m localresolve
1159 $ cat m
1154 $ cat m
1160 $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $
1155 $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $
1161 bar
1156 bar
1162
1157
1163 Test restricted mode with transplant -b
1158 Test restricted mode with transplant -b
1164
1159
1165 $ hg update 6
1160 $ hg update 6
1166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1167 $ hg branch foo
1162 $ hg branch foo
1168 marked working directory as branch foo
1163 marked working directory as branch foo
1169 (branches are permanent and global, did you want a bookmark?)
1164 (branches are permanent and global, did you want a bookmark?)
1170 $ mv a a.bak
1165 $ mv a a.bak
1171 $ echo foobranch > a
1166 $ echo foobranch > a
1172 $ cat a.bak >> a
1167 $ cat a.bak >> a
1173 $ rm a.bak
1168 $ rm a.bak
1174 $ hg commit -m 9foobranch
1169 $ hg commit -m 9foobranch
1175 $ hg update default
1170 $ hg update default
1176 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1171 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1177 $ hg -y transplant -b foo tip
1172 $ hg -y transplant -b foo tip
1178 applying 4aa30d025d50
1173 applying 4aa30d025d50
1179 4aa30d025d50 transplanted to e00abbf63521
1174 4aa30d025d50 transplanted to e00abbf63521
1180
1175
1181 Expansion in changeset but not in file
1176 Expansion in changeset but not in file
1182
1177
1183 $ hg tip -p
1178 $ hg tip -p
1184 changeset: 11:e00abbf63521
1179 changeset: 11:e00abbf63521
1185 tag: tip
1180 tag: tip
1186 parent: 9:800511b3a22d
1181 parent: 9:800511b3a22d
1187 user: test
1182 user: test
1188 date: Thu Jan 01 00:00:00 1970 +0000
1183 date: Thu Jan 01 00:00:00 1970 +0000
1189 summary: 9foobranch
1184 summary: 9foobranch
1190
1185
1191 diff -r 800511b3a22d -r e00abbf63521 a
1186 diff -r 800511b3a22d -r e00abbf63521 a
1192 --- a/a Thu Jan 01 00:00:00 1970 +0000
1187 --- a/a Thu Jan 01 00:00:00 1970 +0000
1193 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1188 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1194 @@ -1,3 +1,4 @@
1189 @@ -1,3 +1,4 @@
1195 +foobranch
1190 +foobranch
1196 expand $Id$
1191 expand $Id$
1197 do not process $Id:
1192 do not process $Id:
1198 xxx $
1193 xxx $
1199
1194
1200 $ head -n 2 a
1195 $ head -n 2 a
1201 foobranch
1196 foobranch
1202 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1197 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1203
1198
1204 Turn off expansion
1199 Turn off expansion
1205
1200
1206 $ hg -q rollback
1201 $ hg -q rollback
1207 $ hg -q update -C
1202 $ hg -q update -C
1208
1203
1209 kwshrink with unknown file u
1204 kwshrink with unknown file u
1210
1205
1211 $ cp a u
1206 $ cp a u
1212 $ hg --verbose kwshrink
1207 $ hg --verbose kwshrink
1213 overwriting a shrinking keywords
1208 overwriting a shrinking keywords
1214 overwriting m shrinking keywords
1209 overwriting m shrinking keywords
1215 overwriting x/a shrinking keywords
1210 overwriting x/a shrinking keywords
1216
1211
1217 Keywords shrunk in working directory, but not yet disabled
1212 Keywords shrunk in working directory, but not yet disabled
1218 - cat shows unexpanded keywords
1213 - cat shows unexpanded keywords
1219 - hg cat shows expanded keywords
1214 - hg cat shows expanded keywords
1220
1215
1221 $ cat a b
1216 $ cat a b
1222 expand $Id$
1217 expand $Id$
1223 do not process $Id:
1218 do not process $Id:
1224 xxx $
1219 xxx $
1225 $Xinfo$
1220 $Xinfo$
1226 ignore $Id$
1221 ignore $Id$
1227 $ hg cat sym a b && echo
1222 $ hg cat sym a b && echo
1228 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1223 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1229 do not process $Id:
1224 do not process $Id:
1230 xxx $
1225 xxx $
1231 $Xinfo: User Name <user@example.com>: firstline $
1226 $Xinfo: User Name <user@example.com>: firstline $
1232 ignore $Id$
1227 ignore $Id$
1233 a
1228 a
1234
1229
1235 Now disable keyword expansion
1230 Now disable keyword expansion
1236
1231
1237 $ cp $HGRCPATH $HGRCPATH.backup
1232 $ cp $HGRCPATH $HGRCPATH.backup
1238 $ rm "$HGRCPATH"
1233 $ rm "$HGRCPATH"
1239 $ cat a b
1234 $ cat a b
1240 expand $Id$
1235 expand $Id$
1241 do not process $Id:
1236 do not process $Id:
1242 xxx $
1237 xxx $
1243 $Xinfo$
1238 $Xinfo$
1244 ignore $Id$
1239 ignore $Id$
1245 $ hg cat sym a b && echo
1240 $ hg cat sym a b && echo
1246 expand $Id$
1241 expand $Id$
1247 do not process $Id:
1242 do not process $Id:
1248 xxx $
1243 xxx $
1249 $Xinfo$
1244 $Xinfo$
1250 ignore $Id$
1245 ignore $Id$
1251 a
1246 a
1252
1247
1253 enable keyword expansion again
1248 enable keyword expansion again
1254
1249
1255 $ cat $HGRCPATH.backup >> $HGRCPATH
1250 $ cat $HGRCPATH.backup >> $HGRCPATH
1256
1251
1257 Test restricted mode with unshelve
1252 Test restricted mode with unshelve
1258
1253
1259 $ echo xxxx >> a
1254 $ echo xxxx >> a
1260 $ hg diff
1255 $ hg diff
1261 diff -r 800511b3a22d a
1256 diff -r 800511b3a22d a
1262 --- a/a Thu Jan 01 00:00:00 1970 +0000
1257 --- a/a Thu Jan 01 00:00:00 1970 +0000
1263 +++ b/a * (glob)
1258 +++ b/a * (glob)
1264 @@ -2,3 +2,4 @@
1259 @@ -2,3 +2,4 @@
1265 do not process $Id:
1260 do not process $Id:
1266 xxx $
1261 xxx $
1267 $Xinfo$
1262 $Xinfo$
1268 +xxxx
1263 +xxxx
1269 $ hg shelve -q --name tmp
1264 $ hg shelve -q --name tmp
1270 $ hg shelve --list --patch
1265 $ hg shelve --list --patch
1271 tmp (*)* changes to: localresolve (glob)
1266 tmp (*)* changes to: localresolve (glob)
1272
1267
1273 diff --git a/a b/a
1268 diff --git a/a b/a
1274 --- a/a
1269 --- a/a
1275 +++ b/a
1270 +++ b/a
1276 @@ -2,3 +2,4 @@
1271 @@ -2,3 +2,4 @@
1277 do not process $Id:
1272 do not process $Id:
1278 xxx $
1273 xxx $
1279 $Xinfo$
1274 $Xinfo$
1280 +xxxx
1275 +xxxx
1281
1276
1282 $ hg update -q -C 10
1277 $ hg update -q -C 10
1283 $ hg unshelve -q tmp
1278 $ hg unshelve -q tmp
1284 $ hg diff
1279 $ hg diff
1285 diff -r 4aa30d025d50 a
1280 diff -r 4aa30d025d50 a
1286 --- a/a Thu Jan 01 00:00:00 1970 +0000
1281 --- a/a Thu Jan 01 00:00:00 1970 +0000
1287 +++ b/a * (glob)
1282 +++ b/a * (glob)
1288 @@ -3,3 +3,4 @@
1283 @@ -3,3 +3,4 @@
1289 do not process $Id:
1284 do not process $Id:
1290 xxx $
1285 xxx $
1291 $Xinfo$
1286 $Xinfo$
1292 +xxxx
1287 +xxxx
1293
1288
1294 Test restricted mode with rebase
1289 Test restricted mode with rebase
1295
1290
1296 $ cat <<EOF >> $HGRCPATH
1291 $ cat <<EOF >> $HGRCPATH
1297 > [extensions]
1292 > [extensions]
1298 > rebase =
1293 > rebase =
1299 > EOF
1294 > EOF
1300
1295
1301 $ hg update -q -C 9
1296 $ hg update -q -C 9
1302
1297
1303 $ echo xxxx >> a
1298 $ echo xxxx >> a
1304 $ hg commit -m '#11'
1299 $ hg commit -m '#11'
1305 $ hg diff -c 11
1300 $ hg diff -c 11
1306 diff -r 800511b3a22d -r b07670694489 a
1301 diff -r 800511b3a22d -r b07670694489 a
1307 --- a/a Thu Jan 01 00:00:00 1970 +0000
1302 --- a/a Thu Jan 01 00:00:00 1970 +0000
1308 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1303 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1309 @@ -2,3 +2,4 @@
1304 @@ -2,3 +2,4 @@
1310 do not process $Id:
1305 do not process $Id:
1311 xxx $
1306 xxx $
1312 $Xinfo$
1307 $Xinfo$
1313 +xxxx
1308 +xxxx
1314
1309
1315 $ hg diff -c 10
1310 $ hg diff -c 10
1316 diff -r 27d48ee14f67 -r 4aa30d025d50 a
1311 diff -r 27d48ee14f67 -r 4aa30d025d50 a
1317 --- a/a Thu Jan 01 00:00:00 1970 +0000
1312 --- a/a Thu Jan 01 00:00:00 1970 +0000
1318 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1313 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1319 @@ -1,3 +1,4 @@
1314 @@ -1,3 +1,4 @@
1320 +foobranch
1315 +foobranch
1321 expand $Id$
1316 expand $Id$
1322 do not process $Id:
1317 do not process $Id:
1323 xxx $
1318 xxx $
1324
1319
1325 $ hg rebase -q -s 10 -d 11 --keep
1320 $ hg rebase -q -s 10 -d 11 --keep
1326 $ hg diff -r 9 -r 12 a
1321 $ hg diff -r 9 -r 12 a
1327 diff -r 800511b3a22d -r 1939b927726c a
1322 diff -r 800511b3a22d -r 1939b927726c a
1328 --- a/a Thu Jan 01 00:00:00 1970 +0000
1323 --- a/a Thu Jan 01 00:00:00 1970 +0000
1329 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1324 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1330 @@ -1,4 +1,6 @@
1325 @@ -1,4 +1,6 @@
1331 +foobranch
1326 +foobranch
1332 expand $Id$
1327 expand $Id$
1333 do not process $Id:
1328 do not process $Id:
1334 xxx $
1329 xxx $
1335 $Xinfo$
1330 $Xinfo$
1336 +xxxx
1331 +xxxx
1337
1332
1338 Test restricted mode with graft
1333 Test restricted mode with graft
1339
1334
1340 $ hg graft -q 10
1335 $ hg graft -q 10
1341 $ hg diff -r 9 -r 13 a
1336 $ hg diff -r 9 -r 13 a
1342 diff -r 800511b3a22d -r 01a68de1003a a
1337 diff -r 800511b3a22d -r 01a68de1003a a
1343 --- a/a Thu Jan 01 00:00:00 1970 +0000
1338 --- a/a Thu Jan 01 00:00:00 1970 +0000
1344 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1339 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1345 @@ -1,4 +1,6 @@
1340 @@ -1,4 +1,6 @@
1346 +foobranch
1341 +foobranch
1347 expand $Id$
1342 expand $Id$
1348 do not process $Id:
1343 do not process $Id:
1349 xxx $
1344 xxx $
1350 $Xinfo$
1345 $Xinfo$
1351 +xxxx
1346 +xxxx
1352
1347
1353 Test restricted mode with backout
1348 Test restricted mode with backout
1354
1349
1355 $ hg backout -q 11 --no-commit
1350 $ hg backout -q 11 --no-commit
1356 $ hg diff a
1351 $ hg diff a
1357 diff -r 01a68de1003a a
1352 diff -r 01a68de1003a a
1358 --- a/a Thu Jan 01 00:00:00 1970 +0000
1353 --- a/a Thu Jan 01 00:00:00 1970 +0000
1359 +++ b/a * (glob)
1354 +++ b/a * (glob)
1360 @@ -3,4 +3,3 @@
1355 @@ -3,4 +3,3 @@
1361 do not process $Id:
1356 do not process $Id:
1362 xxx $
1357 xxx $
1363 $Xinfo$
1358 $Xinfo$
1364 -xxxx
1359 -xxxx
1365
1360
1366 Test restricted mode with histedit
1361 Test restricted mode with histedit
1367
1362
1368 $ cat <<EOF >> $HGRCPATH
1363 $ cat <<EOF >> $HGRCPATH
1369 > [extensions]
1364 > [extensions]
1370 > histedit =
1365 > histedit =
1371 > EOF
1366 > EOF
1372
1367
1373 $ hg commit -m 'backout #11'
1368 $ hg commit -m 'backout #11'
1374 $ hg histedit -q --command - 13 <<EOF
1369 $ hg histedit -q --command - 13 <<EOF
1375 > pick 49f5f2d940c3 14 backout #11
1370 > pick 49f5f2d940c3 14 backout #11
1376 > pick 01a68de1003a 13 9foobranch
1371 > pick 01a68de1003a 13 9foobranch
1377 > EOF
1372 > EOF
1378
1373
1379 Test restricted mode with fetch (with merge)
1374 Test restricted mode with fetch (with merge)
1380
1375
1381 $ cat <<EOF >> $HGRCPATH
1376 $ cat <<EOF >> $HGRCPATH
1382 > [extensions]
1377 > [extensions]
1383 > fetch =
1378 > fetch =
1384 > EOF
1379 > EOF
1385
1380
1386 $ hg clone -q -r 9 . ../fetch-merge
1381 $ hg clone -q -r 9 . ../fetch-merge
1387 $ cd ../fetch-merge
1382 $ cd ../fetch-merge
1388 $ hg -R ../Test export 10 | hg import -q -
1383 $ hg -R ../Test export 10 | hg import -q -
1389 $ hg fetch -q -r 11
1384 $ hg fetch -q -r 11
1390 $ hg diff -r 9 a
1385 $ hg diff -r 9 a
1391 diff -r 800511b3a22d a
1386 diff -r 800511b3a22d a
1392 --- a/a Thu Jan 01 00:00:00 1970 +0000
1387 --- a/a Thu Jan 01 00:00:00 1970 +0000
1393 +++ b/a * (glob)
1388 +++ b/a * (glob)
1394 @@ -1,4 +1,6 @@
1389 @@ -1,4 +1,6 @@
1395 +foobranch
1390 +foobranch
1396 expand $Id$
1391 expand $Id$
1397 do not process $Id:
1392 do not process $Id:
1398 xxx $
1393 xxx $
1399 $Xinfo$
1394 $Xinfo$
1400 +xxxx
1395 +xxxx
1401
1396
1402 Test that patch.diff(), which is implied by "hg diff" or so, doesn't
1397 Test that patch.diff(), which is implied by "hg diff" or so, doesn't
1403 suppress expanding keywords at subsequent commands
1398 suppress expanding keywords at subsequent commands
1404
1399
1405 #if windows
1400 #if windows
1406 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
1401 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
1407 #else
1402 #else
1408 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
1403 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
1409 #endif
1404 #endif
1410 $ export PYTHONPATH
1405 $ export PYTHONPATH
1411
1406
1412 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1407 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1413 $ mv $HGRCPATH.new $HGRCPATH
1408 $ mv $HGRCPATH.new $HGRCPATH
1414
1409
1415 >>> from hgclient import check, readchannel, runcommand
1410 >>> from hgclient import check, readchannel, runcommand
1416 >>> @check
1411 >>> @check
1417 ... def check(server):
1412 ... def check(server):
1418 ... # hello block
1413 ... # hello block
1419 ... readchannel(server)
1414 ... readchannel(server)
1420 ...
1415 ...
1421 ... runcommand(server, [b'cat', b'm'])
1416 ... runcommand(server, [b'cat', b'm'])
1422 ... runcommand(server, [b'diff', b'-c', b'.', b'm'])
1417 ... runcommand(server, [b'diff', b'-c', b'.', b'm'])
1423 ... runcommand(server, [b'cat', b'm'])
1418 ... runcommand(server, [b'cat', b'm'])
1424 *** runcommand cat m
1419 *** runcommand cat m
1425 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1420 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1426 bar
1421 bar
1427 *** runcommand diff -c . m
1422 *** runcommand diff -c . m
1428 *** runcommand cat m
1423 *** runcommand cat m
1429 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1424 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1430 bar
1425 bar
1431
1426
1432 $ cd ..
1427 $ cd ..
1433
1428
1434 #if serve
1429 #if serve
1435
1430
1436 Test that keywords are expanded only in repositories, which enable
1431 Test that keywords are expanded only in repositories, which enable
1437 keyword extension, even if multiple repositories are served in a
1432 keyword extension, even if multiple repositories are served in a
1438 process
1433 process
1439
1434
1440 $ cat >> fetch-merge/.hg/hgrc <<EOF
1435 $ cat >> fetch-merge/.hg/hgrc <<EOF
1441 > [extensions]
1436 > [extensions]
1442 > keyword = !
1437 > keyword = !
1443 > EOF
1438 > EOF
1444
1439
1445 $ cat > paths.conf <<EOF
1440 $ cat > paths.conf <<EOF
1446 > [paths]
1441 > [paths]
1447 > enabled=Test
1442 > enabled=Test
1448 > disabled=fetch-merge
1443 > disabled=fetch-merge
1449 > EOF
1444 > EOF
1450
1445
1451 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf
1446 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf
1452 $ cat hg.pid >> $DAEMON_PIDS
1447 $ cat hg.pid >> $DAEMON_PIDS
1453
1448
1454 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1449 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1455 200 Script output follows
1450 200 Script output follows
1456
1451
1457 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1452 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1458 bar
1453 bar
1459
1454
1460 $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw'
1455 $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw'
1461 200 Script output follows
1456 200 Script output follows
1462
1457
1463 $Id$
1458 $Id$
1464 bar
1459 bar
1465
1460
1466 (check expansion again, for safety)
1461 (check expansion again, for safety)
1467
1462
1468 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1463 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1469 200 Script output follows
1464 200 Script output follows
1470
1465
1471 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1466 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1472 bar
1467 bar
1473
1468
1474 $ killdaemons.py
1469 $ killdaemons.py
1475 #endif
1470 #endif
@@ -1,442 +1,414
1 This file contains testcases that tend to be related to the wire protocol part
1 This file contains testcases that tend to be related to the wire protocol part
2 of largefiles.
2 of largefiles.
3
3
4 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
4 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
5 $ mkdir "${USERCACHE}"
5 $ mkdir "${USERCACHE}"
6 $ cat >> $HGRCPATH <<EOF
6 $ cat >> $HGRCPATH <<EOF
7 > [extensions]
7 > [extensions]
8 > largefiles=
8 > largefiles=
9 > purge=
9 > purge=
10 > rebase=
10 > rebase=
11 > transplant=
11 > transplant=
12 > [phases]
12 > [phases]
13 > publish=False
13 > publish=False
14 > [largefiles]
14 > [largefiles]
15 > minsize=2
15 > minsize=2
16 > patterns=glob:**.dat
16 > patterns=glob:**.dat
17 > usercache=${USERCACHE}
17 > usercache=${USERCACHE}
18 > [web]
18 > [web]
19 > allow-archive = zip
19 > allow-archive = zip
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24
24
25 #if serve
25 #if serve
26 vanilla clients not locked out from largefiles servers on vanilla repos
26 vanilla clients not locked out from largefiles servers on vanilla repos
27 $ mkdir r1
27 $ mkdir r1
28 $ cd r1
28 $ cd r1
29 $ hg init
29 $ hg init
30 $ echo c1 > f1
30 $ echo c1 > f1
31 $ hg add f1
31 $ hg add f1
32 $ hg commit -m "m1"
32 $ hg commit -m "m1"
33 Invoking status precommit hook
33 Invoking status precommit hook
34 A f1
34 A f1
35 $ cd ..
35 $ cd ..
36 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
36 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
37 $ cat hg.pid >> $DAEMON_PIDS
37 $ cat hg.pid >> $DAEMON_PIDS
38 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
38 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
39 requesting all changes
39 requesting all changes
40 adding changesets
40 adding changesets
41 adding manifests
41 adding manifests
42 adding file changes
42 adding file changes
43 added 1 changesets with 1 changes to 1 files
43 added 1 changesets with 1 changes to 1 files
44 new changesets b6eb3a2e2efe (1 drafts)
44 new changesets b6eb3a2e2efe (1 drafts)
45 updating to branch default
45 updating to branch default
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47
47
48 largefiles clients still work with vanilla servers
48 largefiles clients still work with vanilla servers
49 $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid
49 $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid
50 $ cat hg.pid >> $DAEMON_PIDS
50 $ cat hg.pid >> $DAEMON_PIDS
51 $ hg clone http://localhost:$HGPORT1 r3
51 $ hg clone http://localhost:$HGPORT1 r3
52 requesting all changes
52 requesting all changes
53 adding changesets
53 adding changesets
54 adding manifests
54 adding manifests
55 adding file changes
55 adding file changes
56 added 1 changesets with 1 changes to 1 files
56 added 1 changesets with 1 changes to 1 files
57 new changesets b6eb3a2e2efe (1 drafts)
57 new changesets b6eb3a2e2efe (1 drafts)
58 updating to branch default
58 updating to branch default
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
60 #endif
60 #endif
61
61
62 vanilla clients locked out from largefiles http repos
62 vanilla clients locked out from largefiles http repos
63 $ mkdir r4
63 $ mkdir r4
64 $ cd r4
64 $ cd r4
65 $ hg init
65 $ hg init
66 $ echo c1 > f1
66 $ echo c1 > f1
67 $ hg add --large f1
67 $ hg add --large f1
68 $ hg commit -m "m1"
68 $ hg commit -m "m1"
69 Invoking status precommit hook
69 Invoking status precommit hook
70 A f1
70 A f1
71 $ cd ..
71 $ cd ..
72
72
73 largefiles can be pushed locally (issue3583)
73 largefiles can be pushed locally (issue3583)
74 $ hg init dest
74 $ hg init dest
75 $ cd r4
75 $ cd r4
76 $ hg outgoing ../dest
76 $ hg outgoing ../dest
77 comparing with ../dest
77 comparing with ../dest
78 searching for changes
78 searching for changes
79 changeset: 0:639881c12b4c
79 changeset: 0:639881c12b4c
80 tag: tip
80 tag: tip
81 user: test
81 user: test
82 date: Thu Jan 01 00:00:00 1970 +0000
82 date: Thu Jan 01 00:00:00 1970 +0000
83 summary: m1
83 summary: m1
84
84
85 $ hg push ../dest
85 $ hg push ../dest
86 pushing to ../dest
86 pushing to ../dest
87 searching for changes
87 searching for changes
88 adding changesets
88 adding changesets
89 adding manifests
89 adding manifests
90 adding file changes
90 adding file changes
91 added 1 changesets with 1 changes to 1 files
91 added 1 changesets with 1 changes to 1 files
92
92
93 exit code with nothing outgoing (issue3611)
93 exit code with nothing outgoing (issue3611)
94 $ hg outgoing ../dest
94 $ hg outgoing ../dest
95 comparing with ../dest
95 comparing with ../dest
96 searching for changes
96 searching for changes
97 no changes found
97 no changes found
98 [1]
98 [1]
99 $ cd ..
99 $ cd ..
100
100
101 #if serve
101 #if serve
102 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
102 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
103 $ cat hg.pid >> $DAEMON_PIDS
103 $ cat hg.pid >> $DAEMON_PIDS
104 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
104 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
105 abort: remote error:
105 abort: remote error:
106
106
107 This repository uses the largefiles extension.
107 This repository uses the largefiles extension.
108
108
109 Please enable it in your Mercurial config file.
109 Please enable it in your Mercurial config file.
110 [100]
110 [100]
111
111
112 used all HGPORTs, kill all daemons
112 used all HGPORTs, kill all daemons
113 $ killdaemons.py
113 $ killdaemons.py
114 #endif
114 #endif
115
115
116 vanilla clients locked out from largefiles ssh repos
116 vanilla clients locked out from largefiles ssh repos
117 $ hg --config extensions.largefiles=! clone ssh://user@dummy/r4 r5
117 $ hg --config extensions.largefiles=! clone ssh://user@dummy/r4 r5
118 remote:
118 remote:
119 remote: This repository uses the largefiles extension.
119 remote: This repository uses the largefiles extension.
120 remote:
120 remote:
121 remote: Please enable it in your Mercurial config file.
121 remote: Please enable it in your Mercurial config file.
122 remote:
122 remote:
123 remote: -
123 remote: -
124 abort: remote error
124 abort: remote error
125 (check previous remote output)
125 (check previous remote output)
126 [100]
126 [100]
127
127
128 #if serve
128 #if serve
129
129
130 largefiles clients refuse to push largefiles repos to vanilla servers
130 largefiles clients refuse to push largefiles repos to vanilla servers
131 $ mkdir r6
131 $ mkdir r6
132 $ cd r6
132 $ cd r6
133 $ hg init
133 $ hg init
134 $ echo c1 > f1
134 $ echo c1 > f1
135 $ hg add f1
135 $ hg add f1
136 $ hg commit -m "m1"
136 $ hg commit -m "m1"
137 Invoking status precommit hook
137 Invoking status precommit hook
138 A f1
138 A f1
139 $ cat >> .hg/hgrc <<!
139 $ cat >> .hg/hgrc <<!
140 > [web]
140 > [web]
141 > push_ssl = false
141 > push_ssl = false
142 > allow_push = *
142 > allow_push = *
143 > !
143 > !
144 $ cd ..
144 $ cd ..
145 $ hg clone r6 r7
145 $ hg clone r6 r7
146 updating to branch default
146 updating to branch default
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 $ cd r7
148 $ cd r7
149 $ echo c2 > f2
149 $ echo c2 > f2
150 $ hg add --large f2
150 $ hg add --large f2
151 $ hg commit -m "m2"
151 $ hg commit -m "m2"
152 Invoking status precommit hook
152 Invoking status precommit hook
153 A f2
153 A f2
154 $ hg verify --large
154 $ hg verify --large -q
155 checking changesets
156 checking manifests
157 crosschecking files in changesets and manifests
158 checking files
159 checked 2 changesets with 2 changes to 2 files
160 searching 1 changesets for largefiles
161 verified existence of 1 revisions of 1 largefiles
162 $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid
155 $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid
163 $ cat ../hg.pid >> $DAEMON_PIDS
156 $ cat ../hg.pid >> $DAEMON_PIDS
164 $ hg push http://localhost:$HGPORT
157 $ hg push http://localhost:$HGPORT
165 pushing to http://localhost:$HGPORT/
158 pushing to http://localhost:$HGPORT/
166 searching for changes
159 searching for changes
167 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
160 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
168 [255]
161 [255]
169 $ cd ..
162 $ cd ..
170
163
171 putlfile errors are shown (issue3123)
164 putlfile errors are shown (issue3123)
172 Corrupt the cached largefile in r7 and move it out of the servers usercache
165 Corrupt the cached largefile in r7 and move it out of the servers usercache
173 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
166 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
174 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
167 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
175 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
168 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
176 $ hg init empty
169 $ hg init empty
177 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
170 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
178 > --config 'web.allow_push=*' --config web.push_ssl=False
171 > --config 'web.allow_push=*' --config web.push_ssl=False
179 $ cat hg.pid >> $DAEMON_PIDS
172 $ cat hg.pid >> $DAEMON_PIDS
180 $ hg push -R r7 http://localhost:$HGPORT1
173 $ hg push -R r7 http://localhost:$HGPORT1
181 pushing to http://localhost:$HGPORT1/
174 pushing to http://localhost:$HGPORT1/
182 searching for changes
175 searching for changes
183 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
176 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
184 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/
177 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/
185 [255]
178 [255]
186 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
179 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
187 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
180 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
188 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
181 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
189 $ hg push -R r7 http://localhost:$HGPORT1
182 $ hg push -R r7 http://localhost:$HGPORT1
190 pushing to http://localhost:$HGPORT1/
183 pushing to http://localhost:$HGPORT1/
191 searching for changes
184 searching for changes
192 remote: adding changesets
185 remote: adding changesets
193 remote: adding manifests
186 remote: adding manifests
194 remote: adding file changes
187 remote: adding file changes
195 remote: added 2 changesets with 2 changes to 2 files
188 remote: added 2 changesets with 2 changes to 2 files
196 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
189 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
197 server side corruption
190 server side corruption
198 $ rm -rf empty
191 $ rm -rf empty
199
192
200 Push a largefiles repository to a served empty repository
193 Push a largefiles repository to a served empty repository
201 $ hg init r8
194 $ hg init r8
202 $ echo c3 > r8/f1
195 $ echo c3 > r8/f1
203 $ hg add --large r8/f1 -R r8
196 $ hg add --large r8/f1 -R r8
204 $ hg commit -m "m1" -R r8
197 $ hg commit -m "m1" -R r8
205 Invoking status precommit hook
198 Invoking status precommit hook
206 A f1
199 A f1
207 $ hg init empty
200 $ hg init empty
208 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
201 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
209 > --config 'web.allow_push=*' --config web.push_ssl=False
202 > --config 'web.allow_push=*' --config web.push_ssl=False
210 $ cat hg.pid >> $DAEMON_PIDS
203 $ cat hg.pid >> $DAEMON_PIDS
211 $ rm "${USERCACHE}"/*
204 $ rm "${USERCACHE}"/*
212 $ hg push -R r8 http://localhost:$HGPORT2/#default
205 $ hg push -R r8 http://localhost:$HGPORT2/#default
213 pushing to http://localhost:$HGPORT2/
206 pushing to http://localhost:$HGPORT2/
214 searching for changes
207 searching for changes
215 remote: adding changesets
208 remote: adding changesets
216 remote: adding manifests
209 remote: adding manifests
217 remote: adding file changes
210 remote: adding file changes
218 remote: added 1 changesets with 1 changes to 1 files
211 remote: added 1 changesets with 1 changes to 1 files
219 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
212 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
220 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
213 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
221
214
222 Clone over http, no largefiles pulled on clone.
215 Clone over http, no largefiles pulled on clone.
223
216
224 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
217 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
225 adding changesets
218 adding changesets
226 adding manifests
219 adding manifests
227 adding file changes
220 adding file changes
228 added 1 changesets with 1 changes to 1 files
221 added 1 changesets with 1 changes to 1 files
229 new changesets cf03e5bb9936 (1 drafts)
222 new changesets cf03e5bb9936 (1 drafts)
230
223
231 Archive contains largefiles
224 Archive contains largefiles
232 >>> import os
225 >>> import os
233 >>> from mercurial import urllibcompat
226 >>> from mercurial import urllibcompat
234 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
227 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
235 >>> with open('archive.zip', 'wb') as f:
228 >>> with open('archive.zip', 'wb') as f:
236 ... f.write(urllibcompat.urlreq.urlopen(u).read()) and None
229 ... f.write(urllibcompat.urlreq.urlopen(u).read()) and None
237 $ unzip -t archive.zip
230 $ unzip -t archive.zip
238 Archive: archive.zip
231 Archive: archive.zip
239 testing: empty-default/.hg_archival.txt*OK (glob)
232 testing: empty-default/.hg_archival.txt*OK (glob)
240 testing: empty-default/f1*OK (glob)
233 testing: empty-default/f1*OK (glob)
241 No errors detected in compressed data of archive.zip.
234 No errors detected in compressed data of archive.zip.
242
235
243 test 'verify' with remotestore:
236 test 'verify' with remotestore:
244
237
245 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
238 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
246 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
239 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
247 $ hg -R http-clone verify --large --lfa
240 $ hg -R http-clone verify --large --lfa
248 checking changesets
241 checking changesets
249 checking manifests
242 checking manifests
250 crosschecking files in changesets and manifests
243 crosschecking files in changesets and manifests
251 checking files
244 checking files
252 checked 1 changesets with 1 changes to 1 files
245 checked 1 changesets with 1 changes to 1 files
253 searching 1 changesets for largefiles
246 searching 1 changesets for largefiles
254 changeset 0:cf03e5bb9936: f1 missing
247 changeset 0:cf03e5bb9936: f1 missing
255 verified existence of 1 revisions of 1 largefiles
248 verified existence of 1 revisions of 1 largefiles
256 [1]
249 [1]
257 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
250 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
258 $ hg -R http-clone -q verify --large --lfa
251 $ hg -R http-clone -q verify --large --lfa
259
252
260 largefiles pulled on update - a largefile missing on the server:
253 largefiles pulled on update - a largefile missing on the server:
261 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
254 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
262 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
255 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
263 getting changed largefiles
256 getting changed largefiles
264 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
257 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
265 0 largefiles updated, 0 removed
258 0 largefiles updated, 0 removed
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 $ hg -R http-clone st
260 $ hg -R http-clone st
268 ! f1
261 ! f1
269 $ hg -R http-clone up -Cqr null
262 $ hg -R http-clone up -Cqr null
270
263
271 largefiles pulled on update - a largefile corrupted on the server:
264 largefiles pulled on update - a largefile corrupted on the server:
272 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
265 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
273 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
266 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
274 getting changed largefiles
267 getting changed largefiles
275 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
268 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
276 0 largefiles updated, 0 removed
269 0 largefiles updated, 0 removed
277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
278 $ hg -R http-clone st
271 $ hg -R http-clone st
279 ! f1
272 ! f1
280 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
273 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
281 $ [ ! -f http-clone/f1 ]
274 $ [ ! -f http-clone/f1 ]
282 $ [ ! -f http-clone-usercache ]
275 $ [ ! -f http-clone-usercache ]
283 $ hg -R http-clone verify --large --lfc
276 $ hg -R http-clone verify --large --lfc -q
284 checking changesets
285 checking manifests
286 crosschecking files in changesets and manifests
287 checking files
288 checked 1 changesets with 1 changes to 1 files
289 searching 1 changesets for largefiles
290 verified contents of 1 revisions of 1 largefiles
291 $ hg -R http-clone up -Cqr null
277 $ hg -R http-clone up -Cqr null
292
278
293 largefiles pulled on update - no server side problems:
279 largefiles pulled on update - no server side problems:
294 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
280 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
295 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true
281 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true
296 resolving manifests
282 resolving manifests
297 branchmerge: False, force: False, partial: False
283 branchmerge: False, force: False, partial: False
298 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
284 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
299 .hglf/f1: remote created -> g
285 .hglf/f1: remote created -> g
300 getting .hglf/f1
286 getting .hglf/f1
301 updating: .hglf/f1 1/1 files (100.00%)
287 updating: .hglf/f1 1/1 files (100.00%)
302 getting changed largefiles
288 getting changed largefiles
303 using http://localhost:$HGPORT2/
289 using http://localhost:$HGPORT2/
304 sending capabilities command
290 sending capabilities command
305 sending statlfile command
291 sending statlfile command
306 getting largefiles: 0/1 files (0.00%)
292 getting largefiles: 0/1 files (0.00%)
307 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
293 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
308 sending getlfile command
294 sending getlfile command
309 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
295 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
310 1 largefiles updated, 0 removed
296 1 largefiles updated, 0 removed
311 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
297 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
312
298
313 $ ls http-clone-usercache/*
299 $ ls http-clone-usercache/*
314 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
300 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
315
301
316 $ rm -rf empty http-clone*
302 $ rm -rf empty http-clone*
317
303
318 used all HGPORTs, kill all daemons
304 used all HGPORTs, kill all daemons
319 $ killdaemons.py
305 $ killdaemons.py
320
306
321 largefiles should batch verify remote calls
307 largefiles should batch verify remote calls
322
308
323 $ hg init batchverifymain
309 $ hg init batchverifymain
324 $ cd batchverifymain
310 $ cd batchverifymain
325 $ echo "aaa" >> a
311 $ echo "aaa" >> a
326 $ hg add --large a
312 $ hg add --large a
327 $ hg commit -m "a"
313 $ hg commit -m "a"
328 Invoking status precommit hook
314 Invoking status precommit hook
329 A a
315 A a
330 $ echo "bbb" >> b
316 $ echo "bbb" >> b
331 $ hg add --large b
317 $ hg add --large b
332 $ hg commit -m "b"
318 $ hg commit -m "b"
333 Invoking status precommit hook
319 Invoking status precommit hook
334 A b
320 A b
335 $ cd ..
321 $ cd ..
336 $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \
322 $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \
337 > -A access.log
323 > -A access.log
338 $ cat hg.pid >> $DAEMON_PIDS
324 $ cat hg.pid >> $DAEMON_PIDS
339 $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone
325 $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone
340 requesting all changes
326 requesting all changes
341 adding changesets
327 adding changesets
342 adding manifests
328 adding manifests
343 adding file changes
329 adding file changes
344 added 2 changesets with 2 changes to 2 files
330 added 2 changesets with 2 changes to 2 files
345 new changesets 567253b0f523:04d19c27a332 (2 drafts)
331 new changesets 567253b0f523:04d19c27a332 (2 drafts)
346 $ hg -R batchverifyclone verify --large --lfa
332 $ hg -R batchverifyclone verify --large --lfa -q
347 checking changesets
348 checking manifests
349 crosschecking files in changesets and manifests
350 checking files
351 checked 2 changesets with 2 changes to 2 files
352 searching 2 changesets for largefiles
353 verified existence of 2 revisions of 2 largefiles
354 $ tail -1 access.log
333 $ tail -1 access.log
355 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
334 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
356 $ hg -R batchverifyclone update
335 $ hg -R batchverifyclone update
357 getting changed largefiles
336 getting changed largefiles
358 2 largefiles updated, 0 removed
337 2 largefiles updated, 0 removed
359 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
338 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
360
339
361 Clear log file before next test
340 Clear log file before next test
362
341
363 $ printf "" > access.log
342 $ printf "" > access.log
364
343
365 Verify should check file on remote server only when file is not
344 Verify should check file on remote server only when file is not
366 available locally.
345 available locally.
367
346
368 $ echo "ccc" >> batchverifymain/c
347 $ echo "ccc" >> batchverifymain/c
369 $ hg -R batchverifymain status
348 $ hg -R batchverifymain status
370 ? c
349 ? c
371 $ hg -R batchverifymain add --large batchverifymain/c
350 $ hg -R batchverifymain add --large batchverifymain/c
372 $ hg -R batchverifymain commit -m "c"
351 $ hg -R batchverifymain commit -m "c"
373 Invoking status precommit hook
352 Invoking status precommit hook
374 A c
353 A c
375 $ hg -R batchverifyclone pull
354 $ hg -R batchverifyclone pull
376 pulling from http://localhost:$HGPORT/
355 pulling from http://localhost:$HGPORT/
377 searching for changes
356 searching for changes
378 adding changesets
357 adding changesets
379 adding manifests
358 adding manifests
380 adding file changes
359 adding file changes
381 added 1 changesets with 1 changes to 1 files
360 added 1 changesets with 1 changes to 1 files
382 new changesets 6bba8cb6935d (1 drafts)
361 new changesets 6bba8cb6935d (1 drafts)
383 (run 'hg update' to get a working copy)
362 (run 'hg update' to get a working copy)
384 $ hg -R batchverifyclone verify --lfa
363 $ hg -R batchverifyclone verify --lfa -q
385 checking changesets
386 checking manifests
387 crosschecking files in changesets and manifests
388 checking files
389 checked 3 changesets with 3 changes to 3 files
390 searching 3 changesets for largefiles
391 verified existence of 3 revisions of 3 largefiles
392 $ tail -1 access.log
364 $ tail -1 access.log
393 $LOCALIP - - [$LOGDATE$] "GET /?cmd=statlfile HTTP/1.1" 200 - x-hgarg-1:sha=c8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
365 $LOCALIP - - [$LOGDATE$] "GET /?cmd=statlfile HTTP/1.1" 200 - x-hgarg-1:sha=c8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
394
366
395 $ killdaemons.py
367 $ killdaemons.py
396
368
397 largefiles should not ask for password again after successful authorization
369 largefiles should not ask for password again after successful authorization
398
370
399 $ hg init credentialmain
371 $ hg init credentialmain
400 $ cd credentialmain
372 $ cd credentialmain
401 $ echo "aaa" >> a
373 $ echo "aaa" >> a
402 $ hg add --large a
374 $ hg add --large a
403 $ hg commit -m "a"
375 $ hg commit -m "a"
404 Invoking status precommit hook
376 Invoking status precommit hook
405 A a
377 A a
406
378
407 Before running server clear the user cache to force clone to download
379 Before running server clear the user cache to force clone to download
408 a large file from the server rather than to get it from the cache
380 a large file from the server rather than to get it from the cache
409
381
410 $ rm "${USERCACHE}"/*
382 $ rm "${USERCACHE}"/*
411
383
412 $ cd ..
384 $ cd ..
413
385
414 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -R credentialmain \
386 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -R credentialmain \
415 > -d -p $HGPORT --pid-file hg.pid -A access.log
387 > -d -p $HGPORT --pid-file hg.pid -A access.log
416 $ cat hg.pid >> $DAEMON_PIDS
388 $ cat hg.pid >> $DAEMON_PIDS
417 $ cat << EOF > get_pass.py
389 $ cat << EOF > get_pass.py
418 > from mercurial import util
390 > from mercurial import util
419 > def newgetpass():
391 > def newgetpass():
420 > return "pass"
392 > return "pass"
421 > util.get_password = newgetpass
393 > util.get_password = newgetpass
422 > EOF
394 > EOF
423 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
395 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
424 > http://user@localhost:$HGPORT credentialclone
396 > http://user@localhost:$HGPORT credentialclone
425 http authorization required for http://localhost:$HGPORT/
397 http authorization required for http://localhost:$HGPORT/
426 realm: mercurial
398 realm: mercurial
427 user: user
399 user: user
428 password: requesting all changes
400 password: requesting all changes
429 adding changesets
401 adding changesets
430 adding manifests
402 adding manifests
431 adding file changes
403 adding file changes
432 added 1 changesets with 1 changes to 1 files
404 added 1 changesets with 1 changes to 1 files
433 new changesets 567253b0f523 (1 drafts)
405 new changesets 567253b0f523 (1 drafts)
434 updating to branch default
406 updating to branch default
435 getting changed largefiles
407 getting changed largefiles
436 1 largefiles updated, 0 removed
408 1 largefiles updated, 0 removed
437 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
409 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
438
410
439 $ killdaemons.py
411 $ killdaemons.py
440 $ rm hg.pid access.log
412 $ rm hg.pid access.log
441
413
442 #endif
414 #endif
@@ -1,1892 +1,1878
1 This file used to contains all largefile tests.
1 This file used to contains all largefile tests.
2 Do not add any new tests in this file as it his already far too long to run.
2 Do not add any new tests in this file as it his already far too long to run.
3
3
4 It contains all the testing of the basic concepts of large file in a single block.
4 It contains all the testing of the basic concepts of large file in a single block.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24 Create the repo with a couple of revisions of both large and normal
24 Create the repo with a couple of revisions of both large and normal
25 files.
25 files.
26 Test status and dirstate of largefiles and that summary output is correct.
26 Test status and dirstate of largefiles and that summary output is correct.
27
27
28 $ hg init a
28 $ hg init a
29 $ cd a
29 $ cd a
30 $ mkdir sub
30 $ mkdir sub
31 $ echo normal1 > normal1
31 $ echo normal1 > normal1
32 $ echo normal2 > sub/normal2
32 $ echo normal2 > sub/normal2
33 $ echo large1 > large1
33 $ echo large1 > large1
34 $ echo large2 > sub/large2
34 $ echo large2 > sub/large2
35 $ hg add normal1 sub/normal2
35 $ hg add normal1 sub/normal2
36 $ hg add --large large1 sub/large2
36 $ hg add --large large1 sub/large2
37 $ hg commit -m "add files"
37 $ hg commit -m "add files"
38 Invoking status precommit hook
38 Invoking status precommit hook
39 A large1
39 A large1
40 A normal1
40 A normal1
41 A sub/large2
41 A sub/large2
42 A sub/normal2
42 A sub/normal2
43 $ touch large1 sub/large2
43 $ touch large1 sub/large2
44 $ sleep 1
44 $ sleep 1
45 $ hg st
45 $ hg st
46 $ hg debugstate --no-dates
46 $ hg debugstate --no-dates
47 n 644 41 set .hglf/large1
47 n 644 41 set .hglf/large1
48 n 644 41 set .hglf/sub/large2
48 n 644 41 set .hglf/sub/large2
49 n 644 8 set normal1
49 n 644 8 set normal1
50 n 644 8 set sub/normal2
50 n 644 8 set sub/normal2
51 $ hg debugstate --large --no-dates
51 $ hg debugstate --large --no-dates
52 n 644 7 set large1
52 n 644 7 set large1
53 n 644 7 set sub/large2
53 n 644 7 set sub/large2
54 $ echo normal11 > normal1
54 $ echo normal11 > normal1
55 $ echo normal22 > sub/normal2
55 $ echo normal22 > sub/normal2
56 $ echo large11 > large1
56 $ echo large11 > large1
57 $ echo large22 > sub/large2
57 $ echo large22 > sub/large2
58 $ hg commit -m "edit files"
58 $ hg commit -m "edit files"
59 Invoking status precommit hook
59 Invoking status precommit hook
60 M large1
60 M large1
61 M normal1
61 M normal1
62 M sub/large2
62 M sub/large2
63 M sub/normal2
63 M sub/normal2
64 $ hg sum --large
64 $ hg sum --large
65 parent: 1:ce8896473775 tip
65 parent: 1:ce8896473775 tip
66 edit files
66 edit files
67 branch: default
67 branch: default
68 commit: (clean)
68 commit: (clean)
69 update: (current)
69 update: (current)
70 phases: 2 draft
70 phases: 2 draft
71 largefiles: (no remote repo)
71 largefiles: (no remote repo)
72
72
73 Commit preserved largefile contents.
73 Commit preserved largefile contents.
74
74
75 $ cat normal1
75 $ cat normal1
76 normal11
76 normal11
77 $ cat large1
77 $ cat large1
78 large11
78 large11
79 $ cat sub/normal2
79 $ cat sub/normal2
80 normal22
80 normal22
81 $ cat sub/large2
81 $ cat sub/large2
82 large22
82 large22
83
83
84 Test status, subdir and unknown files
84 Test status, subdir and unknown files
85
85
86 $ echo unknown > sub/unknown
86 $ echo unknown > sub/unknown
87 $ hg st --all
87 $ hg st --all
88 ? sub/unknown
88 ? sub/unknown
89 C large1
89 C large1
90 C normal1
90 C normal1
91 C sub/large2
91 C sub/large2
92 C sub/normal2
92 C sub/normal2
93 $ hg st --all sub
93 $ hg st --all sub
94 ? sub/unknown
94 ? sub/unknown
95 C sub/large2
95 C sub/large2
96 C sub/normal2
96 C sub/normal2
97 $ rm sub/unknown
97 $ rm sub/unknown
98
98
99 Test messages and exit codes for remove warning cases
99 Test messages and exit codes for remove warning cases
100
100
101 $ hg remove -A large1
101 $ hg remove -A large1
102 not removing large1: file still exists
102 not removing large1: file still exists
103 [1]
103 [1]
104 $ echo 'modified' > large1
104 $ echo 'modified' > large1
105 $ hg remove large1
105 $ hg remove large1
106 not removing large1: file is modified (use -f to force removal)
106 not removing large1: file is modified (use -f to force removal)
107 [1]
107 [1]
108 $ echo 'new' > normalnew
108 $ echo 'new' > normalnew
109 $ hg add normalnew
109 $ hg add normalnew
110 $ echo 'new' > largenew
110 $ echo 'new' > largenew
111 $ hg add --large normalnew
111 $ hg add --large normalnew
112 normalnew already tracked!
112 normalnew already tracked!
113 $ hg remove normalnew largenew
113 $ hg remove normalnew largenew
114 not removing largenew: file is untracked
114 not removing largenew: file is untracked
115 not removing normalnew: file has been marked for add (use 'hg forget' to undo add)
115 not removing normalnew: file has been marked for add (use 'hg forget' to undo add)
116 [1]
116 [1]
117 $ rm normalnew largenew
117 $ rm normalnew largenew
118 $ hg up -Cq
118 $ hg up -Cq
119
119
120 Remove both largefiles and normal files.
120 Remove both largefiles and normal files.
121
121
122 $ hg remove normal1 large1
122 $ hg remove normal1 large1
123 $ hg status large1
123 $ hg status large1
124 R large1
124 R large1
125 $ hg commit -m "remove files"
125 $ hg commit -m "remove files"
126 Invoking status precommit hook
126 Invoking status precommit hook
127 R large1
127 R large1
128 R normal1
128 R normal1
129 $ ls -A
129 $ ls -A
130 .hg
130 .hg
131 .hglf
131 .hglf
132 sub
132 sub
133 $ echo "testlargefile" > large1-test
133 $ echo "testlargefile" > large1-test
134 $ hg add --large large1-test
134 $ hg add --large large1-test
135 $ hg st
135 $ hg st
136 A large1-test
136 A large1-test
137 $ hg rm large1-test
137 $ hg rm large1-test
138 not removing large1-test: file has been marked for add (use forget to undo)
138 not removing large1-test: file has been marked for add (use forget to undo)
139 [1]
139 [1]
140 $ hg st
140 $ hg st
141 A large1-test
141 A large1-test
142 $ hg forget large1-test
142 $ hg forget large1-test
143 $ hg st
143 $ hg st
144 ? large1-test
144 ? large1-test
145 $ hg remove large1-test
145 $ hg remove large1-test
146 not removing large1-test: file is untracked
146 not removing large1-test: file is untracked
147 [1]
147 [1]
148 $ hg forget large1-test
148 $ hg forget large1-test
149 not removing large1-test: file is already untracked
149 not removing large1-test: file is already untracked
150 [1]
150 [1]
151 $ rm large1-test
151 $ rm large1-test
152
152
153 Copy both largefiles and normal files (testing that status output is correct).
153 Copy both largefiles and normal files (testing that status output is correct).
154
154
155 $ hg cp sub/normal2 normal1
155 $ hg cp sub/normal2 normal1
156 $ hg cp sub/large2 large1
156 $ hg cp sub/large2 large1
157 $ hg commit -m "copy files"
157 $ hg commit -m "copy files"
158 Invoking status precommit hook
158 Invoking status precommit hook
159 A large1
159 A large1
160 A normal1
160 A normal1
161 $ cat normal1
161 $ cat normal1
162 normal22
162 normal22
163 $ cat large1
163 $ cat large1
164 large22
164 large22
165
165
166 Test moving largefiles and verify that normal files are also unaffected.
166 Test moving largefiles and verify that normal files are also unaffected.
167
167
168 $ hg mv normal1 normal3
168 $ hg mv normal1 normal3
169 $ hg mv large1 large3
169 $ hg mv large1 large3
170 $ hg mv sub/normal2 sub/normal4
170 $ hg mv sub/normal2 sub/normal4
171 $ hg mv sub/large2 sub/large4
171 $ hg mv sub/large2 sub/large4
172 $ hg commit -m "move files"
172 $ hg commit -m "move files"
173 Invoking status precommit hook
173 Invoking status precommit hook
174 A large3
174 A large3
175 A normal3
175 A normal3
176 A sub/large4
176 A sub/large4
177 A sub/normal4
177 A sub/normal4
178 R large1
178 R large1
179 R normal1
179 R normal1
180 R sub/large2
180 R sub/large2
181 R sub/normal2
181 R sub/normal2
182 $ cat normal3
182 $ cat normal3
183 normal22
183 normal22
184 $ cat large3
184 $ cat large3
185 large22
185 large22
186 $ cat sub/normal4
186 $ cat sub/normal4
187 normal22
187 normal22
188 $ cat sub/large4
188 $ cat sub/large4
189 large22
189 large22
190
190
191
191
192 #if serve
192 #if serve
193 Test display of largefiles in hgweb
193 Test display of largefiles in hgweb
194
194
195 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
195 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
196 $ cat ../hg.pid >> $DAEMON_PIDS
196 $ cat ../hg.pid >> $DAEMON_PIDS
197 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
197 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
198 200 Script output follows
198 200 Script output follows
199
199
200
200
201 drwxr-xr-x sub
201 drwxr-xr-x sub
202 -rw-r--r-- 41 large3
202 -rw-r--r-- 41 large3
203 -rw-r--r-- 9 normal3
203 -rw-r--r-- 9 normal3
204
204
205
205
206 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
206 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
207 200 Script output follows
207 200 Script output follows
208
208
209
209
210 -rw-r--r-- 41 large4
210 -rw-r--r-- 41 large4
211 -rw-r--r-- 9 normal4
211 -rw-r--r-- 9 normal4
212
212
213
213
214 $ killdaemons.py
214 $ killdaemons.py
215 #endif
215 #endif
216
216
217 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
217 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
218
218
219 $ cat <<EOF > "$TESTTMP/hgweb.cgi"
219 $ cat <<EOF > "$TESTTMP/hgweb.cgi"
220 > #!$PYTHON
220 > #!$PYTHON
221 > from mercurial import demandimport; demandimport.enable()
221 > from mercurial import demandimport; demandimport.enable()
222 > from mercurial.hgweb import hgweb
222 > from mercurial.hgweb import hgweb
223 > from mercurial.hgweb import wsgicgi
223 > from mercurial.hgweb import wsgicgi
224 > application = hgweb(b'.', b'test repo')
224 > application = hgweb(b'.', b'test repo')
225 > wsgicgi.launch(application)
225 > wsgicgi.launch(application)
226 > EOF
226 > EOF
227 $ . "$TESTDIR/cgienv"
227 $ . "$TESTDIR/cgienv"
228
228
229 $ SCRIPT_NAME='' \
229 $ SCRIPT_NAME='' \
230 > "$PYTHON" "$TESTTMP/hgweb.cgi" > /dev/null
230 > "$PYTHON" "$TESTTMP/hgweb.cgi" > /dev/null
231
231
232 Test archiving the various revisions. These hit corner cases known with
232 Test archiving the various revisions. These hit corner cases known with
233 archiving.
233 archiving.
234
234
235 $ hg archive -r 0 ../archive0
235 $ hg archive -r 0 ../archive0
236 $ hg archive -r 1 ../archive1
236 $ hg archive -r 1 ../archive1
237 $ hg archive -r 2 ../archive2
237 $ hg archive -r 2 ../archive2
238 $ hg archive -r 3 ../archive3
238 $ hg archive -r 3 ../archive3
239 $ hg archive -r 4 ../archive4
239 $ hg archive -r 4 ../archive4
240 $ cd ../archive0
240 $ cd ../archive0
241 $ cat normal1
241 $ cat normal1
242 normal1
242 normal1
243 $ cat large1
243 $ cat large1
244 large1
244 large1
245 $ cat sub/normal2
245 $ cat sub/normal2
246 normal2
246 normal2
247 $ cat sub/large2
247 $ cat sub/large2
248 large2
248 large2
249 $ cd ../archive1
249 $ cd ../archive1
250 $ cat normal1
250 $ cat normal1
251 normal11
251 normal11
252 $ cat large1
252 $ cat large1
253 large11
253 large11
254 $ cat sub/normal2
254 $ cat sub/normal2
255 normal22
255 normal22
256 $ cat sub/large2
256 $ cat sub/large2
257 large22
257 large22
258 $ cd ../archive2
258 $ cd ../archive2
259 $ ls -A
259 $ ls -A
260 .hg_archival.txt
260 .hg_archival.txt
261 sub
261 sub
262 $ cat sub/normal2
262 $ cat sub/normal2
263 normal22
263 normal22
264 $ cat sub/large2
264 $ cat sub/large2
265 large22
265 large22
266 $ cd ../archive3
266 $ cd ../archive3
267 $ cat normal1
267 $ cat normal1
268 normal22
268 normal22
269 $ cat large1
269 $ cat large1
270 large22
270 large22
271 $ cat sub/normal2
271 $ cat sub/normal2
272 normal22
272 normal22
273 $ cat sub/large2
273 $ cat sub/large2
274 large22
274 large22
275 $ cd ../archive4
275 $ cd ../archive4
276 $ cat normal3
276 $ cat normal3
277 normal22
277 normal22
278 $ cat large3
278 $ cat large3
279 large22
279 large22
280 $ cat sub/normal4
280 $ cat sub/normal4
281 normal22
281 normal22
282 $ cat sub/large4
282 $ cat sub/large4
283 large22
283 large22
284
284
285 Commit corner case: specify files to commit.
285 Commit corner case: specify files to commit.
286
286
287 $ cd ../a
287 $ cd ../a
288 $ echo normal3 > normal3
288 $ echo normal3 > normal3
289 $ echo large3 > large3
289 $ echo large3 > large3
290 $ echo normal4 > sub/normal4
290 $ echo normal4 > sub/normal4
291 $ echo large4 > sub/large4
291 $ echo large4 > sub/large4
292 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
292 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
293 Invoking status precommit hook
293 Invoking status precommit hook
294 M large3
294 M large3
295 M normal3
295 M normal3
296 M sub/large4
296 M sub/large4
297 M sub/normal4
297 M sub/normal4
298 $ cat normal3
298 $ cat normal3
299 normal3
299 normal3
300 $ cat large3
300 $ cat large3
301 large3
301 large3
302 $ cat sub/normal4
302 $ cat sub/normal4
303 normal4
303 normal4
304 $ cat sub/large4
304 $ cat sub/large4
305 large4
305 large4
306
306
307 One more commit corner case: commit from a subdirectory.
307 One more commit corner case: commit from a subdirectory.
308
308
309 $ cd ../a
309 $ cd ../a
310 $ echo normal33 > normal3
310 $ echo normal33 > normal3
311 $ echo large33 > large3
311 $ echo large33 > large3
312 $ echo normal44 > sub/normal4
312 $ echo normal44 > sub/normal4
313 $ echo large44 > sub/large4
313 $ echo large44 > sub/large4
314 $ cd sub
314 $ cd sub
315 $ hg commit -m "edit files yet again"
315 $ hg commit -m "edit files yet again"
316 Invoking status precommit hook
316 Invoking status precommit hook
317 M large3
317 M large3
318 M normal3
318 M normal3
319 M sub/large4
319 M sub/large4
320 M sub/normal4
320 M sub/normal4
321 $ cat ../normal3
321 $ cat ../normal3
322 normal33
322 normal33
323 $ cat ../large3
323 $ cat ../large3
324 large33
324 large33
325 $ cat normal4
325 $ cat normal4
326 normal44
326 normal44
327 $ cat large4
327 $ cat large4
328 large44
328 large44
329
329
330 Committing standins is not allowed.
330 Committing standins is not allowed.
331
331
332 $ cd ..
332 $ cd ..
333 $ echo large3 > large3
333 $ echo large3 > large3
334 $ hg commit .hglf/large3 -m "try to commit standin"
334 $ hg commit .hglf/large3 -m "try to commit standin"
335 abort: file ".hglf/large3" is a largefile standin
335 abort: file ".hglf/large3" is a largefile standin
336 (commit the largefile itself instead)
336 (commit the largefile itself instead)
337 [255]
337 [255]
338
338
339 Corner cases for adding largefiles.
339 Corner cases for adding largefiles.
340
340
341 $ echo large5 > large5
341 $ echo large5 > large5
342 $ hg add --large large5
342 $ hg add --large large5
343 $ hg add --large large5
343 $ hg add --large large5
344 large5 already a largefile
344 large5 already a largefile
345 $ mkdir sub2
345 $ mkdir sub2
346 $ echo large6 > sub2/large6
346 $ echo large6 > sub2/large6
347 $ echo large7 > sub2/large7
347 $ echo large7 > sub2/large7
348 $ hg add --large sub2
348 $ hg add --large sub2
349 adding sub2/large6 as a largefile
349 adding sub2/large6 as a largefile
350 adding sub2/large7 as a largefile
350 adding sub2/large7 as a largefile
351 $ hg st
351 $ hg st
352 M large3
352 M large3
353 A large5
353 A large5
354 A sub2/large6
354 A sub2/large6
355 A sub2/large7
355 A sub2/large7
356
356
357 Committing directories containing only largefiles.
357 Committing directories containing only largefiles.
358
358
359 $ mkdir -p z/y/x/m
359 $ mkdir -p z/y/x/m
360 $ touch z/y/x/m/large1
360 $ touch z/y/x/m/large1
361 $ touch z/y/x/large2
361 $ touch z/y/x/large2
362 $ hg add --large z/y/x/m/large1 z/y/x/large2
362 $ hg add --large z/y/x/m/large1 z/y/x/large2
363 $ hg commit -m "Subdir with directory only containing largefiles" z
363 $ hg commit -m "Subdir with directory only containing largefiles" z
364 Invoking status precommit hook
364 Invoking status precommit hook
365 M large3
365 M large3
366 A large5
366 A large5
367 A sub2/large6
367 A sub2/large6
368 A sub2/large7
368 A sub2/large7
369 A z/y/x/large2
369 A z/y/x/large2
370 A z/y/x/m/large1
370 A z/y/x/m/large1
371
371
372 (and a bit of log testing)
372 (and a bit of log testing)
373
373
374 $ hg log -T '{rev}\n' z/y/x/m/large1
374 $ hg log -T '{rev}\n' z/y/x/m/large1
375 7
375 7
376 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
376 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
377 7
377 7
378
378
379 $ hg rollback --quiet
379 $ hg rollback --quiet
380 $ touch z/y/x/m/normal
380 $ touch z/y/x/m/normal
381 $ hg add z/y/x/m/normal
381 $ hg add z/y/x/m/normal
382 $ hg commit -m "Subdir with mixed contents" z
382 $ hg commit -m "Subdir with mixed contents" z
383 Invoking status precommit hook
383 Invoking status precommit hook
384 M large3
384 M large3
385 A large5
385 A large5
386 A sub2/large6
386 A sub2/large6
387 A sub2/large7
387 A sub2/large7
388 A z/y/x/large2
388 A z/y/x/large2
389 A z/y/x/m/large1
389 A z/y/x/m/large1
390 A z/y/x/m/normal
390 A z/y/x/m/normal
391 $ hg st
391 $ hg st
392 M large3
392 M large3
393 A large5
393 A large5
394 A sub2/large6
394 A sub2/large6
395 A sub2/large7
395 A sub2/large7
396 $ hg rollback --quiet
396 $ hg rollback --quiet
397 $ hg revert z/y/x/large2 z/y/x/m/large1
397 $ hg revert z/y/x/large2 z/y/x/m/large1
398 $ rm z/y/x/large2 z/y/x/m/large1
398 $ rm z/y/x/large2 z/y/x/m/large1
399 $ hg commit -m "Subdir with normal contents" z
399 $ hg commit -m "Subdir with normal contents" z
400 Invoking status precommit hook
400 Invoking status precommit hook
401 M large3
401 M large3
402 A large5
402 A large5
403 A sub2/large6
403 A sub2/large6
404 A sub2/large7
404 A sub2/large7
405 A z/y/x/m/normal
405 A z/y/x/m/normal
406 $ hg st
406 $ hg st
407 M large3
407 M large3
408 A large5
408 A large5
409 A sub2/large6
409 A sub2/large6
410 A sub2/large7
410 A sub2/large7
411 $ hg rollback --quiet
411 $ hg rollback --quiet
412 $ hg revert --quiet z
412 $ hg revert --quiet z
413 $ hg commit -m "Empty subdir" z
413 $ hg commit -m "Empty subdir" z
414 abort: z: no match under directory!
414 abort: z: no match under directory!
415 [10]
415 [10]
416 $ rm -rf z
416 $ rm -rf z
417 $ hg ci -m "standin" .hglf
417 $ hg ci -m "standin" .hglf
418 abort: file ".hglf" is a largefile standin
418 abort: file ".hglf" is a largefile standin
419 (commit the largefile itself instead)
419 (commit the largefile itself instead)
420 [255]
420 [255]
421
421
422 Test "hg status" with combination of 'file pattern' and 'directory
422 Test "hg status" with combination of 'file pattern' and 'directory
423 pattern' for largefiles:
423 pattern' for largefiles:
424
424
425 $ hg status sub2/large6 sub2
425 $ hg status sub2/large6 sub2
426 A sub2/large6
426 A sub2/large6
427 A sub2/large7
427 A sub2/large7
428
428
429 Config settings (pattern **.dat, minsize 2 MB) are respected.
429 Config settings (pattern **.dat, minsize 2 MB) are respected.
430
430
431 $ echo testdata > test.dat
431 $ echo testdata > test.dat
432 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
432 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
433 $ hg add
433 $ hg add
434 adding reallylarge as a largefile
434 adding reallylarge as a largefile
435 adding test.dat as a largefile
435 adding test.dat as a largefile
436
436
437 Test that minsize and --lfsize handle float values;
437 Test that minsize and --lfsize handle float values;
438 also tests that --lfsize overrides largefiles.minsize.
438 also tests that --lfsize overrides largefiles.minsize.
439 (0.250 MB = 256 kB = 262144 B)
439 (0.250 MB = 256 kB = 262144 B)
440
440
441 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
441 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
442 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
442 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
443 $ hg --config largefiles.minsize=.25 add
443 $ hg --config largefiles.minsize=.25 add
444 adding ratherlarge as a largefile
444 adding ratherlarge as a largefile
445 adding medium
445 adding medium
446 $ hg forget medium
446 $ hg forget medium
447 $ hg --config largefiles.minsize=.25 add --lfsize=.125
447 $ hg --config largefiles.minsize=.25 add --lfsize=.125
448 adding medium as a largefile
448 adding medium as a largefile
449 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
449 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
450 $ hg --config largefiles.minsize=.25 add --lfsize=.125
450 $ hg --config largefiles.minsize=.25 add --lfsize=.125
451 adding notlarge
451 adding notlarge
452 $ hg forget notlarge
452 $ hg forget notlarge
453
453
454 Test forget on largefiles.
454 Test forget on largefiles.
455
455
456 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
456 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
457 $ hg commit -m "add/edit more largefiles"
457 $ hg commit -m "add/edit more largefiles"
458 Invoking status precommit hook
458 Invoking status precommit hook
459 A sub2/large6
459 A sub2/large6
460 A sub2/large7
460 A sub2/large7
461 R large3
461 R large3
462 ? large5
462 ? large5
463 ? medium
463 ? medium
464 ? notlarge
464 ? notlarge
465 ? ratherlarge
465 ? ratherlarge
466 ? reallylarge
466 ? reallylarge
467 ? test.dat
467 ? test.dat
468 $ hg st
468 $ hg st
469 ? large3
469 ? large3
470 ? large5
470 ? large5
471 ? medium
471 ? medium
472 ? notlarge
472 ? notlarge
473 ? ratherlarge
473 ? ratherlarge
474 ? reallylarge
474 ? reallylarge
475 ? test.dat
475 ? test.dat
476
476
477 Purge with largefiles: verify that largefiles are still in the working
477 Purge with largefiles: verify that largefiles are still in the working
478 dir after a purge.
478 dir after a purge.
479
479
480 $ hg purge --all
480 $ hg purge --all
481 $ cat sub/large4
481 $ cat sub/large4
482 large44
482 large44
483 $ cat sub2/large6
483 $ cat sub2/large6
484 large6
484 large6
485 $ cat sub2/large7
485 $ cat sub2/large7
486 large7
486 large7
487
487
488 Test addremove: verify that files that should be added as largefiles are added as
488 Test addremove: verify that files that should be added as largefiles are added as
489 such and that already-existing largefiles are not added as normal files by
489 such and that already-existing largefiles are not added as normal files by
490 accident.
490 accident.
491
491
492 $ rm normal3
492 $ rm normal3
493 $ rm sub/large4
493 $ rm sub/large4
494 $ echo "testing addremove with patterns" > testaddremove.dat
494 $ echo "testing addremove with patterns" > testaddremove.dat
495 $ echo "normaladdremove" > normaladdremove
495 $ echo "normaladdremove" > normaladdremove
496 $ hg addremove
496 $ hg addremove
497 removing sub/large4
497 removing sub/large4
498 adding testaddremove.dat as a largefile
498 adding testaddremove.dat as a largefile
499 removing normal3
499 removing normal3
500 adding normaladdremove
500 adding normaladdremove
501
501
502 Test addremove with -R
502 Test addremove with -R
503
503
504 $ hg up -C
504 $ hg up -C
505 getting changed largefiles
505 getting changed largefiles
506 1 largefiles updated, 0 removed
506 1 largefiles updated, 0 removed
507 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
507 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
508 $ rm normal3
508 $ rm normal3
509 $ rm sub/large4
509 $ rm sub/large4
510 $ echo "testing addremove with patterns" > testaddremove.dat
510 $ echo "testing addremove with patterns" > testaddremove.dat
511 $ echo "normaladdremove" > normaladdremove
511 $ echo "normaladdremove" > normaladdremove
512 $ cd ..
512 $ cd ..
513 $ hg -R a -v addremove
513 $ hg -R a -v addremove
514 removing sub/large4
514 removing sub/large4
515 adding testaddremove.dat as a largefile
515 adding testaddremove.dat as a largefile
516 removing normal3
516 removing normal3
517 adding normaladdremove
517 adding normaladdremove
518 $ cd a
518 $ cd a
519
519
520 Test 3364
520 Test 3364
521 $ hg clone . ../addrm
521 $ hg clone . ../addrm
522 updating to branch default
522 updating to branch default
523 getting changed largefiles
523 getting changed largefiles
524 3 largefiles updated, 0 removed
524 3 largefiles updated, 0 removed
525 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
526 $ cd ../addrm
526 $ cd ../addrm
527 $ cat >> .hg/hgrc <<EOF
527 $ cat >> .hg/hgrc <<EOF
528 > [hooks]
528 > [hooks]
529 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
529 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
530 > EOF
530 > EOF
531 $ touch foo
531 $ touch foo
532 $ hg add --large foo
532 $ hg add --large foo
533 $ hg ci -m "add foo"
533 $ hg ci -m "add foo"
534 Invoking status precommit hook
534 Invoking status precommit hook
535 A foo
535 A foo
536 Invoking status postcommit hook
536 Invoking status postcommit hook
537 C foo
537 C foo
538 C normal3
538 C normal3
539 C sub/large4
539 C sub/large4
540 C sub/normal4
540 C sub/normal4
541 C sub2/large6
541 C sub2/large6
542 C sub2/large7
542 C sub2/large7
543 $ rm foo
543 $ rm foo
544 $ hg st
544 $ hg st
545 ! foo
545 ! foo
546 hmm.. no precommit invoked, but there is a postcommit??
546 hmm.. no precommit invoked, but there is a postcommit??
547 $ hg ci -m "will not checkin"
547 $ hg ci -m "will not checkin"
548 nothing changed (1 missing files, see 'hg status')
548 nothing changed (1 missing files, see 'hg status')
549 Invoking status postcommit hook
549 Invoking status postcommit hook
550 ! foo
550 ! foo
551 C normal3
551 C normal3
552 C sub/large4
552 C sub/large4
553 C sub/normal4
553 C sub/normal4
554 C sub2/large6
554 C sub2/large6
555 C sub2/large7
555 C sub2/large7
556 [1]
556 [1]
557 $ hg addremove
557 $ hg addremove
558 removing foo
558 removing foo
559 $ hg st
559 $ hg st
560 R foo
560 R foo
561 $ hg ci -m "used to say nothing changed"
561 $ hg ci -m "used to say nothing changed"
562 Invoking status precommit hook
562 Invoking status precommit hook
563 R foo
563 R foo
564 Invoking status postcommit hook
564 Invoking status postcommit hook
565 C normal3
565 C normal3
566 C sub/large4
566 C sub/large4
567 C sub/normal4
567 C sub/normal4
568 C sub2/large6
568 C sub2/large6
569 C sub2/large7
569 C sub2/large7
570 $ hg st
570 $ hg st
571
571
572 Test 3507 (both normal files and largefiles were a problem)
572 Test 3507 (both normal files and largefiles were a problem)
573
573
574 $ touch normal
574 $ touch normal
575 $ touch large
575 $ touch large
576 $ hg add normal
576 $ hg add normal
577 $ hg add --large large
577 $ hg add --large large
578 $ hg ci -m "added"
578 $ hg ci -m "added"
579 Invoking status precommit hook
579 Invoking status precommit hook
580 A large
580 A large
581 A normal
581 A normal
582 Invoking status postcommit hook
582 Invoking status postcommit hook
583 C large
583 C large
584 C normal
584 C normal
585 C normal3
585 C normal3
586 C sub/large4
586 C sub/large4
587 C sub/normal4
587 C sub/normal4
588 C sub2/large6
588 C sub2/large6
589 C sub2/large7
589 C sub2/large7
590 $ hg remove normal
590 $ hg remove normal
591 $ hg addremove --traceback
591 $ hg addremove --traceback
592 $ hg ci -m "addremoved normal"
592 $ hg ci -m "addremoved normal"
593 Invoking status precommit hook
593 Invoking status precommit hook
594 R normal
594 R normal
595 Invoking status postcommit hook
595 Invoking status postcommit hook
596 C large
596 C large
597 C normal3
597 C normal3
598 C sub/large4
598 C sub/large4
599 C sub/normal4
599 C sub/normal4
600 C sub2/large6
600 C sub2/large6
601 C sub2/large7
601 C sub2/large7
602 $ hg up -C '.^'
602 $ hg up -C '.^'
603 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
603 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
604 $ hg remove large
604 $ hg remove large
605 $ hg addremove --traceback
605 $ hg addremove --traceback
606 $ hg ci -m "removed large"
606 $ hg ci -m "removed large"
607 Invoking status precommit hook
607 Invoking status precommit hook
608 R large
608 R large
609 created new head
609 created new head
610 Invoking status postcommit hook
610 Invoking status postcommit hook
611 C normal
611 C normal
612 C normal3
612 C normal3
613 C sub/large4
613 C sub/large4
614 C sub/normal4
614 C sub/normal4
615 C sub2/large6
615 C sub2/large6
616 C sub2/large7
616 C sub2/large7
617
617
618 Test commit -A (issue3542)
618 Test commit -A (issue3542)
619 $ echo large8 > large8
619 $ echo large8 > large8
620 $ hg add --large large8
620 $ hg add --large large8
621 $ hg ci -Am 'this used to add large8 as normal and commit both'
621 $ hg ci -Am 'this used to add large8 as normal and commit both'
622 Invoking status precommit hook
622 Invoking status precommit hook
623 A large8
623 A large8
624 Invoking status postcommit hook
624 Invoking status postcommit hook
625 C large8
625 C large8
626 C normal
626 C normal
627 C normal3
627 C normal3
628 C sub/large4
628 C sub/large4
629 C sub/normal4
629 C sub/normal4
630 C sub2/large6
630 C sub2/large6
631 C sub2/large7
631 C sub2/large7
632 $ rm large8
632 $ rm large8
633 $ hg ci -Am 'this used to not notice the rm'
633 $ hg ci -Am 'this used to not notice the rm'
634 removing large8
634 removing large8
635 Invoking status precommit hook
635 Invoking status precommit hook
636 R large8
636 R large8
637 Invoking status postcommit hook
637 Invoking status postcommit hook
638 C normal
638 C normal
639 C normal3
639 C normal3
640 C sub/large4
640 C sub/large4
641 C sub/normal4
641 C sub/normal4
642 C sub2/large6
642 C sub2/large6
643 C sub2/large7
643 C sub2/large7
644
644
645 Test that a standin can't be added as a large file
645 Test that a standin can't be added as a large file
646
646
647 $ touch large
647 $ touch large
648 $ hg add --large large
648 $ hg add --large large
649 $ hg ci -m "add"
649 $ hg ci -m "add"
650 Invoking status precommit hook
650 Invoking status precommit hook
651 A large
651 A large
652 Invoking status postcommit hook
652 Invoking status postcommit hook
653 C large
653 C large
654 C normal
654 C normal
655 C normal3
655 C normal3
656 C sub/large4
656 C sub/large4
657 C sub/normal4
657 C sub/normal4
658 C sub2/large6
658 C sub2/large6
659 C sub2/large7
659 C sub2/large7
660 $ hg remove large
660 $ hg remove large
661 $ touch large
661 $ touch large
662 $ hg addremove --config largefiles.patterns=**large --traceback
662 $ hg addremove --config largefiles.patterns=**large --traceback
663 adding large as a largefile
663 adding large as a largefile
664
664
665 Test that outgoing --large works (with revsets too)
665 Test that outgoing --large works (with revsets too)
666 $ hg outgoing --rev '.^' --large
666 $ hg outgoing --rev '.^' --large
667 comparing with $TESTTMP/a
667 comparing with $TESTTMP/a
668 searching for changes
668 searching for changes
669 changeset: 8:c02fd3b77ec4
669 changeset: 8:c02fd3b77ec4
670 user: test
670 user: test
671 date: Thu Jan 01 00:00:00 1970 +0000
671 date: Thu Jan 01 00:00:00 1970 +0000
672 summary: add foo
672 summary: add foo
673
673
674 changeset: 9:289dd08c9bbb
674 changeset: 9:289dd08c9bbb
675 user: test
675 user: test
676 date: Thu Jan 01 00:00:00 1970 +0000
676 date: Thu Jan 01 00:00:00 1970 +0000
677 summary: used to say nothing changed
677 summary: used to say nothing changed
678
678
679 changeset: 10:34f23ac6ac12
679 changeset: 10:34f23ac6ac12
680 user: test
680 user: test
681 date: Thu Jan 01 00:00:00 1970 +0000
681 date: Thu Jan 01 00:00:00 1970 +0000
682 summary: added
682 summary: added
683
683
684 changeset: 12:710c1b2f523c
684 changeset: 12:710c1b2f523c
685 parent: 10:34f23ac6ac12
685 parent: 10:34f23ac6ac12
686 user: test
686 user: test
687 date: Thu Jan 01 00:00:00 1970 +0000
687 date: Thu Jan 01 00:00:00 1970 +0000
688 summary: removed large
688 summary: removed large
689
689
690 changeset: 13:0a3e75774479
690 changeset: 13:0a3e75774479
691 user: test
691 user: test
692 date: Thu Jan 01 00:00:00 1970 +0000
692 date: Thu Jan 01 00:00:00 1970 +0000
693 summary: this used to add large8 as normal and commit both
693 summary: this used to add large8 as normal and commit both
694
694
695 changeset: 14:84f3d378175c
695 changeset: 14:84f3d378175c
696 user: test
696 user: test
697 date: Thu Jan 01 00:00:00 1970 +0000
697 date: Thu Jan 01 00:00:00 1970 +0000
698 summary: this used to not notice the rm
698 summary: this used to not notice the rm
699
699
700 largefiles to upload (1 entities):
700 largefiles to upload (1 entities):
701 large8
701 large8
702
702
703 $ cd ../a
703 $ cd ../a
704
704
705 Clone a largefiles repo.
705 Clone a largefiles repo.
706
706
707 $ hg clone . ../b
707 $ hg clone . ../b
708 updating to branch default
708 updating to branch default
709 getting changed largefiles
709 getting changed largefiles
710 3 largefiles updated, 0 removed
710 3 largefiles updated, 0 removed
711 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
711 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
712 $ cd ../b
712 $ cd ../b
713 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
713 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
714 7:daea875e9014 add/edit more largefiles
714 7:daea875e9014 add/edit more largefiles
715 6:4355d653f84f edit files yet again
715 6:4355d653f84f edit files yet again
716 5:9d5af5072dbd edit files again
716 5:9d5af5072dbd edit files again
717 4:74c02385b94c move files
717 4:74c02385b94c move files
718 3:9e8fbc4bce62 copy files
718 3:9e8fbc4bce62 copy files
719 2:51a0ae4d5864 remove files
719 2:51a0ae4d5864 remove files
720 1:ce8896473775 edit files
720 1:ce8896473775 edit files
721 0:30d30fe6a5be add files
721 0:30d30fe6a5be add files
722 $ cat normal3
722 $ cat normal3
723 normal33
723 normal33
724
724
725 Test graph log
725 Test graph log
726
726
727 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
727 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
728 @ 7:daea875e9014 add/edit more largefiles
728 @ 7:daea875e9014 add/edit more largefiles
729 |
729 |
730 o 6:4355d653f84f edit files yet again
730 o 6:4355d653f84f edit files yet again
731 |
731 |
732 o 5:9d5af5072dbd edit files again
732 o 5:9d5af5072dbd edit files again
733 |
733 |
734 o 4:74c02385b94c move files
734 o 4:74c02385b94c move files
735 |
735 |
736 o 3:9e8fbc4bce62 copy files
736 o 3:9e8fbc4bce62 copy files
737 |
737 |
738 o 2:51a0ae4d5864 remove files
738 o 2:51a0ae4d5864 remove files
739 |
739 |
740 o 1:ce8896473775 edit files
740 o 1:ce8896473775 edit files
741 |
741 |
742 o 0:30d30fe6a5be add files
742 o 0:30d30fe6a5be add files
743
743
744
744
745 Test log with --patch
745 Test log with --patch
746
746
747 $ hg log --patch -r 6::7
747 $ hg log --patch -r 6::7
748 changeset: 6:4355d653f84f
748 changeset: 6:4355d653f84f
749 user: test
749 user: test
750 date: Thu Jan 01 00:00:00 1970 +0000
750 date: Thu Jan 01 00:00:00 1970 +0000
751 summary: edit files yet again
751 summary: edit files yet again
752
752
753 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
753 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
754 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
754 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
755 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
755 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
756 @@ -1,1 +1,1 @@
756 @@ -1,1 +1,1 @@
757 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
757 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
758 +7838695e10da2bb75ac1156565f40a2595fa2fa0
758 +7838695e10da2bb75ac1156565f40a2595fa2fa0
759 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
759 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
760 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
760 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
761 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
761 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
762 @@ -1,1 +1,1 @@
762 @@ -1,1 +1,1 @@
763 -aeb2210d19f02886dde00dac279729a48471e2f9
763 -aeb2210d19f02886dde00dac279729a48471e2f9
764 +971fb41e78fea4f8e0ba5244784239371cb00591
764 +971fb41e78fea4f8e0ba5244784239371cb00591
765 diff -r 9d5af5072dbd -r 4355d653f84f normal3
765 diff -r 9d5af5072dbd -r 4355d653f84f normal3
766 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
766 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
767 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
767 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
768 @@ -1,1 +1,1 @@
768 @@ -1,1 +1,1 @@
769 -normal3
769 -normal3
770 +normal33
770 +normal33
771 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
771 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
772 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
772 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
773 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
773 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
774 @@ -1,1 +1,1 @@
774 @@ -1,1 +1,1 @@
775 -normal4
775 -normal4
776 +normal44
776 +normal44
777
777
778 changeset: 7:daea875e9014
778 changeset: 7:daea875e9014
779 tag: tip
779 tag: tip
780 user: test
780 user: test
781 date: Thu Jan 01 00:00:00 1970 +0000
781 date: Thu Jan 01 00:00:00 1970 +0000
782 summary: add/edit more largefiles
782 summary: add/edit more largefiles
783
783
784 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
784 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
785 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
785 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
786 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
786 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
787 @@ -1,1 +0,0 @@
787 @@ -1,1 +0,0 @@
788 -7838695e10da2bb75ac1156565f40a2595fa2fa0
788 -7838695e10da2bb75ac1156565f40a2595fa2fa0
789 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
789 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
790 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
790 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
791 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
791 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
792 @@ -0,0 +1,1 @@
792 @@ -0,0 +1,1 @@
793 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
793 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
794 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
794 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
795 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
795 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
796 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
796 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
797 @@ -0,0 +1,1 @@
797 @@ -0,0 +1,1 @@
798 +bb3151689acb10f0c3125c560d5e63df914bc1af
798 +bb3151689acb10f0c3125c560d5e63df914bc1af
799
799
800
800
801 $ hg log --patch -r 6::7 sub/
801 $ hg log --patch -r 6::7 sub/
802 changeset: 6:4355d653f84f
802 changeset: 6:4355d653f84f
803 user: test
803 user: test
804 date: Thu Jan 01 00:00:00 1970 +0000
804 date: Thu Jan 01 00:00:00 1970 +0000
805 summary: edit files yet again
805 summary: edit files yet again
806
806
807 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
807 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
808 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
808 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
809 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
809 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
810 @@ -1,1 +1,1 @@
810 @@ -1,1 +1,1 @@
811 -aeb2210d19f02886dde00dac279729a48471e2f9
811 -aeb2210d19f02886dde00dac279729a48471e2f9
812 +971fb41e78fea4f8e0ba5244784239371cb00591
812 +971fb41e78fea4f8e0ba5244784239371cb00591
813 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
813 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
814 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
814 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
815 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
815 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
816 @@ -1,1 +1,1 @@
816 @@ -1,1 +1,1 @@
817 -normal4
817 -normal4
818 +normal44
818 +normal44
819
819
820
820
821 log with both --follow and --patch
821 log with both --follow and --patch
822
822
823 $ hg log --follow --patch --limit 2
823 $ hg log --follow --patch --limit 2
824 changeset: 7:daea875e9014
824 changeset: 7:daea875e9014
825 tag: tip
825 tag: tip
826 user: test
826 user: test
827 date: Thu Jan 01 00:00:00 1970 +0000
827 date: Thu Jan 01 00:00:00 1970 +0000
828 summary: add/edit more largefiles
828 summary: add/edit more largefiles
829
829
830 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
830 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
831 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
831 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
832 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
832 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
833 @@ -1,1 +0,0 @@
833 @@ -1,1 +0,0 @@
834 -7838695e10da2bb75ac1156565f40a2595fa2fa0
834 -7838695e10da2bb75ac1156565f40a2595fa2fa0
835 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
835 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
836 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
836 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
837 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
837 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
838 @@ -0,0 +1,1 @@
838 @@ -0,0 +1,1 @@
839 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
839 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
840 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
840 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
841 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
841 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
842 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
842 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
843 @@ -0,0 +1,1 @@
843 @@ -0,0 +1,1 @@
844 +bb3151689acb10f0c3125c560d5e63df914bc1af
844 +bb3151689acb10f0c3125c560d5e63df914bc1af
845
845
846 changeset: 6:4355d653f84f
846 changeset: 6:4355d653f84f
847 user: test
847 user: test
848 date: Thu Jan 01 00:00:00 1970 +0000
848 date: Thu Jan 01 00:00:00 1970 +0000
849 summary: edit files yet again
849 summary: edit files yet again
850
850
851 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
851 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
852 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
852 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
853 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
853 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
854 @@ -1,1 +1,1 @@
854 @@ -1,1 +1,1 @@
855 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
855 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
856 +7838695e10da2bb75ac1156565f40a2595fa2fa0
856 +7838695e10da2bb75ac1156565f40a2595fa2fa0
857 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
857 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
858 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
858 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
859 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
859 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
860 @@ -1,1 +1,1 @@
860 @@ -1,1 +1,1 @@
861 -aeb2210d19f02886dde00dac279729a48471e2f9
861 -aeb2210d19f02886dde00dac279729a48471e2f9
862 +971fb41e78fea4f8e0ba5244784239371cb00591
862 +971fb41e78fea4f8e0ba5244784239371cb00591
863 diff -r 9d5af5072dbd -r 4355d653f84f normal3
863 diff -r 9d5af5072dbd -r 4355d653f84f normal3
864 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
864 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
865 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
865 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
866 @@ -1,1 +1,1 @@
866 @@ -1,1 +1,1 @@
867 -normal3
867 -normal3
868 +normal33
868 +normal33
869 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
869 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
870 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
870 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
871 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
871 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
872 @@ -1,1 +1,1 @@
872 @@ -1,1 +1,1 @@
873 -normal4
873 -normal4
874 +normal44
874 +normal44
875
875
876 $ hg log --follow --patch sub/large4
876 $ hg log --follow --patch sub/large4
877 changeset: 6:4355d653f84f
877 changeset: 6:4355d653f84f
878 user: test
878 user: test
879 date: Thu Jan 01 00:00:00 1970 +0000
879 date: Thu Jan 01 00:00:00 1970 +0000
880 summary: edit files yet again
880 summary: edit files yet again
881
881
882 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
882 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
883 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
883 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
884 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
884 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
885 @@ -1,1 +1,1 @@
885 @@ -1,1 +1,1 @@
886 -aeb2210d19f02886dde00dac279729a48471e2f9
886 -aeb2210d19f02886dde00dac279729a48471e2f9
887 +971fb41e78fea4f8e0ba5244784239371cb00591
887 +971fb41e78fea4f8e0ba5244784239371cb00591
888
888
889 changeset: 5:9d5af5072dbd
889 changeset: 5:9d5af5072dbd
890 user: test
890 user: test
891 date: Thu Jan 01 00:00:00 1970 +0000
891 date: Thu Jan 01 00:00:00 1970 +0000
892 summary: edit files again
892 summary: edit files again
893
893
894 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
894 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
895 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
895 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
896 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
896 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
897 @@ -1,1 +1,1 @@
897 @@ -1,1 +1,1 @@
898 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
898 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
899 +aeb2210d19f02886dde00dac279729a48471e2f9
899 +aeb2210d19f02886dde00dac279729a48471e2f9
900
900
901 changeset: 4:74c02385b94c
901 changeset: 4:74c02385b94c
902 user: test
902 user: test
903 date: Thu Jan 01 00:00:00 1970 +0000
903 date: Thu Jan 01 00:00:00 1970 +0000
904 summary: move files
904 summary: move files
905
905
906 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
906 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
907 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
907 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
908 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
908 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
909 @@ -0,0 +1,1 @@
909 @@ -0,0 +1,1 @@
910 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
910 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
911
911
912 changeset: 1:ce8896473775
912 changeset: 1:ce8896473775
913 user: test
913 user: test
914 date: Thu Jan 01 00:00:00 1970 +0000
914 date: Thu Jan 01 00:00:00 1970 +0000
915 summary: edit files
915 summary: edit files
916
916
917 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
917 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
918 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
918 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
919 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
919 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
920 @@ -1,1 +1,1 @@
920 @@ -1,1 +1,1 @@
921 -1deebade43c8c498a3c8daddac0244dc55d1331d
921 -1deebade43c8c498a3c8daddac0244dc55d1331d
922 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
922 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
923
923
924 changeset: 0:30d30fe6a5be
924 changeset: 0:30d30fe6a5be
925 user: test
925 user: test
926 date: Thu Jan 01 00:00:00 1970 +0000
926 date: Thu Jan 01 00:00:00 1970 +0000
927 summary: add files
927 summary: add files
928
928
929 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
929 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
930 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
930 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
931 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
931 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
932 @@ -0,0 +1,1 @@
932 @@ -0,0 +1,1 @@
933 +1deebade43c8c498a3c8daddac0244dc55d1331d
933 +1deebade43c8c498a3c8daddac0244dc55d1331d
934
934
935 $ cat sub/normal4
935 $ cat sub/normal4
936 normal44
936 normal44
937 $ cat sub/large4
937 $ cat sub/large4
938 large44
938 large44
939 $ cat sub2/large6
939 $ cat sub2/large6
940 large6
940 large6
941 $ cat sub2/large7
941 $ cat sub2/large7
942 large7
942 large7
943 $ hg log -qf sub2/large7
943 $ hg log -qf sub2/large7
944 7:daea875e9014
944 7:daea875e9014
945 $ hg log -Gqf sub2/large7
945 $ hg log -Gqf sub2/large7
946 @ 7:daea875e9014
946 @ 7:daea875e9014
947 |
947 |
948 ~
948 ~
949 $ cd ..
949 $ cd ..
950
950
951 Test log from outside repo
951 Test log from outside repo
952
952
953 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
953 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
954 6:4355d653f84f edit files yet again
954 6:4355d653f84f edit files yet again
955 5:9d5af5072dbd edit files again
955 5:9d5af5072dbd edit files again
956 4:74c02385b94c move files
956 4:74c02385b94c move files
957 1:ce8896473775 edit files
957 1:ce8896473775 edit files
958 0:30d30fe6a5be add files
958 0:30d30fe6a5be add files
959
959
960 Test clone at revision
960 Test clone at revision
961
961
962 $ hg clone a -r 3 c
962 $ hg clone a -r 3 c
963 adding changesets
963 adding changesets
964 adding manifests
964 adding manifests
965 adding file changes
965 adding file changes
966 added 4 changesets with 10 changes to 4 files
966 added 4 changesets with 10 changes to 4 files
967 new changesets 30d30fe6a5be:9e8fbc4bce62 (4 drafts)
967 new changesets 30d30fe6a5be:9e8fbc4bce62 (4 drafts)
968 updating to branch default
968 updating to branch default
969 getting changed largefiles
969 getting changed largefiles
970 2 largefiles updated, 0 removed
970 2 largefiles updated, 0 removed
971 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
971 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
972 $ cd c
972 $ cd c
973 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
973 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
974 3:9e8fbc4bce62 copy files
974 3:9e8fbc4bce62 copy files
975 2:51a0ae4d5864 remove files
975 2:51a0ae4d5864 remove files
976 1:ce8896473775 edit files
976 1:ce8896473775 edit files
977 0:30d30fe6a5be add files
977 0:30d30fe6a5be add files
978 $ cat normal1
978 $ cat normal1
979 normal22
979 normal22
980 $ cat large1
980 $ cat large1
981 large22
981 large22
982 $ cat sub/normal2
982 $ cat sub/normal2
983 normal22
983 normal22
984 $ cat sub/large2
984 $ cat sub/large2
985 large22
985 large22
986
986
987 Old revisions of a clone have correct largefiles content (this also
987 Old revisions of a clone have correct largefiles content (this also
988 tests update).
988 tests update).
989
989
990 $ hg update -r 1
990 $ hg update -r 1
991 getting changed largefiles
991 getting changed largefiles
992 1 largefiles updated, 0 removed
992 1 largefiles updated, 0 removed
993 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
993 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
994 $ cat large1
994 $ cat large1
995 large11
995 large11
996 $ cat sub/large2
996 $ cat sub/large2
997 large22
997 large22
998 $ cd ..
998 $ cd ..
999
999
1000 Test cloning with --all-largefiles flag
1000 Test cloning with --all-largefiles flag
1001
1001
1002 $ rm "${USERCACHE}"/*
1002 $ rm "${USERCACHE}"/*
1003 $ hg clone --all-largefiles a a-backup
1003 $ hg clone --all-largefiles a a-backup
1004 updating to branch default
1004 updating to branch default
1005 getting changed largefiles
1005 getting changed largefiles
1006 3 largefiles updated, 0 removed
1006 3 largefiles updated, 0 removed
1007 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1008 7 additional largefiles cached
1008 7 additional largefiles cached
1009
1009
1010 $ rm "${USERCACHE}"/*
1010 $ rm "${USERCACHE}"/*
1011 $ hg clone --all-largefiles -u 0 a a-clone0
1011 $ hg clone --all-largefiles -u 0 a a-clone0
1012 updating to branch default
1012 updating to branch default
1013 getting changed largefiles
1013 getting changed largefiles
1014 2 largefiles updated, 0 removed
1014 2 largefiles updated, 0 removed
1015 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1015 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1016 8 additional largefiles cached
1016 8 additional largefiles cached
1017 $ hg -R a-clone0 sum
1017 $ hg -R a-clone0 sum
1018 parent: 0:30d30fe6a5be
1018 parent: 0:30d30fe6a5be
1019 add files
1019 add files
1020 branch: default
1020 branch: default
1021 commit: (clean)
1021 commit: (clean)
1022 update: 7 new changesets (update)
1022 update: 7 new changesets (update)
1023 phases: 8 draft
1023 phases: 8 draft
1024
1024
1025 $ rm "${USERCACHE}"/*
1025 $ rm "${USERCACHE}"/*
1026 $ hg clone --all-largefiles -u 1 a a-clone1
1026 $ hg clone --all-largefiles -u 1 a a-clone1
1027 updating to branch default
1027 updating to branch default
1028 getting changed largefiles
1028 getting changed largefiles
1029 2 largefiles updated, 0 removed
1029 2 largefiles updated, 0 removed
1030 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1030 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1031 8 additional largefiles cached
1031 8 additional largefiles cached
1032 $ hg -R a-clone1 verify --large --lfa --lfc
1032 $ hg -R a-clone1 verify --large --lfa --lfc -q
1033 checking changesets
1034 checking manifests
1035 crosschecking files in changesets and manifests
1036 checking files
1037 checked 8 changesets with 24 changes to 10 files
1038 searching 8 changesets for largefiles
1039 verified contents of 13 revisions of 6 largefiles
1040 $ hg -R a-clone1 sum
1033 $ hg -R a-clone1 sum
1041 parent: 1:ce8896473775
1034 parent: 1:ce8896473775
1042 edit files
1035 edit files
1043 branch: default
1036 branch: default
1044 commit: (clean)
1037 commit: (clean)
1045 update: 6 new changesets (update)
1038 update: 6 new changesets (update)
1046 phases: 8 draft
1039 phases: 8 draft
1047
1040
1048 $ rm "${USERCACHE}"/*
1041 $ rm "${USERCACHE}"/*
1049 $ hg clone --all-largefiles -U a a-clone-u
1042 $ hg clone --all-largefiles -U a a-clone-u
1050 10 additional largefiles cached
1043 10 additional largefiles cached
1051 $ hg -R a-clone-u sum
1044 $ hg -R a-clone-u sum
1052 parent: -1:000000000000 (no revision checked out)
1045 parent: -1:000000000000 (no revision checked out)
1053 branch: default
1046 branch: default
1054 commit: (clean)
1047 commit: (clean)
1055 update: 8 new changesets (update)
1048 update: 8 new changesets (update)
1056 phases: 8 draft
1049 phases: 8 draft
1057
1050
1058 Show computed destination directory:
1051 Show computed destination directory:
1059
1052
1060 $ mkdir xyz
1053 $ mkdir xyz
1061 $ cd xyz
1054 $ cd xyz
1062 $ hg clone ../a
1055 $ hg clone ../a
1063 destination directory: a
1056 destination directory: a
1064 updating to branch default
1057 updating to branch default
1065 getting changed largefiles
1058 getting changed largefiles
1066 3 largefiles updated, 0 removed
1059 3 largefiles updated, 0 removed
1067 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1060 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1068 $ cd ..
1061 $ cd ..
1069
1062
1070 Clone URL without path:
1063 Clone URL without path:
1071
1064
1072 $ hg clone file://
1065 $ hg clone file://
1073 abort: repository / not found
1066 abort: repository / not found
1074 [255]
1067 [255]
1075
1068
1076 Ensure base clone command argument validation
1069 Ensure base clone command argument validation
1077
1070
1078 $ hg clone -U -u 0 a a-clone-failure
1071 $ hg clone -U -u 0 a a-clone-failure
1079 abort: cannot specify both --noupdate and --updaterev
1072 abort: cannot specify both --noupdate and --updaterev
1080 [10]
1073 [10]
1081
1074
1082 $ hg clone --all-largefiles a ssh://localhost/a
1075 $ hg clone --all-largefiles a ssh://localhost/a
1083 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1076 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1084 [255]
1077 [255]
1085
1078
1086 Test pulling with --all-largefiles flag. Also test that the largefiles are
1079 Test pulling with --all-largefiles flag. Also test that the largefiles are
1087 downloaded from 'default' instead of 'default-push' when no source is specified
1080 downloaded from 'default' instead of 'default-push' when no source is specified
1088 (issue3584)
1081 (issue3584)
1089
1082
1090 $ rm -Rf a-backup
1083 $ rm -Rf a-backup
1091 $ hg clone -r 1 a a-backup
1084 $ hg clone -r 1 a a-backup
1092 adding changesets
1085 adding changesets
1093 adding manifests
1086 adding manifests
1094 adding file changes
1087 adding file changes
1095 added 2 changesets with 8 changes to 4 files
1088 added 2 changesets with 8 changes to 4 files
1096 new changesets 30d30fe6a5be:ce8896473775 (2 drafts)
1089 new changesets 30d30fe6a5be:ce8896473775 (2 drafts)
1097 updating to branch default
1090 updating to branch default
1098 getting changed largefiles
1091 getting changed largefiles
1099 2 largefiles updated, 0 removed
1092 2 largefiles updated, 0 removed
1100 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1093 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1101 $ rm "${USERCACHE}"/*
1094 $ rm "${USERCACHE}"/*
1102 $ cd a-backup
1095 $ cd a-backup
1103 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1096 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1104 pulling from $TESTTMP/a
1097 pulling from $TESTTMP/a
1105 searching for changes
1098 searching for changes
1106 adding changesets
1099 adding changesets
1107 adding manifests
1100 adding manifests
1108 adding file changes
1101 adding file changes
1109 added 6 changesets with 16 changes to 8 files
1102 added 6 changesets with 16 changes to 8 files
1110 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1103 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1111 (run 'hg update' to get a working copy)
1104 (run 'hg update' to get a working copy)
1112 6 largefiles cached
1105 6 largefiles cached
1113
1106
1114 redo pull with --lfrev and check it pulls largefiles for the right revs
1107 redo pull with --lfrev and check it pulls largefiles for the right revs
1115
1108
1116 $ hg rollback
1109 $ hg rollback
1117 repository tip rolled back to revision 1 (undo pull)
1110 repository tip rolled back to revision 1 (undo pull)
1118 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1111 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1119 pulling from $TESTTMP/a
1112 pulling from $TESTTMP/a
1120 searching for changes
1113 searching for changes
1121 all local changesets known remotely
1114 all local changesets known remotely
1122 6 changesets found
1115 6 changesets found
1123 uncompressed size of bundle content:
1116 uncompressed size of bundle content:
1124 1389 (changelog)
1117 1389 (changelog)
1125 1698 (manifests)
1118 1698 (manifests)
1126 254 .hglf/large1
1119 254 .hglf/large1
1127 564 .hglf/large3
1120 564 .hglf/large3
1128 572 .hglf/sub/large4
1121 572 .hglf/sub/large4
1129 182 .hglf/sub2/large6
1122 182 .hglf/sub2/large6
1130 182 .hglf/sub2/large7
1123 182 .hglf/sub2/large7
1131 212 normal1
1124 212 normal1
1132 457 normal3
1125 457 normal3
1133 465 sub/normal4
1126 465 sub/normal4
1134 adding changesets
1127 adding changesets
1135 adding manifests
1128 adding manifests
1136 adding file changes
1129 adding file changes
1137 added 6 changesets with 16 changes to 8 files
1130 added 6 changesets with 16 changes to 8 files
1138 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1131 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1139 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1132 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1140 (run 'hg update' to get a working copy)
1133 (run 'hg update' to get a working copy)
1141 pulling largefiles for revision 7
1134 pulling largefiles for revision 7
1142 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1135 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1143 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1136 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1144 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1137 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1145 pulling largefiles for revision 2
1138 pulling largefiles for revision 2
1146 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1139 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1147 0 largefiles cached
1140 0 largefiles cached
1148
1141
1149 lfpull
1142 lfpull
1150
1143
1151 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1144 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1152 2 largefiles cached
1145 2 largefiles cached
1153 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1146 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1154 pulling largefiles for revision 4
1147 pulling largefiles for revision 4
1155 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1148 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1156 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1149 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1157 pulling largefiles for revision 2
1150 pulling largefiles for revision 2
1158 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1151 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1159 0 largefiles cached
1152 0 largefiles cached
1160
1153
1161 $ ls usercache-lfpull/* | sort
1154 $ ls usercache-lfpull/* | sort
1162 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1155 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1163 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1156 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1164
1157
1165 $ cd ..
1158 $ cd ..
1166
1159
1167 Rebasing between two repositories does not revert largefiles to old
1160 Rebasing between two repositories does not revert largefiles to old
1168 revisions (this was a very bad bug that took a lot of work to fix).
1161 revisions (this was a very bad bug that took a lot of work to fix).
1169
1162
1170 $ hg clone a d
1163 $ hg clone a d
1171 updating to branch default
1164 updating to branch default
1172 getting changed largefiles
1165 getting changed largefiles
1173 3 largefiles updated, 0 removed
1166 3 largefiles updated, 0 removed
1174 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1167 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1175 $ cd b
1168 $ cd b
1176 $ echo large4-modified > sub/large4
1169 $ echo large4-modified > sub/large4
1177 $ echo normal3-modified > normal3
1170 $ echo normal3-modified > normal3
1178 $ hg commit -m "modify normal file and largefile in repo b"
1171 $ hg commit -m "modify normal file and largefile in repo b"
1179 Invoking status precommit hook
1172 Invoking status precommit hook
1180 M normal3
1173 M normal3
1181 M sub/large4
1174 M sub/large4
1182 $ cd ../d
1175 $ cd ../d
1183 $ echo large6-modified > sub2/large6
1176 $ echo large6-modified > sub2/large6
1184 $ echo normal4-modified > sub/normal4
1177 $ echo normal4-modified > sub/normal4
1185 $ hg commit -m "modify normal file largefile in repo d"
1178 $ hg commit -m "modify normal file largefile in repo d"
1186 Invoking status precommit hook
1179 Invoking status precommit hook
1187 M sub/normal4
1180 M sub/normal4
1188 M sub2/large6
1181 M sub2/large6
1189 $ cd ..
1182 $ cd ..
1190 $ hg clone d e
1183 $ hg clone d e
1191 updating to branch default
1184 updating to branch default
1192 getting changed largefiles
1185 getting changed largefiles
1193 3 largefiles updated, 0 removed
1186 3 largefiles updated, 0 removed
1194 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1187 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1195 $ cd d
1188 $ cd d
1196
1189
1197 More rebase testing, but also test that the largefiles are downloaded from
1190 More rebase testing, but also test that the largefiles are downloaded from
1198 'default-push' when no source is specified (issue3584). (The largefile from the
1191 'default-push' when no source is specified (issue3584). (The largefile from the
1199 pulled revision is however not downloaded but found in the local cache.)
1192 pulled revision is however not downloaded but found in the local cache.)
1200 Largefiles are fetched for the new pulled revision, not for existing revisions,
1193 Largefiles are fetched for the new pulled revision, not for existing revisions,
1201 rebased or not.
1194 rebased or not.
1202
1195
1203 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1196 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1204 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1197 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1205 pulling from $TESTTMP/b
1198 pulling from $TESTTMP/b
1206 searching for changes
1199 searching for changes
1207 adding changesets
1200 adding changesets
1208 adding manifests
1201 adding manifests
1209 adding file changes
1202 adding file changes
1210 added 1 changesets with 2 changes to 2 files (+1 heads)
1203 added 1 changesets with 2 changes to 2 files (+1 heads)
1211 new changesets a381d2c8c80e (1 drafts)
1204 new changesets a381d2c8c80e (1 drafts)
1212 0 largefiles cached
1205 0 largefiles cached
1213 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1206 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1214 Invoking status precommit hook
1207 Invoking status precommit hook
1215 M sub/normal4
1208 M sub/normal4
1216 M sub2/large6
1209 M sub2/large6
1217 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1210 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1218 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1211 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1219 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1212 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1220 9:598410d3eb9a modify normal file largefile in repo d
1213 9:598410d3eb9a modify normal file largefile in repo d
1221 8:a381d2c8c80e modify normal file and largefile in repo b
1214 8:a381d2c8c80e modify normal file and largefile in repo b
1222 7:daea875e9014 add/edit more largefiles
1215 7:daea875e9014 add/edit more largefiles
1223 6:4355d653f84f edit files yet again
1216 6:4355d653f84f edit files yet again
1224 5:9d5af5072dbd edit files again
1217 5:9d5af5072dbd edit files again
1225 4:74c02385b94c move files
1218 4:74c02385b94c move files
1226 3:9e8fbc4bce62 copy files
1219 3:9e8fbc4bce62 copy files
1227 2:51a0ae4d5864 remove files
1220 2:51a0ae4d5864 remove files
1228 1:ce8896473775 edit files
1221 1:ce8896473775 edit files
1229 0:30d30fe6a5be add files
1222 0:30d30fe6a5be add files
1230 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1223 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1231 @ 9:598410d3eb9a modify normal file largefile in repo d
1224 @ 9:598410d3eb9a modify normal file largefile in repo d
1232 |
1225 |
1233 o 8:a381d2c8c80e modify normal file and largefile in repo b
1226 o 8:a381d2c8c80e modify normal file and largefile in repo b
1234 |
1227 |
1235 o 7:daea875e9014 add/edit more largefiles
1228 o 7:daea875e9014 add/edit more largefiles
1236 |
1229 |
1237 o 6:4355d653f84f edit files yet again
1230 o 6:4355d653f84f edit files yet again
1238 |
1231 |
1239 o 5:9d5af5072dbd edit files again
1232 o 5:9d5af5072dbd edit files again
1240 |
1233 |
1241 o 4:74c02385b94c move files
1234 o 4:74c02385b94c move files
1242 |
1235 |
1243 o 3:9e8fbc4bce62 copy files
1236 o 3:9e8fbc4bce62 copy files
1244 |
1237 |
1245 o 2:51a0ae4d5864 remove files
1238 o 2:51a0ae4d5864 remove files
1246 |
1239 |
1247 o 1:ce8896473775 edit files
1240 o 1:ce8896473775 edit files
1248 |
1241 |
1249 o 0:30d30fe6a5be add files
1242 o 0:30d30fe6a5be add files
1250
1243
1251 $ cat normal3
1244 $ cat normal3
1252 normal3-modified
1245 normal3-modified
1253 $ cat sub/normal4
1246 $ cat sub/normal4
1254 normal4-modified
1247 normal4-modified
1255 $ cat sub/large4
1248 $ cat sub/large4
1256 large4-modified
1249 large4-modified
1257 $ cat sub2/large6
1250 $ cat sub2/large6
1258 large6-modified
1251 large6-modified
1259 $ cat sub2/large7
1252 $ cat sub2/large7
1260 large7
1253 large7
1261 $ cd ../e
1254 $ cd ../e
1262 $ hg pull ../b
1255 $ hg pull ../b
1263 pulling from ../b
1256 pulling from ../b
1264 searching for changes
1257 searching for changes
1265 adding changesets
1258 adding changesets
1266 adding manifests
1259 adding manifests
1267 adding file changes
1260 adding file changes
1268 added 1 changesets with 2 changes to 2 files (+1 heads)
1261 added 1 changesets with 2 changes to 2 files (+1 heads)
1269 new changesets a381d2c8c80e (1 drafts)
1262 new changesets a381d2c8c80e (1 drafts)
1270 (run 'hg heads' to see heads, 'hg merge' to merge)
1263 (run 'hg heads' to see heads, 'hg merge' to merge)
1271 $ hg rebase
1264 $ hg rebase
1272 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1265 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1273 Invoking status precommit hook
1266 Invoking status precommit hook
1274 M sub/normal4
1267 M sub/normal4
1275 M sub2/large6
1268 M sub2/large6
1276 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1269 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1277 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1270 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1278 9:598410d3eb9a modify normal file largefile in repo d
1271 9:598410d3eb9a modify normal file largefile in repo d
1279 8:a381d2c8c80e modify normal file and largefile in repo b
1272 8:a381d2c8c80e modify normal file and largefile in repo b
1280 7:daea875e9014 add/edit more largefiles
1273 7:daea875e9014 add/edit more largefiles
1281 6:4355d653f84f edit files yet again
1274 6:4355d653f84f edit files yet again
1282 5:9d5af5072dbd edit files again
1275 5:9d5af5072dbd edit files again
1283 4:74c02385b94c move files
1276 4:74c02385b94c move files
1284 3:9e8fbc4bce62 copy files
1277 3:9e8fbc4bce62 copy files
1285 2:51a0ae4d5864 remove files
1278 2:51a0ae4d5864 remove files
1286 1:ce8896473775 edit files
1279 1:ce8896473775 edit files
1287 0:30d30fe6a5be add files
1280 0:30d30fe6a5be add files
1288 $ cat normal3
1281 $ cat normal3
1289 normal3-modified
1282 normal3-modified
1290 $ cat sub/normal4
1283 $ cat sub/normal4
1291 normal4-modified
1284 normal4-modified
1292 $ cat sub/large4
1285 $ cat sub/large4
1293 large4-modified
1286 large4-modified
1294 $ cat sub2/large6
1287 $ cat sub2/large6
1295 large6-modified
1288 large6-modified
1296 $ cat sub2/large7
1289 $ cat sub2/large7
1297 large7
1290 large7
1298
1291
1299 Log on largefiles
1292 Log on largefiles
1300
1293
1301 - same output
1294 - same output
1302 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1295 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1303 8:a381d2c8c80e modify normal file and largefile in repo b
1296 8:a381d2c8c80e modify normal file and largefile in repo b
1304 6:4355d653f84f edit files yet again
1297 6:4355d653f84f edit files yet again
1305 5:9d5af5072dbd edit files again
1298 5:9d5af5072dbd edit files again
1306 4:74c02385b94c move files
1299 4:74c02385b94c move files
1307 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1300 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1308 o 8:a381d2c8c80e modify normal file and largefile in repo b
1301 o 8:a381d2c8c80e modify normal file and largefile in repo b
1309 :
1302 :
1310 o 6:4355d653f84f edit files yet again
1303 o 6:4355d653f84f edit files yet again
1311 |
1304 |
1312 o 5:9d5af5072dbd edit files again
1305 o 5:9d5af5072dbd edit files again
1313 |
1306 |
1314 o 4:74c02385b94c move files
1307 o 4:74c02385b94c move files
1315 |
1308 |
1316 ~
1309 ~
1317 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1310 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1318 8:a381d2c8c80e modify normal file and largefile in repo b
1311 8:a381d2c8c80e modify normal file and largefile in repo b
1319 6:4355d653f84f edit files yet again
1312 6:4355d653f84f edit files yet again
1320 5:9d5af5072dbd edit files again
1313 5:9d5af5072dbd edit files again
1321 4:74c02385b94c move files
1314 4:74c02385b94c move files
1322 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1315 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1323 o 8:a381d2c8c80e modify normal file and largefile in repo b
1316 o 8:a381d2c8c80e modify normal file and largefile in repo b
1324 :
1317 :
1325 o 6:4355d653f84f edit files yet again
1318 o 6:4355d653f84f edit files yet again
1326 |
1319 |
1327 o 5:9d5af5072dbd edit files again
1320 o 5:9d5af5072dbd edit files again
1328 |
1321 |
1329 o 4:74c02385b94c move files
1322 o 4:74c02385b94c move files
1330 |
1323 |
1331 ~
1324 ~
1332
1325
1333 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1326 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1334 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1327 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1335 8:a381d2c8c80e modify normal file and largefile in repo b
1328 8:a381d2c8c80e modify normal file and largefile in repo b
1336 6:4355d653f84f edit files yet again
1329 6:4355d653f84f edit files yet again
1337 5:9d5af5072dbd edit files again
1330 5:9d5af5072dbd edit files again
1338 4:74c02385b94c move files
1331 4:74c02385b94c move files
1339 1:ce8896473775 edit files
1332 1:ce8896473775 edit files
1340 0:30d30fe6a5be add files
1333 0:30d30fe6a5be add files
1341 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1334 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1342 o 8:a381d2c8c80e modify normal file and largefile in repo b
1335 o 8:a381d2c8c80e modify normal file and largefile in repo b
1343 :
1336 :
1344 o 6:4355d653f84f edit files yet again
1337 o 6:4355d653f84f edit files yet again
1345 |
1338 |
1346 o 5:9d5af5072dbd edit files again
1339 o 5:9d5af5072dbd edit files again
1347 |
1340 |
1348 o 4:74c02385b94c move files
1341 o 4:74c02385b94c move files
1349 :
1342 :
1350 o 1:ce8896473775 edit files
1343 o 1:ce8896473775 edit files
1351 |
1344 |
1352 o 0:30d30fe6a5be add files
1345 o 0:30d30fe6a5be add files
1353
1346
1354 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1347 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1355 9:598410d3eb9a modify normal file largefile in repo d
1348 9:598410d3eb9a modify normal file largefile in repo d
1356 8:a381d2c8c80e modify normal file and largefile in repo b
1349 8:a381d2c8c80e modify normal file and largefile in repo b
1357 6:4355d653f84f edit files yet again
1350 6:4355d653f84f edit files yet again
1358 5:9d5af5072dbd edit files again
1351 5:9d5af5072dbd edit files again
1359 4:74c02385b94c move files
1352 4:74c02385b94c move files
1360 1:ce8896473775 edit files
1353 1:ce8896473775 edit files
1361 0:30d30fe6a5be add files
1354 0:30d30fe6a5be add files
1362 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1355 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1363 @ 9:598410d3eb9a modify normal file largefile in repo d
1356 @ 9:598410d3eb9a modify normal file largefile in repo d
1364 |
1357 |
1365 o 8:a381d2c8c80e modify normal file and largefile in repo b
1358 o 8:a381d2c8c80e modify normal file and largefile in repo b
1366 :
1359 :
1367 o 6:4355d653f84f edit files yet again
1360 o 6:4355d653f84f edit files yet again
1368 |
1361 |
1369 o 5:9d5af5072dbd edit files again
1362 o 5:9d5af5072dbd edit files again
1370 |
1363 |
1371 o 4:74c02385b94c move files
1364 o 4:74c02385b94c move files
1372 :
1365 :
1373 o 1:ce8896473775 edit files
1366 o 1:ce8896473775 edit files
1374 |
1367 |
1375 o 0:30d30fe6a5be add files
1368 o 0:30d30fe6a5be add files
1376
1369
1377 - globbing gives same result
1370 - globbing gives same result
1378 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1371 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1379 9:598410d3eb9a modify normal file largefile in repo d
1372 9:598410d3eb9a modify normal file largefile in repo d
1380 8:a381d2c8c80e modify normal file and largefile in repo b
1373 8:a381d2c8c80e modify normal file and largefile in repo b
1381 6:4355d653f84f edit files yet again
1374 6:4355d653f84f edit files yet again
1382 5:9d5af5072dbd edit files again
1375 5:9d5af5072dbd edit files again
1383 4:74c02385b94c move files
1376 4:74c02385b94c move files
1384 1:ce8896473775 edit files
1377 1:ce8896473775 edit files
1385 0:30d30fe6a5be add files
1378 0:30d30fe6a5be add files
1386 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1379 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1387 @ 9:598410d3eb9a modify normal file largefile in repo d
1380 @ 9:598410d3eb9a modify normal file largefile in repo d
1388 |
1381 |
1389 o 8:a381d2c8c80e modify normal file and largefile in repo b
1382 o 8:a381d2c8c80e modify normal file and largefile in repo b
1390 :
1383 :
1391 o 6:4355d653f84f edit files yet again
1384 o 6:4355d653f84f edit files yet again
1392 |
1385 |
1393 o 5:9d5af5072dbd edit files again
1386 o 5:9d5af5072dbd edit files again
1394 |
1387 |
1395 o 4:74c02385b94c move files
1388 o 4:74c02385b94c move files
1396 :
1389 :
1397 o 1:ce8896473775 edit files
1390 o 1:ce8896473775 edit files
1398 |
1391 |
1399 o 0:30d30fe6a5be add files
1392 o 0:30d30fe6a5be add files
1400
1393
1401 Rollback on largefiles.
1394 Rollback on largefiles.
1402
1395
1403 $ echo large4-modified-again > sub/large4
1396 $ echo large4-modified-again > sub/large4
1404 $ hg commit -m "Modify large4 again"
1397 $ hg commit -m "Modify large4 again"
1405 Invoking status precommit hook
1398 Invoking status precommit hook
1406 M sub/large4
1399 M sub/large4
1407 $ hg rollback
1400 $ hg rollback
1408 repository tip rolled back to revision 9 (undo commit)
1401 repository tip rolled back to revision 9 (undo commit)
1409 working directory now based on revision 9
1402 working directory now based on revision 9
1410 $ hg st
1403 $ hg st
1411 M sub/large4
1404 M sub/large4
1412 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1405 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1413 9:598410d3eb9a modify normal file largefile in repo d
1406 9:598410d3eb9a modify normal file largefile in repo d
1414 8:a381d2c8c80e modify normal file and largefile in repo b
1407 8:a381d2c8c80e modify normal file and largefile in repo b
1415 7:daea875e9014 add/edit more largefiles
1408 7:daea875e9014 add/edit more largefiles
1416 6:4355d653f84f edit files yet again
1409 6:4355d653f84f edit files yet again
1417 5:9d5af5072dbd edit files again
1410 5:9d5af5072dbd edit files again
1418 4:74c02385b94c move files
1411 4:74c02385b94c move files
1419 3:9e8fbc4bce62 copy files
1412 3:9e8fbc4bce62 copy files
1420 2:51a0ae4d5864 remove files
1413 2:51a0ae4d5864 remove files
1421 1:ce8896473775 edit files
1414 1:ce8896473775 edit files
1422 0:30d30fe6a5be add files
1415 0:30d30fe6a5be add files
1423 $ cat sub/large4
1416 $ cat sub/large4
1424 large4-modified-again
1417 large4-modified-again
1425
1418
1426 "update --check" refuses to update with uncommitted changes.
1419 "update --check" refuses to update with uncommitted changes.
1427 $ hg update --check 8
1420 $ hg update --check 8
1428 abort: uncommitted changes
1421 abort: uncommitted changes
1429 [255]
1422 [255]
1430
1423
1431 "update --clean" leaves correct largefiles in working copy, even when there is
1424 "update --clean" leaves correct largefiles in working copy, even when there is
1432 .orig files from revert in .hglf.
1425 .orig files from revert in .hglf.
1433
1426
1434 $ echo mistake > sub2/large7
1427 $ echo mistake > sub2/large7
1435 $ hg revert sub2/large7
1428 $ hg revert sub2/large7
1436 $ cat sub2/large7
1429 $ cat sub2/large7
1437 large7
1430 large7
1438 $ cat sub2/large7.orig
1431 $ cat sub2/large7.orig
1439 mistake
1432 mistake
1440 $ test ! -f .hglf/sub2/large7.orig
1433 $ test ! -f .hglf/sub2/large7.orig
1441
1434
1442 $ hg -q update --clean -r null
1435 $ hg -q update --clean -r null
1443 $ hg update --clean
1436 $ hg update --clean
1444 getting changed largefiles
1437 getting changed largefiles
1445 3 largefiles updated, 0 removed
1438 3 largefiles updated, 0 removed
1446 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1439 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1447 $ cat normal3
1440 $ cat normal3
1448 normal3-modified
1441 normal3-modified
1449 $ cat sub/normal4
1442 $ cat sub/normal4
1450 normal4-modified
1443 normal4-modified
1451 $ cat sub/large4
1444 $ cat sub/large4
1452 large4-modified
1445 large4-modified
1453 $ cat sub2/large6
1446 $ cat sub2/large6
1454 large6-modified
1447 large6-modified
1455 $ cat sub2/large7
1448 $ cat sub2/large7
1456 large7
1449 large7
1457 $ cat sub2/large7.orig
1450 $ cat sub2/large7.orig
1458 mistake
1451 mistake
1459 $ test ! -f .hglf/sub2/large7.orig
1452 $ test ! -f .hglf/sub2/large7.orig
1460
1453
1461 verify that largefile .orig file no longer is overwritten on every update -C:
1454 verify that largefile .orig file no longer is overwritten on every update -C:
1462 $ hg update --clean
1455 $ hg update --clean
1463 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1456 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1464 $ cat sub2/large7.orig
1457 $ cat sub2/large7.orig
1465 mistake
1458 mistake
1466 $ rm sub2/large7.orig
1459 $ rm sub2/large7.orig
1467
1460
1468 Now "update check" is happy.
1461 Now "update check" is happy.
1469 $ hg update --check 8
1462 $ hg update --check 8
1470 getting changed largefiles
1463 getting changed largefiles
1471 1 largefiles updated, 0 removed
1464 1 largefiles updated, 0 removed
1472 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1465 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1473 $ hg update --check
1466 $ hg update --check
1474 getting changed largefiles
1467 getting changed largefiles
1475 1 largefiles updated, 0 removed
1468 1 largefiles updated, 0 removed
1476 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1469 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1477
1470
1478 Test removing empty largefiles directories on update
1471 Test removing empty largefiles directories on update
1479 $ test -d sub2 && echo "sub2 exists"
1472 $ test -d sub2 && echo "sub2 exists"
1480 sub2 exists
1473 sub2 exists
1481 $ hg update -q null
1474 $ hg update -q null
1482 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1475 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1483 [1]
1476 [1]
1484 $ hg update -q
1477 $ hg update -q
1485
1478
1486 Test hg remove removes empty largefiles directories
1479 Test hg remove removes empty largefiles directories
1487 $ test -d sub2 && echo "sub2 exists"
1480 $ test -d sub2 && echo "sub2 exists"
1488 sub2 exists
1481 sub2 exists
1489 $ hg remove sub2/*
1482 $ hg remove sub2/*
1490 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1483 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1491 [1]
1484 [1]
1492 $ hg revert sub2/large6 sub2/large7
1485 $ hg revert sub2/large6 sub2/large7
1493
1486
1494 "revert" works on largefiles (and normal files too).
1487 "revert" works on largefiles (and normal files too).
1495 $ echo hack3 >> normal3
1488 $ echo hack3 >> normal3
1496 $ echo hack4 >> sub/normal4
1489 $ echo hack4 >> sub/normal4
1497 $ echo hack4 >> sub/large4
1490 $ echo hack4 >> sub/large4
1498 $ rm sub2/large6
1491 $ rm sub2/large6
1499 $ hg revert sub2/large6
1492 $ hg revert sub2/large6
1500 $ hg rm sub2/large6
1493 $ hg rm sub2/large6
1501 $ echo new >> sub2/large8
1494 $ echo new >> sub2/large8
1502 $ hg add --large sub2/large8
1495 $ hg add --large sub2/large8
1503 # XXX we don't really want to report that we're reverting the standin;
1496 # XXX we don't really want to report that we're reverting the standin;
1504 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1497 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1505 $ hg revert sub
1498 $ hg revert sub
1506 reverting .hglf/sub/large4
1499 reverting .hglf/sub/large4
1507 reverting sub/normal4
1500 reverting sub/normal4
1508 $ hg status
1501 $ hg status
1509 M normal3
1502 M normal3
1510 A sub2/large8
1503 A sub2/large8
1511 R sub2/large6
1504 R sub2/large6
1512 ? sub/large4.orig
1505 ? sub/large4.orig
1513 ? sub/normal4.orig
1506 ? sub/normal4.orig
1514 $ cat sub/normal4
1507 $ cat sub/normal4
1515 normal4-modified
1508 normal4-modified
1516 $ cat sub/large4
1509 $ cat sub/large4
1517 large4-modified
1510 large4-modified
1518 $ hg revert -a --no-backup
1511 $ hg revert -a --no-backup
1519 forgetting .hglf/sub2/large8
1512 forgetting .hglf/sub2/large8
1520 reverting normal3
1513 reverting normal3
1521 undeleting .hglf/sub2/large6
1514 undeleting .hglf/sub2/large6
1522 $ hg status
1515 $ hg status
1523 ? sub/large4.orig
1516 ? sub/large4.orig
1524 ? sub/normal4.orig
1517 ? sub/normal4.orig
1525 ? sub2/large8
1518 ? sub2/large8
1526 $ cat normal3
1519 $ cat normal3
1527 normal3-modified
1520 normal3-modified
1528 $ cat sub2/large6
1521 $ cat sub2/large6
1529 large6-modified
1522 large6-modified
1530 $ rm sub/*.orig sub2/large8
1523 $ rm sub/*.orig sub2/large8
1531
1524
1532 revert some files to an older revision
1525 revert some files to an older revision
1533 $ hg revert --no-backup -r 8 sub2
1526 $ hg revert --no-backup -r 8 sub2
1534 reverting .hglf/sub2/large6
1527 reverting .hglf/sub2/large6
1535 $ cat sub2/large6
1528 $ cat sub2/large6
1536 large6
1529 large6
1537 $ hg revert --no-backup -C -r '.^' sub2
1530 $ hg revert --no-backup -C -r '.^' sub2
1538 $ hg revert --no-backup sub2
1531 $ hg revert --no-backup sub2
1539 reverting .hglf/sub2/large6
1532 reverting .hglf/sub2/large6
1540 $ hg status
1533 $ hg status
1541
1534
1542 "verify --large" actually verifies largefiles
1535 "verify --large" actually verifies largefiles
1543
1536
1544 - Where Do We Come From? What Are We? Where Are We Going?
1537 - Where Do We Come From? What Are We? Where Are We Going?
1545 $ pwd
1538 $ pwd
1546 $TESTTMP/e
1539 $TESTTMP/e
1547 $ hg paths
1540 $ hg paths
1548 default = $TESTTMP/d
1541 default = $TESTTMP/d
1549
1542
1550 $ hg verify --large
1543 $ hg verify --large
1551 checking changesets
1544 checking changesets
1552 checking manifests
1545 checking manifests
1553 crosschecking files in changesets and manifests
1546 crosschecking files in changesets and manifests
1554 checking files
1547 checking files
1555 checked 10 changesets with 28 changes to 10 files
1548 checked 10 changesets with 28 changes to 10 files
1556 searching 1 changesets for largefiles
1549 searching 1 changesets for largefiles
1557 verified existence of 3 revisions of 3 largefiles
1550 verified existence of 3 revisions of 3 largefiles
1558
1551
1559 - introduce missing blob in local store repo and remote store
1552 - introduce missing blob in local store repo and remote store
1560 and make sure that this is caught:
1553 and make sure that this is caught:
1561
1554
1562 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1555 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1563 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1556 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1564 $ hg verify --large
1557 $ hg verify --large -q
1565 checking changesets
1566 checking manifests
1567 crosschecking files in changesets and manifests
1568 checking files
1569 checked 10 changesets with 28 changes to 10 files
1570 searching 1 changesets for largefiles
1571 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1558 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1572 verified existence of 3 revisions of 3 largefiles
1573 [1]
1559 [1]
1574
1560
1575 - introduce corruption and make sure that it is caught when checking content:
1561 - introduce corruption and make sure that it is caught when checking content:
1576 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1562 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1577 $ hg verify -q --large --lfc
1563 $ hg verify -q --large --lfc
1578 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1564 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1579 [1]
1565 [1]
1580
1566
1581 - cleanup
1567 - cleanup
1582 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1568 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1583 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1569 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1584
1570
1585 - verifying all revisions will fail because we didn't clone all largefiles to d:
1571 - verifying all revisions will fail because we didn't clone all largefiles to d:
1586 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1572 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1587 $ hg verify -q --lfa --lfc
1573 $ hg verify -q --lfa --lfc
1588 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64
1574 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64
1589 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d
1575 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d
1590 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f
1576 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f
1591 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1577 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1592 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1578 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1593 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1579 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1594 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1580 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1595 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c
1581 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c
1596 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9
1582 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9
1597 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0
1583 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0
1598 [1]
1584 [1]
1599
1585
1600 - cleanup
1586 - cleanup
1601 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1587 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1602 $ rm -f .hglf/sub/*.orig
1588 $ rm -f .hglf/sub/*.orig
1603
1589
1604 Update to revision with missing largefile - and make sure it really is missing
1590 Update to revision with missing largefile - and make sure it really is missing
1605
1591
1606 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1592 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1607 $ hg up -r 6
1593 $ hg up -r 6
1608 getting changed largefiles
1594 getting changed largefiles
1609 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1595 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1610 1 largefiles updated, 2 removed
1596 1 largefiles updated, 2 removed
1611 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1597 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1612 $ rm normal3
1598 $ rm normal3
1613 $ echo >> sub/normal4
1599 $ echo >> sub/normal4
1614 $ hg ci -m 'commit with missing files'
1600 $ hg ci -m 'commit with missing files'
1615 Invoking status precommit hook
1601 Invoking status precommit hook
1616 M sub/normal4
1602 M sub/normal4
1617 ! large3
1603 ! large3
1618 ! normal3
1604 ! normal3
1619 created new head
1605 created new head
1620 $ hg st
1606 $ hg st
1621 ! large3
1607 ! large3
1622 ! normal3
1608 ! normal3
1623 $ hg up -r.
1609 $ hg up -r.
1624 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1610 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1625 $ hg st
1611 $ hg st
1626 ! large3
1612 ! large3
1627 ! normal3
1613 ! normal3
1628 $ hg up -Cr.
1614 $ hg up -Cr.
1629 getting changed largefiles
1615 getting changed largefiles
1630 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1616 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1631 0 largefiles updated, 0 removed
1617 0 largefiles updated, 0 removed
1632 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1618 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1633 $ hg st
1619 $ hg st
1634 ! large3
1620 ! large3
1635 $ hg rollback
1621 $ hg rollback
1636 repository tip rolled back to revision 9 (undo commit)
1622 repository tip rolled back to revision 9 (undo commit)
1637 working directory now based on revision 6
1623 working directory now based on revision 6
1638
1624
1639 Merge with revision with missing largefile - and make sure it tries to fetch it.
1625 Merge with revision with missing largefile - and make sure it tries to fetch it.
1640
1626
1641 $ hg up -Cqr null
1627 $ hg up -Cqr null
1642 $ echo f > f
1628 $ echo f > f
1643 $ hg ci -Am branch
1629 $ hg ci -Am branch
1644 adding f
1630 adding f
1645 Invoking status precommit hook
1631 Invoking status precommit hook
1646 A f
1632 A f
1647 created new head
1633 created new head
1648 $ hg merge -r 6
1634 $ hg merge -r 6
1649 getting changed largefiles
1635 getting changed largefiles
1650 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1636 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1651 1 largefiles updated, 0 removed
1637 1 largefiles updated, 0 removed
1652 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1638 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1653 (branch merge, don't forget to commit)
1639 (branch merge, don't forget to commit)
1654
1640
1655 $ hg rollback -q
1641 $ hg rollback -q
1656 $ hg up -Cq
1642 $ hg up -Cq
1657
1643
1658 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1644 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1659
1645
1660 $ hg pull --all-largefiles
1646 $ hg pull --all-largefiles
1661 pulling from $TESTTMP/d
1647 pulling from $TESTTMP/d
1662 searching for changes
1648 searching for changes
1663 no changes found
1649 no changes found
1664
1650
1665 Merging does not revert to old versions of largefiles and also check
1651 Merging does not revert to old versions of largefiles and also check
1666 that merging after having pulled from a non-default remote works
1652 that merging after having pulled from a non-default remote works
1667 correctly.
1653 correctly.
1668
1654
1669 $ cd ..
1655 $ cd ..
1670 $ hg clone -r 7 e temp
1656 $ hg clone -r 7 e temp
1671 adding changesets
1657 adding changesets
1672 adding manifests
1658 adding manifests
1673 adding file changes
1659 adding file changes
1674 added 8 changesets with 24 changes to 10 files
1660 added 8 changesets with 24 changes to 10 files
1675 new changesets 30d30fe6a5be:daea875e9014 (8 drafts)
1661 new changesets 30d30fe6a5be:daea875e9014 (8 drafts)
1676 updating to branch default
1662 updating to branch default
1677 getting changed largefiles
1663 getting changed largefiles
1678 3 largefiles updated, 0 removed
1664 3 largefiles updated, 0 removed
1679 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1665 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1680 $ hg clone temp f
1666 $ hg clone temp f
1681 updating to branch default
1667 updating to branch default
1682 getting changed largefiles
1668 getting changed largefiles
1683 3 largefiles updated, 0 removed
1669 3 largefiles updated, 0 removed
1684 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1670 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1685 # Delete the largefiles in the largefiles system cache so that we have an
1671 # Delete the largefiles in the largefiles system cache so that we have an
1686 # opportunity to test that caching after a pull works.
1672 # opportunity to test that caching after a pull works.
1687 $ rm "${USERCACHE}"/*
1673 $ rm "${USERCACHE}"/*
1688 $ cd f
1674 $ cd f
1689 $ echo "large4-merge-test" > sub/large4
1675 $ echo "large4-merge-test" > sub/large4
1690 $ hg commit -m "Modify large4 to test merge"
1676 $ hg commit -m "Modify large4 to test merge"
1691 Invoking status precommit hook
1677 Invoking status precommit hook
1692 M sub/large4
1678 M sub/large4
1693 # Test --cache-largefiles flag
1679 # Test --cache-largefiles flag
1694 $ hg pull --lfrev 'heads(pulled())' ../e
1680 $ hg pull --lfrev 'heads(pulled())' ../e
1695 pulling from ../e
1681 pulling from ../e
1696 searching for changes
1682 searching for changes
1697 adding changesets
1683 adding changesets
1698 adding manifests
1684 adding manifests
1699 adding file changes
1685 adding file changes
1700 added 2 changesets with 4 changes to 4 files (+1 heads)
1686 added 2 changesets with 4 changes to 4 files (+1 heads)
1701 new changesets a381d2c8c80e:598410d3eb9a (2 drafts)
1687 new changesets a381d2c8c80e:598410d3eb9a (2 drafts)
1702 (run 'hg heads' to see heads, 'hg merge' to merge)
1688 (run 'hg heads' to see heads, 'hg merge' to merge)
1703 2 largefiles cached
1689 2 largefiles cached
1704 $ hg merge
1690 $ hg merge
1705 largefile sub/large4 has a merge conflict
1691 largefile sub/large4 has a merge conflict
1706 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1692 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1707 you can keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928.
1693 you can keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928.
1708 what do you want to do? l
1694 what do you want to do? l
1709 getting changed largefiles
1695 getting changed largefiles
1710 1 largefiles updated, 0 removed
1696 1 largefiles updated, 0 removed
1711 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1697 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1712 (branch merge, don't forget to commit)
1698 (branch merge, don't forget to commit)
1713 $ hg commit -m "Merge repos e and f"
1699 $ hg commit -m "Merge repos e and f"
1714 Invoking status precommit hook
1700 Invoking status precommit hook
1715 M normal3
1701 M normal3
1716 M sub/normal4
1702 M sub/normal4
1717 M sub2/large6
1703 M sub2/large6
1718 $ cat normal3
1704 $ cat normal3
1719 normal3-modified
1705 normal3-modified
1720 $ cat sub/normal4
1706 $ cat sub/normal4
1721 normal4-modified
1707 normal4-modified
1722 $ cat sub/large4
1708 $ cat sub/large4
1723 large4-merge-test
1709 large4-merge-test
1724 $ cat sub2/large6
1710 $ cat sub2/large6
1725 large6-modified
1711 large6-modified
1726 $ cat sub2/large7
1712 $ cat sub2/large7
1727 large7
1713 large7
1728
1714
1729 Test status after merging with a branch that introduces a new largefile:
1715 Test status after merging with a branch that introduces a new largefile:
1730
1716
1731 $ echo large > large
1717 $ echo large > large
1732 $ hg add --large large
1718 $ hg add --large large
1733 $ hg commit -m 'add largefile'
1719 $ hg commit -m 'add largefile'
1734 Invoking status precommit hook
1720 Invoking status precommit hook
1735 A large
1721 A large
1736 $ hg update -q ".^"
1722 $ hg update -q ".^"
1737 $ echo change >> normal3
1723 $ echo change >> normal3
1738 $ hg commit -m 'some change'
1724 $ hg commit -m 'some change'
1739 Invoking status precommit hook
1725 Invoking status precommit hook
1740 M normal3
1726 M normal3
1741 created new head
1727 created new head
1742 $ hg merge
1728 $ hg merge
1743 getting changed largefiles
1729 getting changed largefiles
1744 1 largefiles updated, 0 removed
1730 1 largefiles updated, 0 removed
1745 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1731 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1746 (branch merge, don't forget to commit)
1732 (branch merge, don't forget to commit)
1747 $ hg status
1733 $ hg status
1748 M large
1734 M large
1749
1735
1750 - make sure update of merge with removed largefiles fails as expected
1736 - make sure update of merge with removed largefiles fails as expected
1751 $ hg rm sub2/large6
1737 $ hg rm sub2/large6
1752 $ hg up -r.
1738 $ hg up -r.
1753 abort: outstanding uncommitted merge
1739 abort: outstanding uncommitted merge
1754 [20]
1740 [20]
1755
1741
1756 - revert should be able to revert files introduced in a pending merge
1742 - revert should be able to revert files introduced in a pending merge
1757 $ hg revert --all -r .
1743 $ hg revert --all -r .
1758 removing .hglf/large
1744 removing .hglf/large
1759 undeleting .hglf/sub2/large6
1745 undeleting .hglf/sub2/large6
1760
1746
1761 Test that a normal file and a largefile with the same name and path cannot
1747 Test that a normal file and a largefile with the same name and path cannot
1762 coexist.
1748 coexist.
1763
1749
1764 $ rm sub2/large7
1750 $ rm sub2/large7
1765 $ echo "largeasnormal" > sub2/large7
1751 $ echo "largeasnormal" > sub2/large7
1766 $ hg add sub2/large7
1752 $ hg add sub2/large7
1767 sub2/large7 already a largefile
1753 sub2/large7 already a largefile
1768
1754
1769 Test that transplanting a largefile change works correctly.
1755 Test that transplanting a largefile change works correctly.
1770
1756
1771 $ cd ..
1757 $ cd ..
1772 $ hg clone -r 8 d g
1758 $ hg clone -r 8 d g
1773 adding changesets
1759 adding changesets
1774 adding manifests
1760 adding manifests
1775 adding file changes
1761 adding file changes
1776 added 9 changesets with 26 changes to 10 files
1762 added 9 changesets with 26 changes to 10 files
1777 new changesets 30d30fe6a5be:a381d2c8c80e (9 drafts)
1763 new changesets 30d30fe6a5be:a381d2c8c80e (9 drafts)
1778 updating to branch default
1764 updating to branch default
1779 getting changed largefiles
1765 getting changed largefiles
1780 3 largefiles updated, 0 removed
1766 3 largefiles updated, 0 removed
1781 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1767 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1782 $ cd g
1768 $ cd g
1783 $ hg transplant -s ../d 598410d3eb9a
1769 $ hg transplant -s ../d 598410d3eb9a
1784 searching for changes
1770 searching for changes
1785 searching for changes
1771 searching for changes
1786 adding changesets
1772 adding changesets
1787 adding manifests
1773 adding manifests
1788 adding file changes
1774 adding file changes
1789 added 1 changesets with 2 changes to 2 files
1775 added 1 changesets with 2 changes to 2 files
1790 new changesets 598410d3eb9a (1 drafts)
1776 new changesets 598410d3eb9a (1 drafts)
1791 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1777 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1792 9:598410d3eb9a modify normal file largefile in repo d
1778 9:598410d3eb9a modify normal file largefile in repo d
1793 8:a381d2c8c80e modify normal file and largefile in repo b
1779 8:a381d2c8c80e modify normal file and largefile in repo b
1794 7:daea875e9014 add/edit more largefiles
1780 7:daea875e9014 add/edit more largefiles
1795 6:4355d653f84f edit files yet again
1781 6:4355d653f84f edit files yet again
1796 5:9d5af5072dbd edit files again
1782 5:9d5af5072dbd edit files again
1797 4:74c02385b94c move files
1783 4:74c02385b94c move files
1798 3:9e8fbc4bce62 copy files
1784 3:9e8fbc4bce62 copy files
1799 2:51a0ae4d5864 remove files
1785 2:51a0ae4d5864 remove files
1800 1:ce8896473775 edit files
1786 1:ce8896473775 edit files
1801 0:30d30fe6a5be add files
1787 0:30d30fe6a5be add files
1802 $ cat normal3
1788 $ cat normal3
1803 normal3-modified
1789 normal3-modified
1804 $ cat sub/normal4
1790 $ cat sub/normal4
1805 normal4-modified
1791 normal4-modified
1806 $ cat sub/large4
1792 $ cat sub/large4
1807 large4-modified
1793 large4-modified
1808 $ cat sub2/large6
1794 $ cat sub2/large6
1809 large6-modified
1795 large6-modified
1810 $ cat sub2/large7
1796 $ cat sub2/large7
1811 large7
1797 large7
1812
1798
1813 Cat a largefile
1799 Cat a largefile
1814 $ hg cat normal3
1800 $ hg cat normal3
1815 normal3-modified
1801 normal3-modified
1816 $ hg cat sub/large4
1802 $ hg cat sub/large4
1817 large4-modified
1803 large4-modified
1818 $ rm "${USERCACHE}"/*
1804 $ rm "${USERCACHE}"/*
1819 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1805 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1820 $ cat cat.out
1806 $ cat cat.out
1821 large4-modified
1807 large4-modified
1822 $ rm cat.out
1808 $ rm cat.out
1823 $ hg cat -r a381d2c8c80e normal3
1809 $ hg cat -r a381d2c8c80e normal3
1824 normal3-modified
1810 normal3-modified
1825 $ hg cat -r '.^' normal3
1811 $ hg cat -r '.^' normal3
1826 normal3-modified
1812 normal3-modified
1827 $ hg cat -r '.^' sub/large4 doesntexist
1813 $ hg cat -r '.^' sub/large4 doesntexist
1828 large4-modified
1814 large4-modified
1829 doesntexist: no such file in rev a381d2c8c80e
1815 doesntexist: no such file in rev a381d2c8c80e
1830 $ hg --cwd sub cat -r '.^' large4
1816 $ hg --cwd sub cat -r '.^' large4
1831 large4-modified
1817 large4-modified
1832 $ hg --cwd sub cat -r '.^' ../normal3
1818 $ hg --cwd sub cat -r '.^' ../normal3
1833 normal3-modified
1819 normal3-modified
1834 Cat a standin
1820 Cat a standin
1835 $ hg cat .hglf/sub/large4
1821 $ hg cat .hglf/sub/large4
1836 e166e74c7303192238d60af5a9c4ce9bef0b7928
1822 e166e74c7303192238d60af5a9c4ce9bef0b7928
1837 $ hg cat .hglf/normal3
1823 $ hg cat .hglf/normal3
1838 .hglf/normal3: no such file in rev 598410d3eb9a
1824 .hglf/normal3: no such file in rev 598410d3eb9a
1839 [1]
1825 [1]
1840
1826
1841 Test that renaming a largefile results in correct output for status
1827 Test that renaming a largefile results in correct output for status
1842
1828
1843 $ hg rename sub/large4 large4-renamed
1829 $ hg rename sub/large4 large4-renamed
1844 $ hg commit -m "test rename output"
1830 $ hg commit -m "test rename output"
1845 Invoking status precommit hook
1831 Invoking status precommit hook
1846 A large4-renamed
1832 A large4-renamed
1847 R sub/large4
1833 R sub/large4
1848 $ cat large4-renamed
1834 $ cat large4-renamed
1849 large4-modified
1835 large4-modified
1850 $ cd sub2
1836 $ cd sub2
1851 $ hg rename large6 large6-renamed
1837 $ hg rename large6 large6-renamed
1852 $ hg st
1838 $ hg st
1853 A sub2/large6-renamed
1839 A sub2/large6-renamed
1854 R sub2/large6
1840 R sub2/large6
1855 $ cd ..
1841 $ cd ..
1856
1842
1857 Test --normal flag
1843 Test --normal flag
1858
1844
1859 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1845 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1860 $ hg add --normal --large new-largefile
1846 $ hg add --normal --large new-largefile
1861 abort: --normal cannot be used with --large
1847 abort: --normal cannot be used with --large
1862 [255]
1848 [255]
1863 $ hg add --normal new-largefile
1849 $ hg add --normal new-largefile
1864 new-largefile: up to 69 MB of RAM may be required to manage this file
1850 new-largefile: up to 69 MB of RAM may be required to manage this file
1865 (use 'hg revert new-largefile' to cancel the pending addition)
1851 (use 'hg revert new-largefile' to cancel the pending addition)
1866 $ hg revert new-largefile
1852 $ hg revert new-largefile
1867 $ hg --config ui.large-file-limit=22M add --normal new-largefile
1853 $ hg --config ui.large-file-limit=22M add --normal new-largefile
1868
1854
1869 Test explicit commit of switch between normal and largefile - make sure both
1855 Test explicit commit of switch between normal and largefile - make sure both
1870 the add and the remove is committed.
1856 the add and the remove is committed.
1871
1857
1872 $ hg up -qC
1858 $ hg up -qC
1873 $ hg forget normal3 large4-renamed
1859 $ hg forget normal3 large4-renamed
1874 $ hg add --large normal3
1860 $ hg add --large normal3
1875 $ hg add large4-renamed
1861 $ hg add large4-renamed
1876 $ hg commit -m 'swap' normal3 large4-renamed
1862 $ hg commit -m 'swap' normal3 large4-renamed
1877 Invoking status precommit hook
1863 Invoking status precommit hook
1878 A large4-renamed
1864 A large4-renamed
1879 A normal3
1865 A normal3
1880 ? new-largefile
1866 ? new-largefile
1881 ? sub2/large6-renamed
1867 ? sub2/large6-renamed
1882 $ hg mani
1868 $ hg mani
1883 .hglf/normal3
1869 .hglf/normal3
1884 .hglf/sub2/large6
1870 .hglf/sub2/large6
1885 .hglf/sub2/large7
1871 .hglf/sub2/large7
1886 large4-renamed
1872 large4-renamed
1887 sub/normal4
1873 sub/normal4
1888
1874
1889 $ cd ..
1875 $ cd ..
1890
1876
1891
1877
1892
1878
@@ -1,378 +1,368
1 Source bundle was generated with the following script:
1 Source bundle was generated with the following script:
2
2
3 # hg init
3 # hg init
4 # echo a > a
4 # echo a > a
5 # ln -s a l
5 # ln -s a l
6 # hg ci -Ama -d'0 0'
6 # hg ci -Ama -d'0 0'
7 # mkdir b
7 # mkdir b
8 # echo a > b/a
8 # echo a > b/a
9 # chmod +x b/a
9 # chmod +x b/a
10 # hg ci -Amb -d'1 0'
10 # hg ci -Amb -d'1 0'
11
11
12 $ hg init
12 $ hg init
13 $ hg unbundle "$TESTDIR/bundles/test-manifest.hg"
13 $ hg unbundle "$TESTDIR/bundles/test-manifest.hg"
14 adding changesets
14 adding changesets
15 adding manifests
15 adding manifests
16 adding file changes
16 adding file changes
17 added 2 changesets with 3 changes to 3 files
17 added 2 changesets with 3 changes to 3 files
18 new changesets b73562a03cfe:5bdc995175ba (2 drafts)
18 new changesets b73562a03cfe:5bdc995175ba (2 drafts)
19 (run 'hg update' to get a working copy)
19 (run 'hg update' to get a working copy)
20
20
21 The next call is expected to return nothing:
21 The next call is expected to return nothing:
22
22
23 $ hg manifest
23 $ hg manifest
24
24
25 $ hg co
25 $ hg co
26 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
27
27
28 $ hg manifest
28 $ hg manifest
29 a
29 a
30 b/a
30 b/a
31 l
31 l
32
32
33 $ hg files -vr .
33 $ hg files -vr .
34 2 a
34 2 a
35 2 x b/a
35 2 x b/a
36 1 l l
36 1 l l
37 $ hg files -r . -X b
37 $ hg files -r . -X b
38 a
38 a
39 l
39 l
40 $ hg files -T '{path} {size} {flags}\n'
40 $ hg files -T '{path} {size} {flags}\n'
41 a 2
41 a 2
42 b/a 2 x
42 b/a 2 x
43 l 1 l
43 l 1 l
44 $ hg files -T '{path} {node|shortest}\n' -r.
44 $ hg files -T '{path} {node|shortest}\n' -r.
45 a 5bdc
45 a 5bdc
46 b/a 5bdc
46 b/a 5bdc
47 l 5bdc
47 l 5bdc
48
48
49 $ hg manifest -v
49 $ hg manifest -v
50 644 a
50 644 a
51 755 * b/a
51 755 * b/a
52 644 @ l
52 644 @ l
53 $ hg manifest -T '{path} {rev}\n'
53 $ hg manifest -T '{path} {rev}\n'
54 a 1
54 a 1
55 b/a 1
55 b/a 1
56 l 1
56 l 1
57
57
58 $ hg manifest --debug
58 $ hg manifest --debug
59 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
59 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
60 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
60 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
61 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
61 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
62
62
63 $ hg manifest -r 0
63 $ hg manifest -r 0
64 a
64 a
65 l
65 l
66
66
67 $ hg manifest -r 1
67 $ hg manifest -r 1
68 a
68 a
69 b/a
69 b/a
70 l
70 l
71
71
72 $ hg manifest -r tip
72 $ hg manifest -r tip
73 a
73 a
74 b/a
74 b/a
75 l
75 l
76
76
77 $ hg manifest tip
77 $ hg manifest tip
78 a
78 a
79 b/a
79 b/a
80 l
80 l
81
81
82 $ hg manifest --all
82 $ hg manifest --all
83 a
83 a
84 b/a
84 b/a
85 l
85 l
86
86
87 The next two calls are expected to abort:
87 The next two calls are expected to abort:
88
88
89 $ hg manifest -r 2
89 $ hg manifest -r 2
90 abort: unknown revision '2'
90 abort: unknown revision '2'
91 [10]
91 [10]
92
92
93 $ hg manifest -r tip tip
93 $ hg manifest -r tip tip
94 abort: please specify just one revision
94 abort: please specify just one revision
95 [10]
95 [10]
96
96
97 Testing the manifest full text cache utility
97 Testing the manifest full text cache utility
98 --------------------------------------------
98 --------------------------------------------
99
99
100 Reminder of the manifest log content
100 Reminder of the manifest log content
101
101
102 $ hg log --debug | grep 'manifest:'
102 $ hg log --debug | grep 'manifest:'
103 manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
103 manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
104 manifest: 0:fce2a30dedad1eef4da95ca1dc0004157aa527cf
104 manifest: 0:fce2a30dedad1eef4da95ca1dc0004157aa527cf
105
105
106 Showing the content of the caches after the above operations
106 Showing the content of the caches after the above operations
107
107
108 $ hg debugmanifestfulltextcache
108 $ hg debugmanifestfulltextcache
109 cache contains 1 manifest entries, in order of most to least recent:
109 cache contains 1 manifest entries, in order of most to least recent:
110 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
110 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
111 total cache data size 157 bytes, on-disk 157 bytes
111 total cache data size 157 bytes, on-disk 157 bytes
112
112
113 (Clearing the cache in case of any content)
113 (Clearing the cache in case of any content)
114
114
115 $ hg debugmanifestfulltextcache --clear
115 $ hg debugmanifestfulltextcache --clear
116
116
117 Adding a new persistent entry in the cache
117 Adding a new persistent entry in the cache
118
118
119 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
119 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
120
120
121 $ hg debugmanifestfulltextcache
121 $ hg debugmanifestfulltextcache
122 cache contains 1 manifest entries, in order of most to least recent:
122 cache contains 1 manifest entries, in order of most to least recent:
123 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
123 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
124 total cache data size 157 bytes, on-disk 157 bytes
124 total cache data size 157 bytes, on-disk 157 bytes
125
125
126 Check we don't duplicated entry (added from the debug command)
126 Check we don't duplicated entry (added from the debug command)
127
127
128 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
128 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
129 $ hg debugmanifestfulltextcache
129 $ hg debugmanifestfulltextcache
130 cache contains 1 manifest entries, in order of most to least recent:
130 cache contains 1 manifest entries, in order of most to least recent:
131 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
131 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
132 total cache data size 157 bytes, on-disk 157 bytes
132 total cache data size 157 bytes, on-disk 157 bytes
133
133
134 Adding a second entry
134 Adding a second entry
135
135
136 $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf
136 $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf
137 $ hg debugmanifestfulltextcache
137 $ hg debugmanifestfulltextcache
138 cache contains 2 manifest entries, in order of most to least recent:
138 cache contains 2 manifest entries, in order of most to least recent:
139 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
139 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
140 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
140 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
141 total cache data size 268 bytes, on-disk 268 bytes
141 total cache data size 268 bytes, on-disk 268 bytes
142
142
143 Accessing the initial entry again, refresh their order
143 Accessing the initial entry again, refresh their order
144
144
145 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
145 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
146 $ hg debugmanifestfulltextcache
146 $ hg debugmanifestfulltextcache
147 cache contains 2 manifest entries, in order of most to least recent:
147 cache contains 2 manifest entries, in order of most to least recent:
148 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
148 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
149 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
149 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
150 total cache data size 268 bytes, on-disk 268 bytes
150 total cache data size 268 bytes, on-disk 268 bytes
151
151
152 Check cache clearing
152 Check cache clearing
153
153
154 $ hg debugmanifestfulltextcache --clear
154 $ hg debugmanifestfulltextcache --clear
155 $ hg debugmanifestfulltextcache
155 $ hg debugmanifestfulltextcache
156 cache empty
156 cache empty
157
157
158 Check adding multiple entry in one go:
158 Check adding multiple entry in one go:
159
159
160 $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
160 $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
161 $ hg debugmanifestfulltextcache
161 $ hg debugmanifestfulltextcache
162 cache contains 2 manifest entries, in order of most to least recent:
162 cache contains 2 manifest entries, in order of most to least recent:
163 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
163 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
164 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
164 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
165 total cache data size 268 bytes, on-disk 268 bytes
165 total cache data size 268 bytes, on-disk 268 bytes
166 $ hg debugmanifestfulltextcache --clear
166 $ hg debugmanifestfulltextcache --clear
167
167
168 Test caching behavior on actual operation
168 Test caching behavior on actual operation
169 -----------------------------------------
169 -----------------------------------------
170
170
171 Make sure we start empty
171 Make sure we start empty
172
172
173 $ hg debugmanifestfulltextcache
173 $ hg debugmanifestfulltextcache
174 cache empty
174 cache empty
175
175
176 Commit should have the new node cached:
176 Commit should have the new node cached:
177
177
178 $ echo a >> b/a
178 $ echo a >> b/a
179 $ hg commit -m 'foo'
179 $ hg commit -m 'foo'
180 $ hg debugmanifestfulltextcache
180 $ hg debugmanifestfulltextcache
181 cache contains 2 manifest entries, in order of most to least recent:
181 cache contains 2 manifest entries, in order of most to least recent:
182 id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes
182 id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes
183 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
183 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
184 total cache data size 314 bytes, on-disk 314 bytes
184 total cache data size 314 bytes, on-disk 314 bytes
185 $ hg log -r 'ancestors(., 1)' --debug | grep 'manifest:'
185 $ hg log -r 'ancestors(., 1)' --debug | grep 'manifest:'
186 manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
186 manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
187 manifest: 2:26b8653b67af8c1a0a0317c4ee8dac50a41fdb65
187 manifest: 2:26b8653b67af8c1a0a0317c4ee8dac50a41fdb65
188
188
189 hg update should warm the cache too
189 hg update should warm the cache too
190
190
191 (force dirstate check to avoid flackiness in manifest order)
191 (force dirstate check to avoid flackiness in manifest order)
192 $ hg debugrebuilddirstate
192 $ hg debugrebuilddirstate
193
193
194 $ hg update 0
194 $ hg update 0
195 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
195 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
196 $ hg debugmanifestfulltextcache
196 $ hg debugmanifestfulltextcache
197 cache contains 3 manifest entries, in order of most to least recent:
197 cache contains 3 manifest entries, in order of most to least recent:
198 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
198 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
199 id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes
199 id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes
200 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
200 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
201 total cache data size 425 bytes, on-disk 425 bytes
201 total cache data size 425 bytes, on-disk 425 bytes
202 $ hg log -r '0' --debug | grep 'manifest:'
202 $ hg log -r '0' --debug | grep 'manifest:'
203 manifest: 0:fce2a30dedad1eef4da95ca1dc0004157aa527cf
203 manifest: 0:fce2a30dedad1eef4da95ca1dc0004157aa527cf
204
204
205 Test file removal (especially with pure). The tests are crafted such that there
205 Test file removal (especially with pure). The tests are crafted such that there
206 will be contiguous spans of existing entries to ensure that is handled properly.
206 will be contiguous spans of existing entries to ensure that is handled properly.
207 (In this case, a.txt, aa.txt and c.txt, cc.txt, and ccc.txt)
207 (In this case, a.txt, aa.txt and c.txt, cc.txt, and ccc.txt)
208
208
209 $ cat > $TESTTMP/manifest.py <<EOF
209 $ cat > $TESTTMP/manifest.py <<EOF
210 > from mercurial import (
210 > from mercurial import (
211 > extensions,
211 > extensions,
212 > manifest,
212 > manifest,
213 > )
213 > )
214 > def extsetup(ui):
214 > def extsetup(ui):
215 > manifest.FASTDELTA_TEXTDIFF_THRESHOLD = 0
215 > manifest.FASTDELTA_TEXTDIFF_THRESHOLD = 0
216 > EOF
216 > EOF
217 $ cat >> $HGRCPATH <<EOF
217 $ cat >> $HGRCPATH <<EOF
218 > [extensions]
218 > [extensions]
219 > manifest = $TESTTMP/manifest.py
219 > manifest = $TESTTMP/manifest.py
220 > EOF
220 > EOF
221
221
222 Pure removes should actually remove all dropped entries
222 Pure removes should actually remove all dropped entries
223
223
224 $ hg init repo
224 $ hg init repo
225 $ cd repo
225 $ cd repo
226 $ echo a > a.txt
226 $ echo a > a.txt
227 $ echo aa > aa.txt
227 $ echo aa > aa.txt
228 $ echo b > b.txt
228 $ echo b > b.txt
229 $ echo c > c.txt
229 $ echo c > c.txt
230 $ echo c > cc.txt
230 $ echo c > cc.txt
231 $ echo c > ccc.txt
231 $ echo c > ccc.txt
232 $ echo b > d.txt
232 $ echo b > d.txt
233 $ echo c > e.txt
233 $ echo c > e.txt
234 $ hg ci -Aqm 'a-e'
234 $ hg ci -Aqm 'a-e'
235
235
236 $ hg rm b.txt d.txt
236 $ hg rm b.txt d.txt
237 $ hg ci -m 'remove b and d'
237 $ hg ci -m 'remove b and d'
238
238
239 $ hg debugdata -m 1
239 $ hg debugdata -m 1
240 a.txt\x00b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (esc)
240 a.txt\x00b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (esc)
241 aa.txt\x00a4bdc161c8fbb523c9a60409603f8710ff49a571 (esc)
241 aa.txt\x00a4bdc161c8fbb523c9a60409603f8710ff49a571 (esc)
242 c.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
242 c.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
243 cc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
243 cc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
244 ccc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
244 ccc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
245 e.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
245 e.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
246
246
247 $ hg up -qC .
247 $ hg up -qC .
248
248
249 $ hg verify
249 $ hg verify -q
250 checking changesets
251 checking manifests
252 crosschecking files in changesets and manifests
253 checking files
254 checked 2 changesets with 8 changes to 8 files
255
250
256 $ hg rollback -q --config ui.rollback=True
251 $ hg rollback -q --config ui.rollback=True
257 $ hg rm b.txt d.txt
252 $ hg rm b.txt d.txt
258 $ echo bb > bb.txt
253 $ echo bb > bb.txt
259
254
260 A mix of adds and removes should remove all dropped entries.
255 A mix of adds and removes should remove all dropped entries.
261
256
262 $ hg ci -Aqm 'remove b and d; add bb'
257 $ hg ci -Aqm 'remove b and d; add bb'
263
258
264 $ hg debugdata -m 1
259 $ hg debugdata -m 1
265 a.txt\x00b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (esc)
260 a.txt\x00b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (esc)
266 aa.txt\x00a4bdc161c8fbb523c9a60409603f8710ff49a571 (esc)
261 aa.txt\x00a4bdc161c8fbb523c9a60409603f8710ff49a571 (esc)
267 bb.txt\x0004c6faf8a9fdd848a5304dfc1704749a374dff44 (esc)
262 bb.txt\x0004c6faf8a9fdd848a5304dfc1704749a374dff44 (esc)
268 c.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
263 c.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
269 cc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
264 cc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
270 ccc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
265 ccc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
271 e.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
266 e.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc)
272
267
273 $ hg verify
268 $ hg verify -q
274 checking changesets
275 checking manifests
276 crosschecking files in changesets and manifests
277 checking files
278 checked 2 changesets with 9 changes to 9 files
279 $ cd ..
269 $ cd ..
280
270
281 Test manifest cache interraction with shares
271 Test manifest cache interraction with shares
282 ============================================
272 ============================================
283
273
284 $ echo '[extensions]' >> $HGRCPATH
274 $ echo '[extensions]' >> $HGRCPATH
285 $ echo 'share=' >> $HGRCPATH
275 $ echo 'share=' >> $HGRCPATH
286
276
287 creating some history
277 creating some history
288
278
289 $ hg init share-source
279 $ hg init share-source
290 $ hg debugbuilddag .+10 -n -R share-source
280 $ hg debugbuilddag .+10 -n -R share-source
291 $ hg log --debug -r . -R share-source | grep 'manifest:'
281 $ hg log --debug -r . -R share-source | grep 'manifest:'
292 manifest: -1:0000000000000000000000000000000000000000
282 manifest: -1:0000000000000000000000000000000000000000
293 $ hg log -r . -R share-source
283 $ hg log -r . -R share-source
294 changeset: -1:000000000000
284 changeset: -1:000000000000
295 user:
285 user:
296 date: Thu Jan 01 00:00:00 1970 +0000
286 date: Thu Jan 01 00:00:00 1970 +0000
297
287
298 $ hg debugmanifestfulltextcache -R share-source
288 $ hg debugmanifestfulltextcache -R share-source
299 cache contains 4 manifest entries, in order of most to least recent:
289 cache contains 4 manifest entries, in order of most to least recent:
300 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
290 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
301 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
291 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
302 id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
292 id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
303 id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
293 id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
304 total cache data size 1.76 KB, on-disk 1.76 KB
294 total cache data size 1.76 KB, on-disk 1.76 KB
305 $ hg -R share-source update 1
295 $ hg -R share-source update 1
306 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
307 $ hg debugmanifestfulltextcache -R share-source
297 $ hg debugmanifestfulltextcache -R share-source
308 cache contains 4 manifest entries, in order of most to least recent:
298 cache contains 4 manifest entries, in order of most to least recent:
309 id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
299 id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
310 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
300 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
311 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
301 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
312 id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
302 id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
313 total cache data size 1.50 KB, on-disk 1.50 KB
303 total cache data size 1.50 KB, on-disk 1.50 KB
314
304
315 making a share out of it. It should have its manifest cache updated
305 making a share out of it. It should have its manifest cache updated
316
306
317 $ hg share share-source share-dest
307 $ hg share share-source share-dest
318 updating working directory
308 updating working directory
319 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
320 $ hg log --debug -r . -R share-dest | grep 'manifest:'
310 $ hg log --debug -r . -R share-dest | grep 'manifest:'
321 manifest: 10:b264454d7033405774b9f353b9b37a082c1a8fba
311 manifest: 10:b264454d7033405774b9f353b9b37a082c1a8fba
322 $ hg debugmanifestfulltextcache -R share-dest
312 $ hg debugmanifestfulltextcache -R share-dest
323 cache contains 1 manifest entries, in order of most to least recent:
313 cache contains 1 manifest entries, in order of most to least recent:
324 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
314 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
325 total cache data size 520 bytes, on-disk 520 bytes
315 total cache data size 520 bytes, on-disk 520 bytes
326
316
327 update on various side should only affect the target share
317 update on various side should only affect the target share
328
318
329 $ hg update -R share-dest 4
319 $ hg update -R share-dest 4
330 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
320 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
331 $ hg log --debug -r . -R share-dest | grep 'manifest:'
321 $ hg log --debug -r . -R share-dest | grep 'manifest:'
332 manifest: 4:d45ead487afec2588272fcec88a25413c0ec7dc8
322 manifest: 4:d45ead487afec2588272fcec88a25413c0ec7dc8
333 $ hg debugmanifestfulltextcache -R share-dest
323 $ hg debugmanifestfulltextcache -R share-dest
334 cache contains 2 manifest entries, in order of most to least recent:
324 cache contains 2 manifest entries, in order of most to least recent:
335 id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
325 id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
336 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
326 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
337 total cache data size 769 bytes, on-disk 769 bytes
327 total cache data size 769 bytes, on-disk 769 bytes
338 $ hg debugmanifestfulltextcache -R share-source
328 $ hg debugmanifestfulltextcache -R share-source
339 cache contains 4 manifest entries, in order of most to least recent:
329 cache contains 4 manifest entries, in order of most to least recent:
340 id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
330 id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
341 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
331 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
342 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
332 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
343 id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
333 id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
344 total cache data size 1.50 KB, on-disk 1.50 KB
334 total cache data size 1.50 KB, on-disk 1.50 KB
345 $ hg update -R share-source 7
335 $ hg update -R share-source 7
346 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
336 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
347 $ hg log --debug -r . -R share-source | grep 'manifest:'
337 $ hg log --debug -r . -R share-source | grep 'manifest:'
348 manifest: 7:7d32499319983d90f97ca02a6c2057a1030bebbb
338 manifest: 7:7d32499319983d90f97ca02a6c2057a1030bebbb
349 $ hg debugmanifestfulltextcache -R share-dest
339 $ hg debugmanifestfulltextcache -R share-dest
350 cache contains 2 manifest entries, in order of most to least recent:
340 cache contains 2 manifest entries, in order of most to least recent:
351 id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
341 id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
352 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
342 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
353 total cache data size 769 bytes, on-disk 769 bytes
343 total cache data size 769 bytes, on-disk 769 bytes
354 $ hg debugmanifestfulltextcache -R share-source
344 $ hg debugmanifestfulltextcache -R share-source
355 cache contains 4 manifest entries, in order of most to least recent:
345 cache contains 4 manifest entries, in order of most to least recent:
356 id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
346 id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
357 id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
347 id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
358 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
348 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
359 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
349 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
360 total cache data size 1.46 KB, on-disk 1.46 KB
350 total cache data size 1.46 KB, on-disk 1.46 KB
361 $ hg update -R share-dest 8
351 $ hg update -R share-dest 8
362 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
352 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 $ hg log --debug -r . -R share-dest | grep 'manifest:'
353 $ hg log --debug -r . -R share-dest | grep 'manifest:'
364 manifest: 8:8de636143b0acc5236cb47ca914bd482d82e6f35
354 manifest: 8:8de636143b0acc5236cb47ca914bd482d82e6f35
365 $ hg debugmanifestfulltextcache -R share-dest
355 $ hg debugmanifestfulltextcache -R share-dest
366 cache contains 3 manifest entries, in order of most to least recent:
356 cache contains 3 manifest entries, in order of most to least recent:
367 id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
357 id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
368 id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
358 id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
369 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
359 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
370 total cache data size 1.17 KB, on-disk 1.17 KB
360 total cache data size 1.17 KB, on-disk 1.17 KB
371 $ hg debugmanifestfulltextcache -R share-source
361 $ hg debugmanifestfulltextcache -R share-source
372 cache contains 4 manifest entries, in order of most to least recent:
362 cache contains 4 manifest entries, in order of most to least recent:
373 id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
363 id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
374 id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
364 id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
375 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
365 id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
376 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
366 id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
377 total cache data size 1.46 KB, on-disk 1.46 KB
367 total cache data size 1.46 KB, on-disk 1.46 KB
378
368
@@ -1,225 +1,220
1 #testcases lfs-on lfs-off
1 #testcases lfs-on lfs-off
2
2
3 #if lfs-on
3 #if lfs-on
4 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
5 > [extensions]
5 > [extensions]
6 > lfs =
6 > lfs =
7 > EOF
7 > EOF
8 #endif
8 #endif
9
9
10 $ . "$TESTDIR/narrow-library.sh"
10 $ . "$TESTDIR/narrow-library.sh"
11
11
12 create full repo
12 create full repo
13
13
14 $ hg init master
14 $ hg init master
15 $ cd master
15 $ cd master
16 $ cat >> .hg/hgrc <<EOF
16 $ cat >> .hg/hgrc <<EOF
17 > [narrow]
17 > [narrow]
18 > serveellipses=True
18 > serveellipses=True
19 > EOF
19 > EOF
20
20
21 $ mkdir inside
21 $ mkdir inside
22 $ echo 1 > inside/f
22 $ echo 1 > inside/f
23 $ mkdir inside2
23 $ mkdir inside2
24 $ echo 1 > inside2/f
24 $ echo 1 > inside2/f
25 $ mkdir outside
25 $ mkdir outside
26 $ echo 1 > outside/f
26 $ echo 1 > outside/f
27 $ hg ci -Aqm 'initial'
27 $ hg ci -Aqm 'initial'
28
28
29 $ echo 2 > inside/f
29 $ echo 2 > inside/f
30 $ hg ci -qm 'inside 2'
30 $ hg ci -qm 'inside 2'
31
31
32 $ echo 2 > inside2/f
32 $ echo 2 > inside2/f
33 $ hg ci -qm 'inside2 2'
33 $ hg ci -qm 'inside2 2'
34
34
35 $ echo 2 > outside/f
35 $ echo 2 > outside/f
36 $ hg ci -qm 'outside 2'
36 $ hg ci -qm 'outside 2'
37
37
38 $ cd ..
38 $ cd ..
39
39
40 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
40 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
41 requesting all changes
41 requesting all changes
42 adding changesets
42 adding changesets
43 adding manifests
43 adding manifests
44 adding file changes
44 adding file changes
45 added 3 changesets with 2 changes to 1 files
45 added 3 changesets with 2 changes to 1 files
46 new changesets *:* (glob)
46 new changesets *:* (glob)
47 updating to branch default
47 updating to branch default
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49
49
50 $ hg clone --narrow ssh://user@dummy/master narrow2 --include inside --include inside2
50 $ hg clone --narrow ssh://user@dummy/master narrow2 --include inside --include inside2
51 requesting all changes
51 requesting all changes
52 adding changesets
52 adding changesets
53 adding manifests
53 adding manifests
54 adding file changes
54 adding file changes
55 added 4 changesets with 4 changes to 2 files
55 added 4 changesets with 4 changes to 2 files
56 new changesets *:* (glob)
56 new changesets *:* (glob)
57 updating to branch default
57 updating to branch default
58 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
59
59
60 Can push to wider repo if change does not affect paths in wider repo that are
60 Can push to wider repo if change does not affect paths in wider repo that are
61 not also in narrower repo
61 not also in narrower repo
62
62
63 $ cd narrow
63 $ cd narrow
64 $ echo 3 > inside/f
64 $ echo 3 > inside/f
65 $ hg ci -m 'inside 3'
65 $ hg ci -m 'inside 3'
66 $ hg push ssh://user@dummy/narrow2
66 $ hg push ssh://user@dummy/narrow2
67 pushing to ssh://user@dummy/narrow2
67 pushing to ssh://user@dummy/narrow2
68 searching for changes
68 searching for changes
69 remote: adding changesets
69 remote: adding changesets
70 remote: adding manifests
70 remote: adding manifests
71 remote: adding file changes
71 remote: adding file changes
72 remote: added 1 changesets with 1 changes to 1 files
72 remote: added 1 changesets with 1 changes to 1 files
73
73
74 Can push to narrower repo if change affects only paths within remote's
74 Can push to narrower repo if change affects only paths within remote's
75 narrow spec
75 narrow spec
76
76
77 $ cd ../narrow2
77 $ cd ../narrow2
78 $ cat >> .hg/hgrc <<EOF
78 $ cat >> .hg/hgrc <<EOF
79 > [narrow]
79 > [narrow]
80 > serveellipses=True
80 > serveellipses=True
81 > EOF
81 > EOF
82 $ hg co -r 'desc("inside 3")'
82 $ hg co -r 'desc("inside 3")'
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 $ echo 4 > inside/f
84 $ echo 4 > inside/f
85 $ hg ci -m 'inside 4'
85 $ hg ci -m 'inside 4'
86 $ hg push ssh://user@dummy/narrow
86 $ hg push ssh://user@dummy/narrow
87 pushing to ssh://user@dummy/narrow
87 pushing to ssh://user@dummy/narrow
88 searching for changes
88 searching for changes
89 remote: adding changesets
89 remote: adding changesets
90 remote: adding manifests
90 remote: adding manifests
91 remote: adding file changes
91 remote: adding file changes
92 remote: added 1 changesets with 1 changes to 1 files
92 remote: added 1 changesets with 1 changes to 1 files
93
93
94 Can push to narrow repo if change affects only paths outside remote's
94 Can push to narrow repo if change affects only paths outside remote's
95 narrow spec
95 narrow spec
96
96
97 $ echo 3 > inside2/f
97 $ echo 3 > inside2/f
98 $ hg ci -m 'inside2 3'
98 $ hg ci -m 'inside2 3'
99 TODO: this should be successful
99 TODO: this should be successful
100 $ hg push ssh://user@dummy/narrow
100 $ hg push ssh://user@dummy/narrow
101 pushing to ssh://user@dummy/narrow
101 pushing to ssh://user@dummy/narrow
102 searching for changes
102 searching for changes
103 remote: adding changesets
103 remote: adding changesets
104 remote: adding manifests
104 remote: adding manifests
105 remote: adding file changes
105 remote: adding file changes
106 remote: transaction abort!
106 remote: transaction abort!
107 remote: rollback completed
107 remote: rollback completed
108 remote: abort: data/inside2/f@4a1aa07735e673e20c00fae80f40dc301ee30616: unknown parent (reporevlogstore !)
108 remote: abort: data/inside2/f@4a1aa07735e673e20c00fae80f40dc301ee30616: unknown parent (reporevlogstore !)
109 remote: abort: data/inside2/f/index@4a1aa07735e6: no node (reposimplestore !)
109 remote: abort: data/inside2/f/index@4a1aa07735e6: no node (reposimplestore !)
110 abort: stream ended unexpectedly (got 0 bytes, expected 4)
110 abort: stream ended unexpectedly (got 0 bytes, expected 4)
111 [255]
111 [255]
112
112
113 Can pull from wider repo if change affects only paths outside remote's
113 Can pull from wider repo if change affects only paths outside remote's
114 narrow spec
114 narrow spec
115 $ echo 4 > inside2/f
115 $ echo 4 > inside2/f
116 $ hg ci -m 'inside2 4'
116 $ hg ci -m 'inside2 4'
117 $ hg log -G -T '{rev} {node|short} {files}\n'
117 $ hg log -G -T '{rev} {node|short} {files}\n'
118 @ 7 d78a96df731d inside2/f
118 @ 7 d78a96df731d inside2/f
119 |
119 |
120 o 6 8c26f5218962 inside2/f
120 o 6 8c26f5218962 inside2/f
121 |
121 |
122 o 5 ba3480e2f9de inside/f
122 o 5 ba3480e2f9de inside/f
123 |
123 |
124 o 4 4e5edd526618 inside/f
124 o 4 4e5edd526618 inside/f
125 |
125 |
126 o 3 81e7e07b7ab0 outside/f
126 o 3 81e7e07b7ab0 outside/f
127 |
127 |
128 o 2 f3993b8c0c2b inside2/f
128 o 2 f3993b8c0c2b inside2/f
129 |
129 |
130 o 1 8cd66ca966b4 inside/f
130 o 1 8cd66ca966b4 inside/f
131 |
131 |
132 o 0 c8057d6f53ab inside/f inside2/f outside/f
132 o 0 c8057d6f53ab inside/f inside2/f outside/f
133
133
134 $ cd ../narrow
134 $ cd ../narrow
135 $ hg log -G -T '{rev} {node|short} {files}\n'
135 $ hg log -G -T '{rev} {node|short} {files}\n'
136 o 4 ba3480e2f9de inside/f
136 o 4 ba3480e2f9de inside/f
137 |
137 |
138 @ 3 4e5edd526618 inside/f
138 @ 3 4e5edd526618 inside/f
139 |
139 |
140 o 2 81e7e07b7ab0 outside/f
140 o 2 81e7e07b7ab0 outside/f
141 |
141 |
142 o 1 8cd66ca966b4 inside/f
142 o 1 8cd66ca966b4 inside/f
143 |
143 |
144 o 0 c8057d6f53ab inside/f inside2/f outside/f
144 o 0 c8057d6f53ab inside/f inside2/f outside/f
145
145
146 $ hg pull ssh://user@dummy/narrow2
146 $ hg pull ssh://user@dummy/narrow2
147 pulling from ssh://user@dummy/narrow2
147 pulling from ssh://user@dummy/narrow2
148 searching for changes
148 searching for changes
149 adding changesets
149 adding changesets
150 adding manifests
150 adding manifests
151 adding file changes
151 adding file changes
152 added 1 changesets with 0 changes to 0 files
152 added 1 changesets with 0 changes to 0 files
153 new changesets d78a96df731d
153 new changesets d78a96df731d
154 (run 'hg update' to get a working copy)
154 (run 'hg update' to get a working copy)
155
155
156 Check that the resulting history is valid in the full repo
156 Check that the resulting history is valid in the full repo
157
157
158 $ cd ../narrow2
158 $ cd ../narrow2
159 $ hg push ssh://user@dummy/master
159 $ hg push ssh://user@dummy/master
160 pushing to ssh://user@dummy/master
160 pushing to ssh://user@dummy/master
161 searching for changes
161 searching for changes
162 remote: adding changesets
162 remote: adding changesets
163 remote: adding manifests
163 remote: adding manifests
164 remote: adding file changes
164 remote: adding file changes
165 remote: added 4 changesets with 4 changes to 2 files
165 remote: added 4 changesets with 4 changes to 2 files
166 $ cd ../master
166 $ cd ../master
167 $ hg verify
167 $ hg verify -q
168 checking changesets
169 checking manifests
170 crosschecking files in changesets and manifests
171 checking files
172 checked 8 changesets with 10 changes to 3 files
173
168
174 Can not push to wider repo if change affects paths in wider repo that are
169 Can not push to wider repo if change affects paths in wider repo that are
175 not also in narrower repo
170 not also in narrower repo
176 $ cd ../master
171 $ cd ../master
177 $ hg co -r 'desc("inside2 4")'
172 $ hg co -r 'desc("inside2 4")'
178 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 $ echo 5 > inside2/f
174 $ echo 5 > inside2/f
180 $ hg ci -m 'inside2 5'
175 $ hg ci -m 'inside2 5'
181 $ hg log -G -T '{rev} {node|short} {files}\n'
176 $ hg log -G -T '{rev} {node|short} {files}\n'
182 @ 8 5970befb64ba inside2/f
177 @ 8 5970befb64ba inside2/f
183 |
178 |
184 o 7 d78a96df731d inside2/f
179 o 7 d78a96df731d inside2/f
185 |
180 |
186 o 6 8c26f5218962 inside2/f
181 o 6 8c26f5218962 inside2/f
187 |
182 |
188 o 5 ba3480e2f9de inside/f
183 o 5 ba3480e2f9de inside/f
189 |
184 |
190 o 4 4e5edd526618 inside/f
185 o 4 4e5edd526618 inside/f
191 |
186 |
192 o 3 81e7e07b7ab0 outside/f
187 o 3 81e7e07b7ab0 outside/f
193 |
188 |
194 o 2 f3993b8c0c2b inside2/f
189 o 2 f3993b8c0c2b inside2/f
195 |
190 |
196 o 1 8cd66ca966b4 inside/f
191 o 1 8cd66ca966b4 inside/f
197 |
192 |
198 o 0 c8057d6f53ab inside/f inside2/f outside/f
193 o 0 c8057d6f53ab inside/f inside2/f outside/f
199
194
200 $ cd ../narrow
195 $ cd ../narrow
201 $ hg pull
196 $ hg pull
202 pulling from ssh://user@dummy/master
197 pulling from ssh://user@dummy/master
203 searching for changes
198 searching for changes
204 adding changesets
199 adding changesets
205 adding manifests
200 adding manifests
206 adding file changes
201 adding file changes
207 added 1 changesets with 0 changes to 0 files
202 added 1 changesets with 0 changes to 0 files
208 new changesets * (glob)
203 new changesets * (glob)
209 (run 'hg update' to get a working copy)
204 (run 'hg update' to get a working copy)
210 TODO: this should tell the user that their narrow clone does not have the
205 TODO: this should tell the user that their narrow clone does not have the
211 necessary content to be able to push to the target
206 necessary content to be able to push to the target
212
207
213 TODO: lfs shouldn't abort like this
208 TODO: lfs shouldn't abort like this
214 $ hg push ssh://user@dummy/narrow2 || true
209 $ hg push ssh://user@dummy/narrow2 || true
215 pushing to ssh://user@dummy/narrow2
210 pushing to ssh://user@dummy/narrow2
216 searching for changes
211 searching for changes
217 remote: adding changesets
212 remote: adding changesets
218 remote: adding manifests
213 remote: adding manifests
219 remote: adding file changes
214 remote: adding file changes
220 remote: added 1 changesets with 0 changes to 0 files (no-lfs-on !)
215 remote: added 1 changesets with 0 changes to 0 files (no-lfs-on !)
221 remote: error: pretxnchangegroup.lfs hook raised an exception: inside2/f@f59b4e0218355383d2789196f1092abcf2262b0c: no match found (lfs-on !)
216 remote: error: pretxnchangegroup.lfs hook raised an exception: inside2/f@f59b4e0218355383d2789196f1092abcf2262b0c: no match found (lfs-on !)
222 remote: transaction abort! (lfs-on !)
217 remote: transaction abort! (lfs-on !)
223 remote: rollback completed (lfs-on !)
218 remote: rollback completed (lfs-on !)
224 remote: abort: inside2/f@f59b4e0218355383d2789196f1092abcf2262b0c: no match found (lfs-on !)
219 remote: abort: inside2/f@f59b4e0218355383d2789196f1092abcf2262b0c: no match found (lfs-on !)
225 abort: stream ended unexpectedly (got 0 bytes, expected 4) (lfs-on !)
220 abort: stream ended unexpectedly (got 0 bytes, expected 4) (lfs-on !)
@@ -1,198 +1,192
1 #testcases flat tree
1 #testcases flat tree
2 #testcases safe normal
2 #testcases safe normal
3
3
4 #if safe
4 #if safe
5 $ echo "[format]" >> $HGRCPATH
5 $ echo "[format]" >> $HGRCPATH
6 $ echo "exp-share-safe = True" >> $HGRCPATH
6 $ echo "exp-share-safe = True" >> $HGRCPATH
7 #endif
7 #endif
8
8
9 $ . "$TESTDIR/narrow-library.sh"
9 $ . "$TESTDIR/narrow-library.sh"
10
10
11 #if tree
11 #if tree
12 $ cat << EOF >> $HGRCPATH
12 $ cat << EOF >> $HGRCPATH
13 > [experimental]
13 > [experimental]
14 > treemanifest = 1
14 > treemanifest = 1
15 > EOF
15 > EOF
16 #endif
16 #endif
17
17
18 $ cat << EOF >> $HGRCPATH
18 $ cat << EOF >> $HGRCPATH
19 > [extensions]
19 > [extensions]
20 > share =
20 > share =
21 > EOF
21 > EOF
22
22
23 $ hg init remote
23 $ hg init remote
24 $ cd remote
24 $ cd remote
25 $ for x in `$TESTDIR/seq.py 0 10`
25 $ for x in `$TESTDIR/seq.py 0 10`
26 > do
26 > do
27 > mkdir d$x
27 > mkdir d$x
28 > echo $x > d$x/f
28 > echo $x > d$x/f
29 > hg add d$x/f
29 > hg add d$x/f
30 > hg commit -m "add d$x/f"
30 > hg commit -m "add d$x/f"
31 > done
31 > done
32 $ cd ..
32 $ cd ..
33
33
34 $ hg clone --narrow ssh://user@dummy/remote main -q \
34 $ hg clone --narrow ssh://user@dummy/remote main -q \
35 > --include d1 --include d3 --include d5 --include d7
35 > --include d1 --include d3 --include d5 --include d7
36
36
37 Ignore file called "ignored"
37 Ignore file called "ignored"
38 $ echo ignored > main/.hgignore
38 $ echo ignored > main/.hgignore
39
39
40 $ hg share main share
40 $ hg share main share
41 updating working directory
41 updating working directory
42 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 $ hg -R share tracked
43 $ hg -R share tracked
44 I path:d1
44 I path:d1
45 I path:d3
45 I path:d3
46 I path:d5
46 I path:d5
47 I path:d7
47 I path:d7
48 $ hg -R share files
48 $ hg -R share files
49 share/d1/f
49 share/d1/f
50 share/d3/f
50 share/d3/f
51 share/d5/f
51 share/d5/f
52 share/d7/f
52 share/d7/f
53
53
54 Narrow the share and check that the main repo's working copy gets updated
54 Narrow the share and check that the main repo's working copy gets updated
55
55
56 # Make sure the files that are supposed to be known-clean get their timestamps set in the dirstate
56 # Make sure the files that are supposed to be known-clean get their timestamps set in the dirstate
57 $ sleep 2
57 $ sleep 2
58 $ hg -R main st
58 $ hg -R main st
59 $ hg -R main debugdirstate --no-dates
59 $ hg -R main debugdirstate --no-dates
60 n 644 2 set d1/f
60 n 644 2 set d1/f
61 n 644 2 set d3/f
61 n 644 2 set d3/f
62 n 644 2 set d5/f
62 n 644 2 set d5/f
63 n 644 2 set d7/f
63 n 644 2 set d7/f
64 # Make d3/f dirty
64 # Make d3/f dirty
65 $ echo x >> main/d3/f
65 $ echo x >> main/d3/f
66 $ echo y >> main/d3/g
66 $ echo y >> main/d3/g
67 $ touch main/d3/ignored
67 $ touch main/d3/ignored
68 $ touch main/d3/untracked
68 $ touch main/d3/untracked
69 $ hg add main/d3/g
69 $ hg add main/d3/g
70 $ hg -R main st
70 $ hg -R main st
71 M d3/f
71 M d3/f
72 A d3/g
72 A d3/g
73 ? d3/untracked
73 ? d3/untracked
74 # Make d5/f not match the dirstate timestamp even though it's clean
74 # Make d5/f not match the dirstate timestamp even though it's clean
75 $ sleep 2
75 $ sleep 2
76 $ hg -R main st
76 $ hg -R main st
77 M d3/f
77 M d3/f
78 A d3/g
78 A d3/g
79 ? d3/untracked
79 ? d3/untracked
80 $ hg -R main debugdirstate --no-dates
80 $ hg -R main debugdirstate --no-dates
81 n 644 2 set d1/f
81 n 644 2 set d1/f
82 n 644 2 set d3/f
82 n 644 2 set d3/f
83 a 0 -1 unset d3/g
83 a 0 -1 unset d3/g
84 n 644 2 set d5/f
84 n 644 2 set d5/f
85 n 644 2 set d7/f
85 n 644 2 set d7/f
86 $ touch main/d5/f
86 $ touch main/d5/f
87 $ hg -R share tracked --removeinclude d1 --removeinclude d3 --removeinclude d5
87 $ hg -R share tracked --removeinclude d1 --removeinclude d3 --removeinclude d5
88 comparing with ssh://user@dummy/remote
88 comparing with ssh://user@dummy/remote
89 searching for changes
89 searching for changes
90 looking for local changes to affected paths
90 looking for local changes to affected paths
91 deleting data/d1/f.i
91 deleting data/d1/f.i
92 deleting data/d3/f.i
92 deleting data/d3/f.i
93 deleting data/d5/f.i
93 deleting data/d5/f.i
94 deleting meta/d1/00manifest.i (tree !)
94 deleting meta/d1/00manifest.i (tree !)
95 deleting meta/d3/00manifest.i (tree !)
95 deleting meta/d3/00manifest.i (tree !)
96 deleting meta/d5/00manifest.i (tree !)
96 deleting meta/d5/00manifest.i (tree !)
97 deleting unwanted files from working copy
97 deleting unwanted files from working copy
98 $ hg -R main tracked
98 $ hg -R main tracked
99 I path:d7
99 I path:d7
100 $ hg -R main files
100 $ hg -R main files
101 abort: working copy's narrowspec is stale
101 abort: working copy's narrowspec is stale
102 (run 'hg tracked --update-working-copy')
102 (run 'hg tracked --update-working-copy')
103 [20]
103 [20]
104 $ hg -R main tracked --update-working-copy
104 $ hg -R main tracked --update-working-copy
105 not deleting possibly dirty file d3/f
105 not deleting possibly dirty file d3/f
106 not deleting possibly dirty file d3/g
106 not deleting possibly dirty file d3/g
107 not deleting possibly dirty file d5/f
107 not deleting possibly dirty file d5/f
108 not deleting unknown file d3/untracked
108 not deleting unknown file d3/untracked
109 not deleting ignored file d3/ignored
109 not deleting ignored file d3/ignored
110 # d1/f, d3/f, d3/g and d5/f should no longer be reported
110 # d1/f, d3/f, d3/g and d5/f should no longer be reported
111 $ hg -R main files
111 $ hg -R main files
112 main/d7/f
112 main/d7/f
113 # d1/f should no longer be there, d3/f should be since it was dirty, d3/g should be there since
113 # d1/f should no longer be there, d3/f should be since it was dirty, d3/g should be there since
114 # it was added, and d5/f should be since we couldn't be sure it was clean
114 # it was added, and d5/f should be since we couldn't be sure it was clean
115 $ find main/d* -type f | sort
115 $ find main/d* -type f | sort
116 main/d3/f
116 main/d3/f
117 main/d3/g
117 main/d3/g
118 main/d3/ignored
118 main/d3/ignored
119 main/d3/untracked
119 main/d3/untracked
120 main/d5/f
120 main/d5/f
121 main/d7/f
121 main/d7/f
122
122
123 Widen the share and check that the main repo's working copy gets updated
123 Widen the share and check that the main repo's working copy gets updated
124
124
125 $ hg -R share tracked --addinclude d1 --addinclude d3 -q
125 $ hg -R share tracked --addinclude d1 --addinclude d3 -q
126 $ hg -R share tracked
126 $ hg -R share tracked
127 I path:d1
127 I path:d1
128 I path:d3
128 I path:d3
129 I path:d7
129 I path:d7
130 $ hg -R share files
130 $ hg -R share files
131 share/d1/f
131 share/d1/f
132 share/d3/f
132 share/d3/f
133 share/d7/f
133 share/d7/f
134 $ hg -R main tracked
134 $ hg -R main tracked
135 I path:d1
135 I path:d1
136 I path:d3
136 I path:d3
137 I path:d7
137 I path:d7
138 $ hg -R main files
138 $ hg -R main files
139 abort: working copy's narrowspec is stale
139 abort: working copy's narrowspec is stale
140 (run 'hg tracked --update-working-copy')
140 (run 'hg tracked --update-working-copy')
141 [20]
141 [20]
142 $ hg -R main tracked --update-working-copy
142 $ hg -R main tracked --update-working-copy
143 # d1/f, d3/f should be back
143 # d1/f, d3/f should be back
144 $ hg -R main files
144 $ hg -R main files
145 main/d1/f
145 main/d1/f
146 main/d3/f
146 main/d3/f
147 main/d7/f
147 main/d7/f
148 # d3/f should be modified (not clobbered by the widening), and d3/g should be untracked
148 # d3/f should be modified (not clobbered by the widening), and d3/g should be untracked
149 $ hg -R main st --all
149 $ hg -R main st --all
150 M d3/f
150 M d3/f
151 ? d3/g
151 ? d3/g
152 ? d3/untracked
152 ? d3/untracked
153 I d3/ignored
153 I d3/ignored
154 C d1/f
154 C d1/f
155 C d7/f
155 C d7/f
156
156
157 We should also be able to unshare without breaking everything:
157 We should also be able to unshare without breaking everything:
158
158
159 $ hg share main share-unshare
159 $ hg share main share-unshare
160 updating working directory
160 updating working directory
161 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 $ cd share-unshare
162 $ cd share-unshare
163 $ hg unshare
163 $ hg unshare
164 $ hg verify
164 $ hg verify -q
165 checking changesets
166 checking manifests
167 checking directory manifests (tree !)
168 crosschecking files in changesets and manifests
169 checking files
170 checked 11 changesets with 3 changes to 3 files
171 $ cd ..
165 $ cd ..
172
166
173 Dirstate should be left alone when upgrading from version of hg that didn't support narrow+share
167 Dirstate should be left alone when upgrading from version of hg that didn't support narrow+share
174
168
175 $ hg share main share-upgrade
169 $ hg share main share-upgrade
176 updating working directory
170 updating working directory
177 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
178 $ cd share-upgrade
172 $ cd share-upgrade
179 $ echo x >> d1/f
173 $ echo x >> d1/f
180 $ echo y >> d3/g
174 $ echo y >> d3/g
181 $ hg add d3/g
175 $ hg add d3/g
182 $ hg rm d7/f
176 $ hg rm d7/f
183 $ hg st
177 $ hg st
184 M d1/f
178 M d1/f
185 A d3/g
179 A d3/g
186 R d7/f
180 R d7/f
187 Make it look like a repo from before narrow+share was supported
181 Make it look like a repo from before narrow+share was supported
188 $ rm .hg/narrowspec.dirstate
182 $ rm .hg/narrowspec.dirstate
189 $ hg ci -Am test
183 $ hg ci -Am test
190 abort: working copy's narrowspec is stale
184 abort: working copy's narrowspec is stale
191 (run 'hg tracked --update-working-copy')
185 (run 'hg tracked --update-working-copy')
192 [20]
186 [20]
193 $ hg tracked --update-working-copy
187 $ hg tracked --update-working-copy
194 $ hg st
188 $ hg st
195 M d1/f
189 M d1/f
196 A d3/g
190 A d3/g
197 R d7/f
191 R d7/f
198 $ cd ..
192 $ cd ..
@@ -1,426 +1,414
1 #testcases tree flat
1 #testcases tree flat
2 $ . "$TESTDIR/narrow-library.sh"
2 $ . "$TESTDIR/narrow-library.sh"
3
3
4 #if tree
4 #if tree
5 $ cat << EOF >> $HGRCPATH
5 $ cat << EOF >> $HGRCPATH
6 > [experimental]
6 > [experimental]
7 > treemanifest = 1
7 > treemanifest = 1
8 > EOF
8 > EOF
9 #endif
9 #endif
10
10
11 $ hg init master
11 $ hg init master
12 $ cd master
12 $ cd master
13
13
14 $ mkdir inside
14 $ mkdir inside
15 $ echo 'inside' > inside/f
15 $ echo 'inside' > inside/f
16 $ hg add inside/f
16 $ hg add inside/f
17 $ hg commit -m 'add inside'
17 $ hg commit -m 'add inside'
18
18
19 $ mkdir widest
19 $ mkdir widest
20 $ echo 'widest' > widest/f
20 $ echo 'widest' > widest/f
21 $ hg add widest/f
21 $ hg add widest/f
22 $ hg commit -m 'add widest'
22 $ hg commit -m 'add widest'
23
23
24 $ mkdir outside
24 $ mkdir outside
25 $ echo 'outside' > outside/f
25 $ echo 'outside' > outside/f
26 $ hg add outside/f
26 $ hg add outside/f
27 $ hg commit -m 'add outside'
27 $ hg commit -m 'add outside'
28
28
29 $ cd ..
29 $ cd ..
30
30
31 narrow clone the inside file
31 narrow clone the inside file
32
32
33 $ hg clone --narrow ssh://user@dummy/master narrow
33 $ hg clone --narrow ssh://user@dummy/master narrow
34 requesting all changes
34 requesting all changes
35 adding changesets
35 adding changesets
36 adding manifests
36 adding manifests
37 adding file changes
37 adding file changes
38 added 3 changesets with 0 changes to 0 files
38 added 3 changesets with 0 changes to 0 files
39 new changesets *:* (glob)
39 new changesets *:* (glob)
40 updating to branch default
40 updating to branch default
41 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
41 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 $ cd narrow
42 $ cd narrow
43 $ hg tracked
43 $ hg tracked
44 $ hg files
44 $ hg files
45 [1]
45 [1]
46
46
47 widen from an empty clone
47 widen from an empty clone
48
48
49 $ hg tracked --addinclude inside
49 $ hg tracked --addinclude inside
50 comparing with ssh://user@dummy/master
50 comparing with ssh://user@dummy/master
51 searching for changes
51 searching for changes
52 adding changesets
52 adding changesets
53 adding manifests
53 adding manifests
54 adding file changes
54 adding file changes
55 added 0 changesets with 1 changes to 1 files
55 added 0 changesets with 1 changes to 1 files
56 $ hg tracked
56 $ hg tracked
57 I path:inside
57 I path:inside
58 $ ls -A
58 $ ls -A
59 .hg
59 .hg
60 inside
60 inside
61 $ cat inside/f
61 $ cat inside/f
62 inside
62 inside
63 $ cd ..
63 $ cd ..
64
64
65 add more upstream files which we will include in a wider narrow spec
65 add more upstream files which we will include in a wider narrow spec
66
66
67 $ cd master
67 $ cd master
68
68
69 $ mkdir wider
69 $ mkdir wider
70 $ echo 'wider' > wider/f
70 $ echo 'wider' > wider/f
71 $ hg add wider/f
71 $ hg add wider/f
72 $ echo 'widest v2' > widest/f
72 $ echo 'widest v2' > widest/f
73 $ hg commit -m 'add wider, update widest'
73 $ hg commit -m 'add wider, update widest'
74
74
75 $ echo 'widest v3' > widest/f
75 $ echo 'widest v3' > widest/f
76 $ hg commit -m 'update widest v3'
76 $ hg commit -m 'update widest v3'
77
77
78 $ echo 'inside v2' > inside/f
78 $ echo 'inside v2' > inside/f
79 $ hg commit -m 'update inside'
79 $ hg commit -m 'update inside'
80
80
81 $ mkdir outside2
81 $ mkdir outside2
82 $ echo 'outside2' > outside2/f
82 $ echo 'outside2' > outside2/f
83 $ hg add outside2/f
83 $ hg add outside2/f
84 $ hg commit -m 'add outside2'
84 $ hg commit -m 'add outside2'
85
85
86 $ echo 'widest v4' > widest/f
86 $ echo 'widest v4' > widest/f
87 $ hg commit -m 'update widest v4'
87 $ hg commit -m 'update widest v4'
88
88
89 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
89 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
90 7: update widest v4
90 7: update widest v4
91 6: add outside2
91 6: add outside2
92 5: update inside
92 5: update inside
93 4: update widest v3
93 4: update widest v3
94 3: add wider, update widest
94 3: add wider, update widest
95 2: add outside
95 2: add outside
96 1: add widest
96 1: add widest
97 0: add inside
97 0: add inside
98
98
99 $ cd ..
99 $ cd ..
100
100
101 Widen the narrow spec to see the widest file. This should not get the newly
101 Widen the narrow spec to see the widest file. This should not get the newly
102 added upstream revisions.
102 added upstream revisions.
103
103
104 $ cd narrow
104 $ cd narrow
105 $ hg id -n
105 $ hg id -n
106 2
106 2
107
107
108 $ hg tracked --addinclude widest/f --debug
108 $ hg tracked --addinclude widest/f --debug
109 comparing with ssh://user@dummy/master
109 comparing with ssh://user@dummy/master
110 running * "*dummyssh" *user@dummy* *hg -R master serve --stdio* (glob)
110 running * "*dummyssh" *user@dummy* *hg -R master serve --stdio* (glob)
111 sending hello command
111 sending hello command
112 sending between command
112 sending between command
113 remote: * (glob)
113 remote: * (glob)
114 remote: capabilities: * (glob)
114 remote: capabilities: * (glob)
115 remote: 1
115 remote: 1
116 sending protocaps command
116 sending protocaps command
117 query 1; heads
117 query 1; heads
118 sending batch command
118 sending batch command
119 searching for changes
119 searching for changes
120 all local changesets known remotely
120 all local changesets known remotely
121 sending narrow_widen command
121 sending narrow_widen command
122 bundle2-input-bundle: with-transaction
122 bundle2-input-bundle: with-transaction
123 bundle2-input-part: "changegroup" (params: * mandatory) supported (glob)
123 bundle2-input-part: "changegroup" (params: * mandatory) supported (glob)
124 adding changesets
124 adding changesets
125 adding manifests
125 adding manifests
126 adding widest/ revisions (tree !)
126 adding widest/ revisions (tree !)
127 adding file changes
127 adding file changes
128 adding widest/f revisions
128 adding widest/f revisions
129 bundle2-input-part: total payload size * (glob)
129 bundle2-input-part: total payload size * (glob)
130 bundle2-input-bundle: 1 parts total
130 bundle2-input-bundle: 1 parts total
131 added 0 changesets with 1 changes to 1 files
131 added 0 changesets with 1 changes to 1 files
132 widest/f: narrowspec updated -> g
132 widest/f: narrowspec updated -> g
133 getting widest/f
133 getting widest/f
134 $ hg tracked
134 $ hg tracked
135 I path:inside
135 I path:inside
136 I path:widest/f
136 I path:widest/f
137
137
138 $ cat widest/f
138 $ cat widest/f
139 widest
139 widest
140
140
141 $ hg id -n
141 $ hg id -n
142 2
142 2
143
143
144 Test that extending already included files should not call narrow_widen
144 Test that extending already included files should not call narrow_widen
145 wireprotocol command
145 wireprotocol command
146
146
147 $ hg tracked --addinclude widest/f
147 $ hg tracked --addinclude widest/f
148 nothing to widen or narrow
148 nothing to widen or narrow
149
149
150 Pull down the newly added upstream revision.
150 Pull down the newly added upstream revision.
151
151
152 $ hg pull
152 $ hg pull
153 pulling from ssh://user@dummy/master
153 pulling from ssh://user@dummy/master
154 searching for changes
154 searching for changes
155 adding changesets
155 adding changesets
156 adding manifests
156 adding manifests
157 adding file changes
157 adding file changes
158 added 5 changesets with 4 changes to 2 files
158 added 5 changesets with 4 changes to 2 files
159 new changesets *:* (glob)
159 new changesets *:* (glob)
160 (run 'hg update' to get a working copy)
160 (run 'hg update' to get a working copy)
161 $ hg update -r 'desc("add wider")'
161 $ hg update -r 'desc("add wider")'
162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
163
163
164 $ cat widest/f
164 $ cat widest/f
165 widest v2
165 widest v2
166
166
167 $ hg update -r 'desc("update inside")'
167 $ hg update -r 'desc("update inside")'
168 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 $ cat widest/f
169 $ cat widest/f
170 widest v3
170 widest v3
171 $ cat inside/f
171 $ cat inside/f
172 inside v2
172 inside v2
173
173
174 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
174 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
175 7: update widest v4
175 7: update widest v4
176 6: add outside2
176 6: add outside2
177 5: update inside
177 5: update inside
178 4: update widest v3
178 4: update widest v3
179 3: add wider, update widest
179 3: add wider, update widest
180 2: add outside
180 2: add outside
181 1: add widest
181 1: add widest
182 0: add inside
182 0: add inside
183
183
184 Check that widening with a newline fails
184 Check that widening with a newline fails
185
185
186 $ hg tracked --addinclude 'widest
186 $ hg tracked --addinclude 'widest
187 > '
187 > '
188 abort: newlines are not allowed in narrowspec paths
188 abort: newlines are not allowed in narrowspec paths
189 [255]
189 [255]
190
190
191 widen the narrow spec to include the wider file
191 widen the narrow spec to include the wider file
192
192
193 $ hg tracked --addinclude wider
193 $ hg tracked --addinclude wider
194 comparing with ssh://user@dummy/master
194 comparing with ssh://user@dummy/master
195 searching for changes
195 searching for changes
196 adding changesets
196 adding changesets
197 adding manifests
197 adding manifests
198 adding file changes
198 adding file changes
199 added 0 changesets with 1 changes to 1 files
199 added 0 changesets with 1 changes to 1 files
200 $ hg tracked
200 $ hg tracked
201 I path:inside
201 I path:inside
202 I path:wider
202 I path:wider
203 I path:widest/f
203 I path:widest/f
204 $ hg update 'desc("add widest")'
204 $ hg update 'desc("add widest")'
205 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
205 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
206 $ cat widest/f
206 $ cat widest/f
207 widest
207 widest
208 $ hg update 'desc("add wider, update widest")'
208 $ hg update 'desc("add wider, update widest")'
209 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 $ cat wider/f
210 $ cat wider/f
211 wider
211 wider
212 $ cat widest/f
212 $ cat widest/f
213 widest v2
213 widest v2
214 $ hg update 'desc("update widest v3")'
214 $ hg update 'desc("update widest v3")'
215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 $ cat widest/f
216 $ cat widest/f
217 widest v3
217 widest v3
218 $ hg update 'desc("update widest v4")'
218 $ hg update 'desc("update widest v4")'
219 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 $ cat widest/f
220 $ cat widest/f
221 widest v4
221 widest v4
222
222
223 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
223 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
224 7: update widest v4
224 7: update widest v4
225 6: add outside2
225 6: add outside2
226 5: update inside
226 5: update inside
227 4: update widest v3
227 4: update widest v3
228 3: add wider, update widest
228 3: add wider, update widest
229 2: add outside
229 2: add outside
230 1: add widest
230 1: add widest
231 0: add inside
231 0: add inside
232
232
233 separate suite of tests: files from 0-10 modified in changes 0-10. This allows
233 separate suite of tests: files from 0-10 modified in changes 0-10. This allows
234 more obvious precise tests tickling particular corner cases.
234 more obvious precise tests tickling particular corner cases.
235
235
236 $ cd ..
236 $ cd ..
237 $ hg init upstream
237 $ hg init upstream
238 $ cd upstream
238 $ cd upstream
239 $ for x in `$TESTDIR/seq.py 0 10`
239 $ for x in `$TESTDIR/seq.py 0 10`
240 > do
240 > do
241 > mkdir d$x
241 > mkdir d$x
242 > echo $x > d$x/f
242 > echo $x > d$x/f
243 > hg add d$x/f
243 > hg add d$x/f
244 > hg commit -m "add d$x/f"
244 > hg commit -m "add d$x/f"
245 > done
245 > done
246 $ hg log -T "{rev}: {desc}\n"
246 $ hg log -T "{rev}: {desc}\n"
247 10: add d10/f
247 10: add d10/f
248 9: add d9/f
248 9: add d9/f
249 8: add d8/f
249 8: add d8/f
250 7: add d7/f
250 7: add d7/f
251 6: add d6/f
251 6: add d6/f
252 5: add d5/f
252 5: add d5/f
253 4: add d4/f
253 4: add d4/f
254 3: add d3/f
254 3: add d3/f
255 2: add d2/f
255 2: add d2/f
256 1: add d1/f
256 1: add d1/f
257 0: add d0/f
257 0: add d0/f
258
258
259 make narrow clone with every third node.
259 make narrow clone with every third node.
260
260
261 $ cd ..
261 $ cd ..
262 $ hg clone --narrow ssh://user@dummy/upstream narrow2 --include d0 --include d3 --include d6 --include d9
262 $ hg clone --narrow ssh://user@dummy/upstream narrow2 --include d0 --include d3 --include d6 --include d9
263 requesting all changes
263 requesting all changes
264 adding changesets
264 adding changesets
265 adding manifests
265 adding manifests
266 adding file changes
266 adding file changes
267 added 11 changesets with 4 changes to 4 files
267 added 11 changesets with 4 changes to 4 files
268 new changesets *:* (glob)
268 new changesets *:* (glob)
269 updating to branch default
269 updating to branch default
270 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 $ cd narrow2
271 $ cd narrow2
272 $ hg tracked
272 $ hg tracked
273 I path:d0
273 I path:d0
274 I path:d3
274 I path:d3
275 I path:d6
275 I path:d6
276 I path:d9
276 I path:d9
277 $ hg verify
277 $ hg verify -q
278 checking changesets
279 checking manifests
280 checking directory manifests (tree !)
281 crosschecking files in changesets and manifests
282 checking files
283 checked 11 changesets with 4 changes to 4 files
284 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
278 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
285 10: add d10/f
279 10: add d10/f
286 9: add d9/f
280 9: add d9/f
287 8: add d8/f
281 8: add d8/f
288 7: add d7/f
282 7: add d7/f
289 6: add d6/f
283 6: add d6/f
290 5: add d5/f
284 5: add d5/f
291 4: add d4/f
285 4: add d4/f
292 3: add d3/f
286 3: add d3/f
293 2: add d2/f
287 2: add d2/f
294 1: add d1/f
288 1: add d1/f
295 0: add d0/f
289 0: add d0/f
296 $ hg tracked --addinclude d1
290 $ hg tracked --addinclude d1
297 comparing with ssh://user@dummy/upstream
291 comparing with ssh://user@dummy/upstream
298 searching for changes
292 searching for changes
299 adding changesets
293 adding changesets
300 adding manifests
294 adding manifests
301 adding file changes
295 adding file changes
302 added 0 changesets with 1 changes to 1 files
296 added 0 changesets with 1 changes to 1 files
303 $ hg tracked
297 $ hg tracked
304 I path:d0
298 I path:d0
305 I path:d1
299 I path:d1
306 I path:d3
300 I path:d3
307 I path:d6
301 I path:d6
308 I path:d9
302 I path:d9
309 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
303 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
310 10: add d10/f
304 10: add d10/f
311 9: add d9/f
305 9: add d9/f
312 8: add d8/f
306 8: add d8/f
313 7: add d7/f
307 7: add d7/f
314 6: add d6/f
308 6: add d6/f
315 5: add d5/f
309 5: add d5/f
316 4: add d4/f
310 4: add d4/f
317 3: add d3/f
311 3: add d3/f
318 2: add d2/f
312 2: add d2/f
319 1: add d1/f
313 1: add d1/f
320 0: add d0/f
314 0: add d0/f
321
315
322 Verify shouldn't claim the repo is corrupt after a widen.
316 Verify shouldn't claim the repo is corrupt after a widen.
323
317
324 $ hg verify
318 $ hg verify -q
325 checking changesets
326 checking manifests
327 checking directory manifests (tree !)
328 crosschecking files in changesets and manifests
329 checking files
330 checked 11 changesets with 5 changes to 5 files
331
319
332 Widening preserves parent of local commit
320 Widening preserves parent of local commit
333
321
334 $ cd ..
322 $ cd ..
335 $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2
323 $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2
336 $ cd narrow3
324 $ cd narrow3
337 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
325 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
338 2: add d2/f
326 2: add d2/f
339 1: add d1/f
327 1: add d1/f
340 0: add d0/f
328 0: add d0/f
341 $ hg pull -q -r 3
329 $ hg pull -q -r 3
342 $ hg co -q tip
330 $ hg co -q tip
343 $ hg pull -q -r 4
331 $ hg pull -q -r 4
344 $ echo local > d2/f
332 $ echo local > d2/f
345 $ hg ci -m local
333 $ hg ci -m local
346 created new head
334 created new head
347 $ hg tracked -q --addinclude d0 --addinclude d9
335 $ hg tracked -q --addinclude d0 --addinclude d9
348
336
349 Widening preserves bookmarks
337 Widening preserves bookmarks
350
338
351 $ cd ..
339 $ cd ..
352 $ hg clone -q --narrow ssh://user@dummy/upstream narrow-bookmarks --include d4
340 $ hg clone -q --narrow ssh://user@dummy/upstream narrow-bookmarks --include d4
353 $ cd narrow-bookmarks
341 $ cd narrow-bookmarks
354 $ echo local > d4/f
342 $ echo local > d4/f
355 $ hg ci -m local
343 $ hg ci -m local
356 $ hg bookmarks bookmark
344 $ hg bookmarks bookmark
357 $ hg bookmarks
345 $ hg bookmarks
358 * bookmark 11:* (glob)
346 * bookmark 11:* (glob)
359 $ hg -q tracked --addinclude d2
347 $ hg -q tracked --addinclude d2
360 $ hg bookmarks
348 $ hg bookmarks
361 * bookmark 11:* (glob)
349 * bookmark 11:* (glob)
362 $ hg log -r bookmark -T '{desc}\n'
350 $ hg log -r bookmark -T '{desc}\n'
363 local
351 local
364
352
365 Widening that fails can be recovered from
353 Widening that fails can be recovered from
366
354
367 $ cd ..
355 $ cd ..
368 $ hg clone -q --narrow ssh://user@dummy/upstream interrupted --include d0
356 $ hg clone -q --narrow ssh://user@dummy/upstream interrupted --include d0
369 $ cd interrupted
357 $ cd interrupted
370 $ echo local > d0/f
358 $ echo local > d0/f
371 $ hg ci -m local
359 $ hg ci -m local
372 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
360 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
373 11: local
361 11: local
374 10: add d10/f
362 10: add d10/f
375 9: add d9/f
363 9: add d9/f
376 8: add d8/f
364 8: add d8/f
377 7: add d7/f
365 7: add d7/f
378 6: add d6/f
366 6: add d6/f
379 5: add d5/f
367 5: add d5/f
380 4: add d4/f
368 4: add d4/f
381 3: add d3/f
369 3: add d3/f
382 2: add d2/f
370 2: add d2/f
383 1: add d1/f
371 1: add d1/f
384 0: add d0/f
372 0: add d0/f
385 $ hg bookmarks bookmark
373 $ hg bookmarks bookmark
386 $ hg --config hooks.pretxnchangegroup.bad=false tracked --addinclude d1
374 $ hg --config hooks.pretxnchangegroup.bad=false tracked --addinclude d1
387 comparing with ssh://user@dummy/upstream
375 comparing with ssh://user@dummy/upstream
388 searching for changes
376 searching for changes
389 adding changesets
377 adding changesets
390 adding manifests
378 adding manifests
391 adding file changes
379 adding file changes
392 added 0 changesets with 1 changes to 1 files
380 added 0 changesets with 1 changes to 1 files
393 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
381 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
394 11: local
382 11: local
395 10: add d10/f
383 10: add d10/f
396 9: add d9/f
384 9: add d9/f
397 8: add d8/f
385 8: add d8/f
398 7: add d7/f
386 7: add d7/f
399 6: add d6/f
387 6: add d6/f
400 5: add d5/f
388 5: add d5/f
401 4: add d4/f
389 4: add d4/f
402 3: add d3/f
390 3: add d3/f
403 2: add d2/f
391 2: add d2/f
404 1: add d1/f
392 1: add d1/f
405 0: add d0/f
393 0: add d0/f
406 $ hg bookmarks
394 $ hg bookmarks
407 * bookmark 11:* (glob)
395 * bookmark 11:* (glob)
408 $ hg unbundle .hg/strip-backup/*-widen.hg
396 $ hg unbundle .hg/strip-backup/*-widen.hg
409 abort: .hg/strip-backup/*-widen.hg: $ENOTDIR$ (windows !)
397 abort: .hg/strip-backup/*-widen.hg: $ENOTDIR$ (windows !)
410 abort: $ENOENT$: '.hg/strip-backup/*-widen.hg' (no-windows !)
398 abort: $ENOENT$: '.hg/strip-backup/*-widen.hg' (no-windows !)
411 [255]
399 [255]
412 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
400 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
413 11: local
401 11: local
414 10: add d10/f
402 10: add d10/f
415 9: add d9/f
403 9: add d9/f
416 8: add d8/f
404 8: add d8/f
417 7: add d7/f
405 7: add d7/f
418 6: add d6/f
406 6: add d6/f
419 5: add d5/f
407 5: add d5/f
420 4: add d4/f
408 4: add d4/f
421 3: add d3/f
409 3: add d3/f
422 2: add d2/f
410 2: add d2/f
423 1: add d1/f
411 1: add d1/f
424 0: add d0/f
412 0: add d0/f
425 $ hg bookmarks
413 $ hg bookmarks
426 * bookmark 11:* (glob)
414 * bookmark 11:* (glob)
@@ -1,453 +1,441
1 #testcases flat tree
1 #testcases flat tree
2 $ . "$TESTDIR/narrow-library.sh"
2 $ . "$TESTDIR/narrow-library.sh"
3
3
4 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
5 > [alias]
5 > [alias]
6 > l = log -G -T "{if(ellipsis, '...')}{rev}: {desc}\n"
6 > l = log -G -T "{if(ellipsis, '...')}{rev}: {desc}\n"
7 > EOF
7 > EOF
8
8
9 #if tree
9 #if tree
10 $ cat << EOF >> $HGRCPATH
10 $ cat << EOF >> $HGRCPATH
11 > [experimental]
11 > [experimental]
12 > treemanifest = 1
12 > treemanifest = 1
13 > EOF
13 > EOF
14 #endif
14 #endif
15
15
16 $ hg init master
16 $ hg init master
17 $ cd master
17 $ cd master
18 $ cat >> .hg/hgrc <<EOF
18 $ cat >> .hg/hgrc <<EOF
19 > [narrow]
19 > [narrow]
20 > serveellipses=True
20 > serveellipses=True
21 > EOF
21 > EOF
22
22
23 $ mkdir inside
23 $ mkdir inside
24 $ echo 'inside' > inside/f
24 $ echo 'inside' > inside/f
25 $ hg add inside/f
25 $ hg add inside/f
26 $ hg commit -m 'add inside'
26 $ hg commit -m 'add inside'
27
27
28 $ mkdir widest
28 $ mkdir widest
29 $ echo 'widest' > widest/f
29 $ echo 'widest' > widest/f
30 $ hg add widest/f
30 $ hg add widest/f
31 $ hg commit -m 'add widest'
31 $ hg commit -m 'add widest'
32
32
33 $ mkdir outside
33 $ mkdir outside
34 $ echo 'outside' > outside/f
34 $ echo 'outside' > outside/f
35 $ hg add outside/f
35 $ hg add outside/f
36 $ hg commit -m 'add outside'
36 $ hg commit -m 'add outside'
37
37
38 $ cd ..
38 $ cd ..
39
39
40 narrow clone the inside file
40 narrow clone the inside file
41
41
42 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
42 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 2 changesets with 1 changes to 1 files
47 added 2 changesets with 1 changes to 1 files
48 new changesets *:* (glob)
48 new changesets *:* (glob)
49 updating to branch default
49 updating to branch default
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 $ cd narrow
51 $ cd narrow
52 $ hg tracked
52 $ hg tracked
53 I path:inside
53 I path:inside
54 $ ls -A
54 $ ls -A
55 .hg
55 .hg
56 inside
56 inside
57 $ cat inside/f
57 $ cat inside/f
58 inside
58 inside
59 $ cd ..
59 $ cd ..
60
60
61 add more upstream files which we will include in a wider narrow spec
61 add more upstream files which we will include in a wider narrow spec
62
62
63 $ cd master
63 $ cd master
64
64
65 $ mkdir wider
65 $ mkdir wider
66 $ echo 'wider' > wider/f
66 $ echo 'wider' > wider/f
67 $ hg add wider/f
67 $ hg add wider/f
68 $ echo 'widest v2' > widest/f
68 $ echo 'widest v2' > widest/f
69 $ hg commit -m 'add wider, update widest'
69 $ hg commit -m 'add wider, update widest'
70
70
71 $ echo 'widest v3' > widest/f
71 $ echo 'widest v3' > widest/f
72 $ hg commit -m 'update widest v3'
72 $ hg commit -m 'update widest v3'
73
73
74 $ echo 'inside v2' > inside/f
74 $ echo 'inside v2' > inside/f
75 $ hg commit -m 'update inside'
75 $ hg commit -m 'update inside'
76
76
77 $ mkdir outside2
77 $ mkdir outside2
78 $ echo 'outside2' > outside2/f
78 $ echo 'outside2' > outside2/f
79 $ hg add outside2/f
79 $ hg add outside2/f
80 $ hg commit -m 'add outside2'
80 $ hg commit -m 'add outside2'
81
81
82 $ echo 'widest v4' > widest/f
82 $ echo 'widest v4' > widest/f
83 $ hg commit -m 'update widest v4'
83 $ hg commit -m 'update widest v4'
84
84
85 $ hg l
85 $ hg l
86 @ 7: update widest v4
86 @ 7: update widest v4
87 |
87 |
88 o 6: add outside2
88 o 6: add outside2
89 |
89 |
90 o 5: update inside
90 o 5: update inside
91 |
91 |
92 o 4: update widest v3
92 o 4: update widest v3
93 |
93 |
94 o 3: add wider, update widest
94 o 3: add wider, update widest
95 |
95 |
96 o 2: add outside
96 o 2: add outside
97 |
97 |
98 o 1: add widest
98 o 1: add widest
99 |
99 |
100 o 0: add inside
100 o 0: add inside
101
101
102
102
103 $ cd ..
103 $ cd ..
104
104
105 Widen the narrow spec to see the widest file. This should not get the newly
105 Widen the narrow spec to see the widest file. This should not get the newly
106 added upstream revisions.
106 added upstream revisions.
107
107
108 $ cd narrow
108 $ cd narrow
109 $ hg l
109 $ hg l
110 @ ...1: add outside
110 @ ...1: add outside
111 |
111 |
112 o 0: add inside
112 o 0: add inside
113
113
114 $ hg tracked --addinclude widest/f
114 $ hg tracked --addinclude widest/f
115 comparing with ssh://user@dummy/master
115 comparing with ssh://user@dummy/master
116 searching for changes
116 searching for changes
117 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
117 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
118 adding changesets
118 adding changesets
119 adding manifests
119 adding manifests
120 adding file changes
120 adding file changes
121 added 3 changesets with 2 changes to 3 files
121 added 3 changesets with 2 changes to 3 files
122 $ hg l
122 $ hg l
123 @ ...2: add outside
123 @ ...2: add outside
124 |
124 |
125 o 1: add widest
125 o 1: add widest
126 |
126 |
127 o 0: add inside
127 o 0: add inside
128
128
129 $ hg tracked
129 $ hg tracked
130 I path:inside
130 I path:inside
131 I path:widest/f
131 I path:widest/f
132
132
133 $ cat widest/f
133 $ cat widest/f
134 widest
134 widest
135
135
136 Pull down the newly added upstream revision.
136 Pull down the newly added upstream revision.
137
137
138 $ hg pull
138 $ hg pull
139 pulling from ssh://user@dummy/master
139 pulling from ssh://user@dummy/master
140 searching for changes
140 searching for changes
141 adding changesets
141 adding changesets
142 adding manifests
142 adding manifests
143 adding file changes
143 adding file changes
144 added 5 changesets with 4 changes to 2 files
144 added 5 changesets with 4 changes to 2 files
145 new changesets *:* (glob)
145 new changesets *:* (glob)
146 (run 'hg update' to get a working copy)
146 (run 'hg update' to get a working copy)
147 $ hg update -r 'desc("add wider")'
147 $ hg update -r 'desc("add wider")'
148 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 $ cat widest/f
149 $ cat widest/f
150 widest v2
150 widest v2
151
151
152 $ hg update -r 'desc("update inside")'
152 $ hg update -r 'desc("update inside")'
153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 $ cat widest/f
154 $ cat widest/f
155 widest v3
155 widest v3
156 $ cat inside/f
156 $ cat inside/f
157 inside v2
157 inside v2
158
158
159 $ hg l
159 $ hg l
160 o 7: update widest v4
160 o 7: update widest v4
161 |
161 |
162 o ...6: add outside2
162 o ...6: add outside2
163 |
163 |
164 @ 5: update inside
164 @ 5: update inside
165 |
165 |
166 o 4: update widest v3
166 o 4: update widest v3
167 |
167 |
168 o 3: add wider, update widest
168 o 3: add wider, update widest
169 |
169 |
170 o ...2: add outside
170 o ...2: add outside
171 |
171 |
172 o 1: add widest
172 o 1: add widest
173 |
173 |
174 o 0: add inside
174 o 0: add inside
175
175
176
176
177 Check that widening with a newline fails
177 Check that widening with a newline fails
178
178
179 $ hg tracked --addinclude 'widest
179 $ hg tracked --addinclude 'widest
180 > '
180 > '
181 abort: newlines are not allowed in narrowspec paths
181 abort: newlines are not allowed in narrowspec paths
182 [255]
182 [255]
183
183
184 widen the narrow spec to include the wider file
184 widen the narrow spec to include the wider file
185
185
186 $ hg tracked --addinclude wider
186 $ hg tracked --addinclude wider
187 comparing with ssh://user@dummy/master
187 comparing with ssh://user@dummy/master
188 searching for changes
188 searching for changes
189 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
189 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
190 adding changesets
190 adding changesets
191 adding manifests
191 adding manifests
192 adding file changes
192 adding file changes
193 added 8 changesets with 7 changes to 5 files
193 added 8 changesets with 7 changes to 5 files
194 $ hg tracked
194 $ hg tracked
195 I path:inside
195 I path:inside
196 I path:wider
196 I path:wider
197 I path:widest/f
197 I path:widest/f
198 $ hg update 'desc("add widest")'
198 $ hg update 'desc("add widest")'
199 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
199 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
200 $ cat widest/f
200 $ cat widest/f
201 widest
201 widest
202 $ hg update 'desc("add wider, update widest")'
202 $ hg update 'desc("add wider, update widest")'
203 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 $ cat wider/f
204 $ cat wider/f
205 wider
205 wider
206 $ cat widest/f
206 $ cat widest/f
207 widest v2
207 widest v2
208 $ hg update 'desc("update widest v3")'
208 $ hg update 'desc("update widest v3")'
209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 $ cat widest/f
210 $ cat widest/f
211 widest v3
211 widest v3
212 $ hg update 'desc("update widest v4")'
212 $ hg update 'desc("update widest v4")'
213 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
214 $ cat widest/f
214 $ cat widest/f
215 widest v4
215 widest v4
216
216
217 $ hg l
217 $ hg l
218 @ 7: update widest v4
218 @ 7: update widest v4
219 |
219 |
220 o ...6: add outside2
220 o ...6: add outside2
221 |
221 |
222 o 5: update inside
222 o 5: update inside
223 |
223 |
224 o 4: update widest v3
224 o 4: update widest v3
225 |
225 |
226 o 3: add wider, update widest
226 o 3: add wider, update widest
227 |
227 |
228 o ...2: add outside
228 o ...2: add outside
229 |
229 |
230 o 1: add widest
230 o 1: add widest
231 |
231 |
232 o 0: add inside
232 o 0: add inside
233
233
234
234
235 separate suite of tests: files from 0-10 modified in changes 0-10. This allows
235 separate suite of tests: files from 0-10 modified in changes 0-10. This allows
236 more obvious precise tests tickling particular corner cases.
236 more obvious precise tests tickling particular corner cases.
237
237
238 $ cd ..
238 $ cd ..
239 $ hg init upstream
239 $ hg init upstream
240 $ cd upstream
240 $ cd upstream
241 $ cat >> .hg/hgrc <<EOF
241 $ cat >> .hg/hgrc <<EOF
242 > [narrow]
242 > [narrow]
243 > serveellipses=True
243 > serveellipses=True
244 > EOF
244 > EOF
245 $ for x in `$TESTDIR/seq.py 0 10`
245 $ for x in `$TESTDIR/seq.py 0 10`
246 > do
246 > do
247 > mkdir d$x
247 > mkdir d$x
248 > echo $x > d$x/f
248 > echo $x > d$x/f
249 > hg add d$x/f
249 > hg add d$x/f
250 > hg commit -m "add d$x/f"
250 > hg commit -m "add d$x/f"
251 > done
251 > done
252 $ hg log -T "{rev}: {desc}\n"
252 $ hg log -T "{rev}: {desc}\n"
253 10: add d10/f
253 10: add d10/f
254 9: add d9/f
254 9: add d9/f
255 8: add d8/f
255 8: add d8/f
256 7: add d7/f
256 7: add d7/f
257 6: add d6/f
257 6: add d6/f
258 5: add d5/f
258 5: add d5/f
259 4: add d4/f
259 4: add d4/f
260 3: add d3/f
260 3: add d3/f
261 2: add d2/f
261 2: add d2/f
262 1: add d1/f
262 1: add d1/f
263 0: add d0/f
263 0: add d0/f
264
264
265 make narrow clone with every third node.
265 make narrow clone with every third node.
266
266
267 $ cd ..
267 $ cd ..
268 $ hg clone --narrow ssh://user@dummy/upstream narrow2 --include d0 --include d3 --include d6 --include d9
268 $ hg clone --narrow ssh://user@dummy/upstream narrow2 --include d0 --include d3 --include d6 --include d9
269 requesting all changes
269 requesting all changes
270 adding changesets
270 adding changesets
271 adding manifests
271 adding manifests
272 adding file changes
272 adding file changes
273 added 8 changesets with 4 changes to 4 files
273 added 8 changesets with 4 changes to 4 files
274 new changesets *:* (glob)
274 new changesets *:* (glob)
275 updating to branch default
275 updating to branch default
276 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 $ cd narrow2
277 $ cd narrow2
278 $ hg tracked
278 $ hg tracked
279 I path:d0
279 I path:d0
280 I path:d3
280 I path:d3
281 I path:d6
281 I path:d6
282 I path:d9
282 I path:d9
283 $ hg verify
283 $ hg verify -q
284 checking changesets
285 checking manifests
286 checking directory manifests (tree !)
287 crosschecking files in changesets and manifests
288 checking files
289 checked 8 changesets with 4 changes to 4 files
290 $ hg l
284 $ hg l
291 @ ...7: add d10/f
285 @ ...7: add d10/f
292 |
286 |
293 o 6: add d9/f
287 o 6: add d9/f
294 |
288 |
295 o ...5: add d8/f
289 o ...5: add d8/f
296 |
290 |
297 o 4: add d6/f
291 o 4: add d6/f
298 |
292 |
299 o ...3: add d5/f
293 o ...3: add d5/f
300 |
294 |
301 o 2: add d3/f
295 o 2: add d3/f
302 |
296 |
303 o ...1: add d2/f
297 o ...1: add d2/f
304 |
298 |
305 o 0: add d0/f
299 o 0: add d0/f
306
300
307 $ hg tracked --addinclude d1
301 $ hg tracked --addinclude d1
308 comparing with ssh://user@dummy/upstream
302 comparing with ssh://user@dummy/upstream
309 searching for changes
303 searching for changes
310 saved backup bundle to $TESTTMP/narrow2/.hg/strip-backup/*-widen.hg (glob)
304 saved backup bundle to $TESTTMP/narrow2/.hg/strip-backup/*-widen.hg (glob)
311 adding changesets
305 adding changesets
312 adding manifests
306 adding manifests
313 adding file changes
307 adding file changes
314 added 9 changesets with 5 changes to 9 files
308 added 9 changesets with 5 changes to 9 files
315 $ hg tracked
309 $ hg tracked
316 I path:d0
310 I path:d0
317 I path:d1
311 I path:d1
318 I path:d3
312 I path:d3
319 I path:d6
313 I path:d6
320 I path:d9
314 I path:d9
321 $ hg l
315 $ hg l
322 @ ...8: add d10/f
316 @ ...8: add d10/f
323 |
317 |
324 o 7: add d9/f
318 o 7: add d9/f
325 |
319 |
326 o ...6: add d8/f
320 o ...6: add d8/f
327 |
321 |
328 o 5: add d6/f
322 o 5: add d6/f
329 |
323 |
330 o ...4: add d5/f
324 o ...4: add d5/f
331 |
325 |
332 o 3: add d3/f
326 o 3: add d3/f
333 |
327 |
334 o ...2: add d2/f
328 o ...2: add d2/f
335 |
329 |
336 o 1: add d1/f
330 o 1: add d1/f
337 |
331 |
338 o 0: add d0/f
332 o 0: add d0/f
339
333
340
334
341 Verify shouldn't claim the repo is corrupt after a widen.
335 Verify shouldn't claim the repo is corrupt after a widen.
342
336
343 $ hg verify
337 $ hg verify -q
344 checking changesets
345 checking manifests
346 checking directory manifests (tree !)
347 crosschecking files in changesets and manifests
348 checking files
349 checked 9 changesets with 5 changes to 5 files
350
338
351 Widening preserves parent of local commit
339 Widening preserves parent of local commit
352
340
353 $ cd ..
341 $ cd ..
354 $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2
342 $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2
355 $ cd narrow3
343 $ cd narrow3
356 $ hg l
344 $ hg l
357 @ 1: add d2/f
345 @ 1: add d2/f
358 |
346 |
359 o ...0: add d1/f
347 o ...0: add d1/f
360
348
361 $ hg pull -q -r 3
349 $ hg pull -q -r 3
362 $ hg co -q tip
350 $ hg co -q tip
363 $ hg pull -q -r 4
351 $ hg pull -q -r 4
364 $ echo local > d2/f
352 $ echo local > d2/f
365 $ hg ci -m local
353 $ hg ci -m local
366 created new head
354 created new head
367 $ hg l
355 $ hg l
368 @ 4: local
356 @ 4: local
369 |
357 |
370 | o ...3: add d4/f
358 | o ...3: add d4/f
371 |/
359 |/
372 o ...2: add d3/f
360 o ...2: add d3/f
373 |
361 |
374 o 1: add d2/f
362 o 1: add d2/f
375 |
363 |
376 o ...0: add d1/f
364 o ...0: add d1/f
377
365
378 $ hg tracked -q --addinclude d0 --addinclude d9
366 $ hg tracked -q --addinclude d0 --addinclude d9
379 $ hg l
367 $ hg l
380 @ 5: local
368 @ 5: local
381 |
369 |
382 | o ...4: add d4/f
370 | o ...4: add d4/f
383 |/
371 |/
384 o ...3: add d3/f
372 o ...3: add d3/f
385 |
373 |
386 o 2: add d2/f
374 o 2: add d2/f
387 |
375 |
388 o ...1: add d1/f
376 o ...1: add d1/f
389 |
377 |
390 o 0: add d0/f
378 o 0: add d0/f
391
379
392
380
393 Widening preserves bookmarks
381 Widening preserves bookmarks
394
382
395 $ cd ..
383 $ cd ..
396 $ hg clone -q --narrow ssh://user@dummy/upstream narrow-bookmarks --include d4
384 $ hg clone -q --narrow ssh://user@dummy/upstream narrow-bookmarks --include d4
397 $ cd narrow-bookmarks
385 $ cd narrow-bookmarks
398 $ echo local > d4/f
386 $ echo local > d4/f
399 $ hg ci -m local
387 $ hg ci -m local
400 $ hg bookmarks bookmark
388 $ hg bookmarks bookmark
401 $ hg bookmarks
389 $ hg bookmarks
402 * bookmark 3:* (glob)
390 * bookmark 3:* (glob)
403 $ hg -q tracked --addinclude d2
391 $ hg -q tracked --addinclude d2
404 $ hg bookmarks
392 $ hg bookmarks
405 * bookmark 5:* (glob)
393 * bookmark 5:* (glob)
406 $ hg log -r bookmark -T '{desc}\n'
394 $ hg log -r bookmark -T '{desc}\n'
407 local
395 local
408
396
409 Widening that fails can be recovered from
397 Widening that fails can be recovered from
410
398
411 $ cd ..
399 $ cd ..
412 $ hg clone -q --narrow ssh://user@dummy/upstream interrupted --include d0
400 $ hg clone -q --narrow ssh://user@dummy/upstream interrupted --include d0
413 $ cd interrupted
401 $ cd interrupted
414 $ echo local > d0/f
402 $ echo local > d0/f
415 $ hg ci -m local
403 $ hg ci -m local
416 $ hg l
404 $ hg l
417 @ 2: local
405 @ 2: local
418 |
406 |
419 o ...1: add d10/f
407 o ...1: add d10/f
420 |
408 |
421 o 0: add d0/f
409 o 0: add d0/f
422
410
423 $ hg bookmarks bookmark
411 $ hg bookmarks bookmark
424 $ hg --config hooks.pretxnchangegroup.bad=false tracked --addinclude d1
412 $ hg --config hooks.pretxnchangegroup.bad=false tracked --addinclude d1
425 comparing with ssh://user@dummy/upstream
413 comparing with ssh://user@dummy/upstream
426 searching for changes
414 searching for changes
427 saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/*-widen.hg (glob)
415 saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/*-widen.hg (glob)
428 adding changesets
416 adding changesets
429 adding manifests
417 adding manifests
430 adding file changes
418 adding file changes
431 transaction abort!
419 transaction abort!
432 rollback completed
420 rollback completed
433 abort: pretxnchangegroup.bad hook exited with status 1
421 abort: pretxnchangegroup.bad hook exited with status 1
434 [40]
422 [40]
435 $ hg l
423 $ hg l
436 $ hg bookmarks
424 $ hg bookmarks
437 no bookmarks set
425 no bookmarks set
438 $ hg unbundle .hg/strip-backup/*-widen.hg
426 $ hg unbundle .hg/strip-backup/*-widen.hg
439 adding changesets
427 adding changesets
440 adding manifests
428 adding manifests
441 adding file changes
429 adding file changes
442 added 3 changesets with 2 changes to 1 files
430 added 3 changesets with 2 changes to 1 files
443 new changesets *:* (glob)
431 new changesets *:* (glob)
444 (run 'hg update' to get a working copy)
432 (run 'hg update' to get a working copy)
445 $ hg l
433 $ hg l
446 o 2: local
434 o 2: local
447 |
435 |
448 o ...1: add d10/f
436 o ...1: add d10/f
449 |
437 |
450 o 0: add d0/f
438 o 0: add d0/f
451
439
452 $ hg bookmarks
440 $ hg bookmarks
453 * bookmark 2:* (glob)
441 * bookmark 2:* (glob)
@@ -1,181 +1,176
1 Test changesets filtering during exchanges (some tests are still in
1 Test changesets filtering during exchanges (some tests are still in
2 test-obsolete.t)
2 test-obsolete.t)
3
3
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [experimental]
5 > [experimental]
6 > evolution.createmarkers=True
6 > evolution.createmarkers=True
7 > EOF
7 > EOF
8
8
9 Push does not corrupt remote
9 Push does not corrupt remote
10 ----------------------------
10 ----------------------------
11
11
12 Create a DAG where a changeset reuses a revision from a file first used in an
12 Create a DAG where a changeset reuses a revision from a file first used in an
13 extinct changeset.
13 extinct changeset.
14
14
15 $ hg init local
15 $ hg init local
16 $ cd local
16 $ cd local
17 $ echo 'base' > base
17 $ echo 'base' > base
18 $ hg commit -Am base
18 $ hg commit -Am base
19 adding base
19 adding base
20 $ echo 'A' > A
20 $ echo 'A' > A
21 $ hg commit -Am A
21 $ hg commit -Am A
22 adding A
22 adding A
23 $ hg up 0
23 $ hg up 0
24 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
24 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
25 $ hg revert -ar 1
25 $ hg revert -ar 1
26 adding A
26 adding A
27 $ hg commit -Am "A'"
27 $ hg commit -Am "A'"
28 created new head
28 created new head
29 $ hg log -G --template='{desc} {node}'
29 $ hg log -G --template='{desc} {node}'
30 @ A' f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
30 @ A' f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
31 |
31 |
32 | o A 9d73aac1b2ed7d53835eaeec212ed41ea47da53a
32 | o A 9d73aac1b2ed7d53835eaeec212ed41ea47da53a
33 |/
33 |/
34 o base d20a80d4def38df63a4b330b7fb688f3d4cae1e3
34 o base d20a80d4def38df63a4b330b7fb688f3d4cae1e3
35
35
36 $ hg debugobsolete 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
36 $ hg debugobsolete 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
37 1 new obsolescence markers
37 1 new obsolescence markers
38 obsoleted 1 changesets
38 obsoleted 1 changesets
39
39
40 Push it. The bundle should not refer to the extinct changeset.
40 Push it. The bundle should not refer to the extinct changeset.
41
41
42 $ hg init ../other
42 $ hg init ../other
43 $ hg push ../other
43 $ hg push ../other
44 pushing to ../other
44 pushing to ../other
45 searching for changes
45 searching for changes
46 adding changesets
46 adding changesets
47 adding manifests
47 adding manifests
48 adding file changes
48 adding file changes
49 added 2 changesets with 2 changes to 2 files
49 added 2 changesets with 2 changes to 2 files
50 $ hg -R ../other verify
50 $ hg -R ../other verify -q
51 checking changesets
52 checking manifests
53 crosschecking files in changesets and manifests
54 checking files
55 checked 2 changesets with 2 changes to 2 files
56
51
57 Adding a changeset going extinct locally
52 Adding a changeset going extinct locally
58 ------------------------------------------
53 ------------------------------------------
59
54
60 Pull a changeset that will immediatly goes extinct (because you already have a
55 Pull a changeset that will immediatly goes extinct (because you already have a
61 marker to obsolete him)
56 marker to obsolete him)
62 (test resolution of issue3788)
57 (test resolution of issue3788)
63
58
64 $ hg phase --draft --force f89bcc95eba5
59 $ hg phase --draft --force f89bcc95eba5
65 $ hg phase -R ../other --draft --force f89bcc95eba5
60 $ hg phase -R ../other --draft --force f89bcc95eba5
66 $ hg commit --amend -m "A''"
61 $ hg commit --amend -m "A''"
67 $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
62 $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
68 $ hg pull ../other
63 $ hg pull ../other
69 pulling from ../other
64 pulling from ../other
70 searching for changes
65 searching for changes
71 adding changesets
66 adding changesets
72 adding manifests
67 adding manifests
73 adding file changes
68 adding file changes
74 added 1 changesets with 0 changes to 1 files (+1 heads)
69 added 1 changesets with 0 changes to 1 files (+1 heads)
75 1 new phase-divergent changesets
70 1 new phase-divergent changesets
76 new changesets f89bcc95eba5
71 new changesets f89bcc95eba5
77 (run 'hg heads' to see heads, 'hg merge' to merge)
72 (run 'hg heads' to see heads, 'hg merge' to merge)
78
73
79 check that bundle is not affected
74 check that bundle is not affected
80
75
81 $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5.hg
76 $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5.hg
82 1 changesets found
77 1 changesets found
83 $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
78 $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
84 $ hg unbundle ../f89bcc95eba5.hg
79 $ hg unbundle ../f89bcc95eba5.hg
85 adding changesets
80 adding changesets
86 adding manifests
81 adding manifests
87 adding file changes
82 adding file changes
88 added 1 changesets with 0 changes to 1 files (+1 heads)
83 added 1 changesets with 0 changes to 1 files (+1 heads)
89 (1 other changesets obsolete on arrival)
84 (1 other changesets obsolete on arrival)
90 (run 'hg heads' to see heads)
85 (run 'hg heads' to see heads)
91
86
92 check-that bundle can contain markers:
87 check-that bundle can contain markers:
93
88
94 $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5-obs.hg --config experimental.evolution.bundle-obsmarker=1
89 $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5-obs.hg --config experimental.evolution.bundle-obsmarker=1
95 1 changesets found
90 1 changesets found
96 $ hg debugbundle ../f89bcc95eba5.hg
91 $ hg debugbundle ../f89bcc95eba5.hg
97 Stream params: {Compression: BZ}
92 Stream params: {Compression: BZ}
98 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
93 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
99 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
94 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
100 cache:rev-branch-cache -- {} (mandatory: False)
95 cache:rev-branch-cache -- {} (mandatory: False)
101 $ hg debugbundle ../f89bcc95eba5-obs.hg
96 $ hg debugbundle ../f89bcc95eba5-obs.hg
102 Stream params: {Compression: BZ}
97 Stream params: {Compression: BZ}
103 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
98 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
104 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
99 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
105 cache:rev-branch-cache -- {} (mandatory: False)
100 cache:rev-branch-cache -- {} (mandatory: False)
106 obsmarkers -- {} (mandatory: True)
101 obsmarkers -- {} (mandatory: True)
107 version: 1 (70 bytes)
102 version: 1 (70 bytes)
108 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
103 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
109
104
110 $ cd ..
105 $ cd ..
111
106
112 pull does not fetch excessive changesets when common node is hidden (issue4982)
107 pull does not fetch excessive changesets when common node is hidden (issue4982)
113 -------------------------------------------------------------------------------
108 -------------------------------------------------------------------------------
114
109
115 initial repo with server and client matching
110 initial repo with server and client matching
116
111
117 $ hg init pull-hidden-common
112 $ hg init pull-hidden-common
118 $ cd pull-hidden-common
113 $ cd pull-hidden-common
119 $ touch foo
114 $ touch foo
120 $ hg -q commit -A -m initial
115 $ hg -q commit -A -m initial
121 $ echo 1 > foo
116 $ echo 1 > foo
122 $ hg commit -m 1
117 $ hg commit -m 1
123 $ echo 2a > foo
118 $ echo 2a > foo
124 $ hg commit -m 2a
119 $ hg commit -m 2a
125 $ cd ..
120 $ cd ..
126 $ hg clone --pull pull-hidden-common pull-hidden-common-client
121 $ hg clone --pull pull-hidden-common pull-hidden-common-client
127 requesting all changes
122 requesting all changes
128 adding changesets
123 adding changesets
129 adding manifests
124 adding manifests
130 adding file changes
125 adding file changes
131 added 3 changesets with 3 changes to 1 files
126 added 3 changesets with 3 changes to 1 files
132 new changesets 96ee1d7354c4:6a29ed9c68de
127 new changesets 96ee1d7354c4:6a29ed9c68de
133 updating to branch default
128 updating to branch default
134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
129 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
135
130
136 server obsoletes the old head
131 server obsoletes the old head
137
132
138 $ cd pull-hidden-common
133 $ cd pull-hidden-common
139 $ hg -q up -r 1
134 $ hg -q up -r 1
140 $ echo 2b > foo
135 $ echo 2b > foo
141 $ hg -q commit -m 2b
136 $ hg -q commit -m 2b
142 $ hg debugobsolete 6a29ed9c68defff1a139e5c6fa9696fb1a75783d bec0734cd68e84477ba7fc1d13e6cff53ab70129
137 $ hg debugobsolete 6a29ed9c68defff1a139e5c6fa9696fb1a75783d bec0734cd68e84477ba7fc1d13e6cff53ab70129
143 1 new obsolescence markers
138 1 new obsolescence markers
144 obsoleted 1 changesets
139 obsoleted 1 changesets
145 $ cd ..
140 $ cd ..
146
141
147 client only pulls down 1 changeset
142 client only pulls down 1 changeset
148
143
149 $ cd pull-hidden-common-client
144 $ cd pull-hidden-common-client
150 $ hg pull --debug
145 $ hg pull --debug
151 pulling from $TESTTMP/pull-hidden-common
146 pulling from $TESTTMP/pull-hidden-common
152 query 1; heads
147 query 1; heads
153 searching for changes
148 searching for changes
154 taking quick initial sample
149 taking quick initial sample
155 query 2; still undecided: 2, sample size is: 2
150 query 2; still undecided: 2, sample size is: 2
156 2 total queries in *.????s (glob)
151 2 total queries in *.????s (glob)
157 1 changesets found
152 1 changesets found
158 list of changesets:
153 list of changesets:
159 bec0734cd68e84477ba7fc1d13e6cff53ab70129
154 bec0734cd68e84477ba7fc1d13e6cff53ab70129
160 listing keys for "bookmarks"
155 listing keys for "bookmarks"
161 bundle2-output-bundle: "HG20", 3 parts total
156 bundle2-output-bundle: "HG20", 3 parts total
162 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
157 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
163 bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload
158 bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload
164 bundle2-output-part: "phase-heads" 24 bytes payload
159 bundle2-output-part: "phase-heads" 24 bytes payload
165 bundle2-input-bundle: with-transaction
160 bundle2-input-bundle: with-transaction
166 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
161 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
167 adding changesets
162 adding changesets
168 add changeset bec0734cd68e
163 add changeset bec0734cd68e
169 adding manifests
164 adding manifests
170 adding file changes
165 adding file changes
171 adding foo revisions
166 adding foo revisions
172 bundle2-input-part: total payload size 476
167 bundle2-input-part: total payload size 476
173 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
168 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
174 bundle2-input-part: "phase-heads" supported
169 bundle2-input-part: "phase-heads" supported
175 bundle2-input-part: total payload size 24
170 bundle2-input-part: total payload size 24
176 bundle2-input-bundle: 3 parts total
171 bundle2-input-bundle: 3 parts total
177 checking for updated bookmarks
172 checking for updated bookmarks
178 updating the branch cache
173 updating the branch cache
179 added 1 changesets with 1 changes to 1 files (+1 heads)
174 added 1 changesets with 1 changes to 1 files (+1 heads)
180 new changesets bec0734cd68e
175 new changesets bec0734cd68e
181 (run 'hg heads' to see heads, 'hg merge' to merge)
176 (run 'hg heads' to see heads, 'hg merge' to merge)
@@ -1,90 +1,76
1 #require unix-permissions no-root reporevlogstore
1 #require unix-permissions no-root reporevlogstore
2
2
3 #testcases dirstate-v1 dirstate-v2
3 #testcases dirstate-v1 dirstate-v2
4
4
5 #if dirstate-v2
5 #if dirstate-v2
6 $ cat >> $HGRCPATH << EOF
6 $ cat >> $HGRCPATH << EOF
7 > [format]
7 > [format]
8 > use-dirstate-v2=1
8 > use-dirstate-v2=1
9 > [storage]
9 > [storage]
10 > dirstate-v2.slow-path=allow
10 > dirstate-v2.slow-path=allow
11 > EOF
11 > EOF
12 #endif
12 #endif
13
13
14 $ hg init t
14 $ hg init t
15 $ cd t
15 $ cd t
16
16
17 $ echo foo > a
17 $ echo foo > a
18 $ hg add a
18 $ hg add a
19
19
20 $ hg commit -m "1"
20 $ hg commit -m "1"
21
21
22 $ hg verify
22 $ hg verify -q
23 checking changesets
24 checking manifests
25 crosschecking files in changesets and manifests
26 checking files
27 checked 1 changesets with 1 changes to 1 files
28
23
29 $ chmod -r .hg/store/data/a.i
24 $ chmod -r .hg/store/data/a.i
30
25
31 $ hg verify
26 $ hg verify -q
32 checking changesets
33 checking manifests
34 crosschecking files in changesets and manifests
35 checking files
36 abort: Permission denied: '$TESTTMP/t/.hg/store/data/a.i'
27 abort: Permission denied: '$TESTTMP/t/.hg/store/data/a.i'
37 [255]
28 [255]
38
29
39 $ chmod +r .hg/store/data/a.i
30 $ chmod +r .hg/store/data/a.i
40
31
41 $ hg verify
32 $ hg verify -q
42 checking changesets
43 checking manifests
44 crosschecking files in changesets and manifests
45 checking files
46 checked 1 changesets with 1 changes to 1 files
47
33
48 $ chmod -w .hg/store/data/a.i
34 $ chmod -w .hg/store/data/a.i
49
35
50 $ echo barber > a
36 $ echo barber > a
51 $ hg commit -m "2"
37 $ hg commit -m "2"
52 trouble committing a!
38 trouble committing a!
53 abort: Permission denied: '$TESTTMP/t/.hg/store/data/a.i'
39 abort: Permission denied: '$TESTTMP/t/.hg/store/data/a.i'
54 [255]
40 [255]
55
41
56 $ chmod -w .
42 $ chmod -w .
57
43
58 $ hg diff --nodates
44 $ hg diff --nodates
59 diff -r 2a18120dc1c9 a
45 diff -r 2a18120dc1c9 a
60 --- a/a
46 --- a/a
61 +++ b/a
47 +++ b/a
62 @@ -1,1 +1,1 @@
48 @@ -1,1 +1,1 @@
63 -foo
49 -foo
64 +barber
50 +barber
65
51
66 $ chmod +w .
52 $ chmod +w .
67
53
68 $ chmod +w .hg/store/data/a.i
54 $ chmod +w .hg/store/data/a.i
69 $ mkdir dir
55 $ mkdir dir
70 $ touch dir/a
56 $ touch dir/a
71 $ hg status
57 $ hg status
72 M a
58 M a
73 ? dir/a
59 ? dir/a
74 $ chmod -rx dir
60 $ chmod -rx dir
75
61
76 #if no-fsmonitor
62 #if no-fsmonitor
77
63
78 (fsmonitor makes "hg status" avoid accessing to "dir")
64 (fsmonitor makes "hg status" avoid accessing to "dir")
79
65
80 $ hg status
66 $ hg status
81 dir: Permission denied* (glob)
67 dir: Permission denied* (glob)
82 M a
68 M a
83
69
84 #endif
70 #endif
85
71
86 Reenable perm to allow deletion:
72 Reenable perm to allow deletion:
87
73
88 $ chmod +rx dir
74 $ chmod +rx dir
89
75
90 $ cd ..
76 $ cd ..
@@ -1,1146 +1,1141
1 $ cat > $TESTTMP/hook.sh << 'EOF'
1 $ cat > $TESTTMP/hook.sh << 'EOF'
2 > echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE"
2 > echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE"
3 > EOF
3 > EOF
4
4
5 $ cat >> $HGRCPATH << EOF
5 $ cat >> $HGRCPATH << EOF
6 > [extensions]
6 > [extensions]
7 > phasereport=$TESTDIR/testlib/ext-phase-report.py
7 > phasereport=$TESTDIR/testlib/ext-phase-report.py
8 > [hooks]
8 > [hooks]
9 > txnclose-phase.test = sh $TESTTMP/hook.sh
9 > txnclose-phase.test = sh $TESTTMP/hook.sh
10 > EOF
10 > EOF
11
11
12 $ hglog() { hg log -G --template "{rev} {phaseidx} {desc}\n" $*; }
12 $ hglog() { hg log -G --template "{rev} {phaseidx} {desc}\n" $*; }
13 $ mkcommit() {
13 $ mkcommit() {
14 > echo "$1" > "$1"
14 > echo "$1" > "$1"
15 > hg add "$1"
15 > hg add "$1"
16 > message="$1"
16 > message="$1"
17 > shift
17 > shift
18 > hg ci -m "$message" $*
18 > hg ci -m "$message" $*
19 > }
19 > }
20
20
21 $ hg init initialrepo
21 $ hg init initialrepo
22 $ cd initialrepo
22 $ cd initialrepo
23
23
24 Cannot change null revision phase
24 Cannot change null revision phase
25
25
26 $ hg phase --force --secret null
26 $ hg phase --force --secret null
27 abort: cannot change null revision phase
27 abort: cannot change null revision phase
28 [255]
28 [255]
29 $ hg phase null
29 $ hg phase null
30 -1: public
30 -1: public
31
31
32 $ mkcommit A
32 $ mkcommit A
33 test-debug-phase: new rev 0: x -> 1
33 test-debug-phase: new rev 0: x -> 1
34 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
34 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
35
35
36 New commit are draft by default
36 New commit are draft by default
37
37
38 $ hglog
38 $ hglog
39 @ 0 1 A
39 @ 0 1 A
40
40
41
41
42 Following commit are draft too
42 Following commit are draft too
43
43
44 $ mkcommit B
44 $ mkcommit B
45 test-debug-phase: new rev 1: x -> 1
45 test-debug-phase: new rev 1: x -> 1
46 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft
46 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft
47
47
48 $ hglog
48 $ hglog
49 @ 1 1 B
49 @ 1 1 B
50 |
50 |
51 o 0 1 A
51 o 0 1 A
52
52
53
53
54 Working directory phase is secret when its parent is secret.
54 Working directory phase is secret when its parent is secret.
55
55
56 $ hg phase --force --secret .
56 $ hg phase --force --secret .
57 test-debug-phase: move rev 0: 1 -> 2
57 test-debug-phase: move rev 0: 1 -> 2
58 test-debug-phase: move rev 1: 1 -> 2
58 test-debug-phase: move rev 1: 1 -> 2
59 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> secret
59 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> secret
60 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> secret
60 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> secret
61 $ hg log -r 'wdir()' -T '{phase}\n'
61 $ hg log -r 'wdir()' -T '{phase}\n'
62 secret
62 secret
63 $ hg log -r 'wdir() and public()' -T '{phase}\n'
63 $ hg log -r 'wdir() and public()' -T '{phase}\n'
64 $ hg log -r 'wdir() and draft()' -T '{phase}\n'
64 $ hg log -r 'wdir() and draft()' -T '{phase}\n'
65 $ hg log -r 'wdir() and secret()' -T '{phase}\n'
65 $ hg log -r 'wdir() and secret()' -T '{phase}\n'
66 secret
66 secret
67
67
68 Working directory phase is draft when its parent is draft.
68 Working directory phase is draft when its parent is draft.
69
69
70 $ hg phase --draft .
70 $ hg phase --draft .
71 test-debug-phase: move rev 1: 2 -> 1
71 test-debug-phase: move rev 1: 2 -> 1
72 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: secret -> draft
72 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: secret -> draft
73 $ hg log -r 'wdir()' -T '{phase}\n'
73 $ hg log -r 'wdir()' -T '{phase}\n'
74 draft
74 draft
75 $ hg log -r 'wdir() and public()' -T '{phase}\n'
75 $ hg log -r 'wdir() and public()' -T '{phase}\n'
76 $ hg log -r 'wdir() and draft()' -T '{phase}\n'
76 $ hg log -r 'wdir() and draft()' -T '{phase}\n'
77 draft
77 draft
78 $ hg log -r 'wdir() and secret()' -T '{phase}\n'
78 $ hg log -r 'wdir() and secret()' -T '{phase}\n'
79
79
80 Working directory phase is secret when a new commit will be created as secret,
80 Working directory phase is secret when a new commit will be created as secret,
81 even if the parent is draft.
81 even if the parent is draft.
82
82
83 $ hg log -r 'wdir() and secret()' -T '{phase}\n' \
83 $ hg log -r 'wdir() and secret()' -T '{phase}\n' \
84 > --config phases.new-commit='secret'
84 > --config phases.new-commit='secret'
85 secret
85 secret
86
86
87 Working directory phase is draft when its parent is public.
87 Working directory phase is draft when its parent is public.
88
88
89 $ hg phase --public .
89 $ hg phase --public .
90 test-debug-phase: move rev 0: 1 -> 0
90 test-debug-phase: move rev 0: 1 -> 0
91 test-debug-phase: move rev 1: 1 -> 0
91 test-debug-phase: move rev 1: 1 -> 0
92 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public
92 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public
93 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public
93 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public
94 $ hg log -r 'wdir()' -T '{phase}\n'
94 $ hg log -r 'wdir()' -T '{phase}\n'
95 draft
95 draft
96 $ hg log -r 'wdir() and public()' -T '{phase}\n'
96 $ hg log -r 'wdir() and public()' -T '{phase}\n'
97 $ hg log -r 'wdir() and draft()' -T '{phase}\n'
97 $ hg log -r 'wdir() and draft()' -T '{phase}\n'
98 draft
98 draft
99 $ hg log -r 'wdir() and secret()' -T '{phase}\n'
99 $ hg log -r 'wdir() and secret()' -T '{phase}\n'
100 $ hg log -r 'wdir() and secret()' -T '{phase}\n' \
100 $ hg log -r 'wdir() and secret()' -T '{phase}\n' \
101 > --config phases.new-commit='secret'
101 > --config phases.new-commit='secret'
102 secret
102 secret
103
103
104 Draft commit are properly created over public one:
104 Draft commit are properly created over public one:
105
105
106 $ hg phase
106 $ hg phase
107 1: public
107 1: public
108 $ hglog
108 $ hglog
109 @ 1 0 B
109 @ 1 0 B
110 |
110 |
111 o 0 0 A
111 o 0 0 A
112
112
113
113
114 $ mkcommit C
114 $ mkcommit C
115 test-debug-phase: new rev 2: x -> 1
115 test-debug-phase: new rev 2: x -> 1
116 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft
116 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft
117 $ mkcommit D
117 $ mkcommit D
118 test-debug-phase: new rev 3: x -> 1
118 test-debug-phase: new rev 3: x -> 1
119 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft
119 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft
120
120
121 $ hglog
121 $ hglog
122 @ 3 1 D
122 @ 3 1 D
123 |
123 |
124 o 2 1 C
124 o 2 1 C
125 |
125 |
126 o 1 0 B
126 o 1 0 B
127 |
127 |
128 o 0 0 A
128 o 0 0 A
129
129
130
130
131 Test creating changeset as secret
131 Test creating changeset as secret
132
132
133 $ mkcommit E --config phases.new-commit='secret'
133 $ mkcommit E --config phases.new-commit='secret'
134 test-debug-phase: new rev 4: x -> 2
134 test-debug-phase: new rev 4: x -> 2
135 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret
135 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret
136 $ hglog
136 $ hglog
137 @ 4 2 E
137 @ 4 2 E
138 |
138 |
139 o 3 1 D
139 o 3 1 D
140 |
140 |
141 o 2 1 C
141 o 2 1 C
142 |
142 |
143 o 1 0 B
143 o 1 0 B
144 |
144 |
145 o 0 0 A
145 o 0 0 A
146
146
147
147
148 Test the secret property is inherited
148 Test the secret property is inherited
149
149
150 $ mkcommit H
150 $ mkcommit H
151 test-debug-phase: new rev 5: x -> 2
151 test-debug-phase: new rev 5: x -> 2
152 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret
152 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret
153 $ hglog
153 $ hglog
154 @ 5 2 H
154 @ 5 2 H
155 |
155 |
156 o 4 2 E
156 o 4 2 E
157 |
157 |
158 o 3 1 D
158 o 3 1 D
159 |
159 |
160 o 2 1 C
160 o 2 1 C
161 |
161 |
162 o 1 0 B
162 o 1 0 B
163 |
163 |
164 o 0 0 A
164 o 0 0 A
165
165
166
166
167 Even on merge
167 Even on merge
168
168
169 $ hg up -q 1
169 $ hg up -q 1
170 $ mkcommit "B'"
170 $ mkcommit "B'"
171 test-debug-phase: new rev 6: x -> 1
171 test-debug-phase: new rev 6: x -> 1
172 created new head
172 created new head
173 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft
173 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft
174 $ hglog
174 $ hglog
175 @ 6 1 B'
175 @ 6 1 B'
176 |
176 |
177 | o 5 2 H
177 | o 5 2 H
178 | |
178 | |
179 | o 4 2 E
179 | o 4 2 E
180 | |
180 | |
181 | o 3 1 D
181 | o 3 1 D
182 | |
182 | |
183 | o 2 1 C
183 | o 2 1 C
184 |/
184 |/
185 o 1 0 B
185 o 1 0 B
186 |
186 |
187 o 0 0 A
187 o 0 0 A
188
188
189 $ hg merge 4 # E
189 $ hg merge 4 # E
190 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 (branch merge, don't forget to commit)
191 (branch merge, don't forget to commit)
192 $ hg phase
192 $ hg phase
193 6: draft
193 6: draft
194 4: secret
194 4: secret
195 $ hg ci -m "merge B' and E"
195 $ hg ci -m "merge B' and E"
196 test-debug-phase: new rev 7: x -> 2
196 test-debug-phase: new rev 7: x -> 2
197 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret
197 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret
198
198
199 $ hglog
199 $ hglog
200 @ 7 2 merge B' and E
200 @ 7 2 merge B' and E
201 |\
201 |\
202 | o 6 1 B'
202 | o 6 1 B'
203 | |
203 | |
204 +---o 5 2 H
204 +---o 5 2 H
205 | |
205 | |
206 o | 4 2 E
206 o | 4 2 E
207 | |
207 | |
208 o | 3 1 D
208 o | 3 1 D
209 | |
209 | |
210 o | 2 1 C
210 o | 2 1 C
211 |/
211 |/
212 o 1 0 B
212 o 1 0 B
213 |
213 |
214 o 0 0 A
214 o 0 0 A
215
215
216
216
217 Test secret changeset are not pushed
217 Test secret changeset are not pushed
218
218
219 $ hg init ../push-dest
219 $ hg init ../push-dest
220 $ cat > ../push-dest/.hg/hgrc << EOF
220 $ cat > ../push-dest/.hg/hgrc << EOF
221 > [phases]
221 > [phases]
222 > publish=False
222 > publish=False
223 > EOF
223 > EOF
224 $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n'
224 $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n'
225 comparing with ../push-dest
225 comparing with ../push-dest
226 searching for changes
226 searching for changes
227 0 public A
227 0 public A
228 1 public B
228 1 public B
229 2 draft C
229 2 draft C
230 3 draft D
230 3 draft D
231 6 draft B'
231 6 draft B'
232 $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
232 $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
233 comparing with ../push-dest
233 comparing with ../push-dest
234 searching for changes
234 searching for changes
235 0 public A
235 0 public A
236 1 public B
236 1 public B
237 2 draft C
237 2 draft C
238 3 draft D
238 3 draft D
239 6 draft B'
239 6 draft B'
240
240
241 $ hg push ../push-dest -f # force because we push multiple heads
241 $ hg push ../push-dest -f # force because we push multiple heads
242 pushing to ../push-dest
242 pushing to ../push-dest
243 searching for changes
243 searching for changes
244 adding changesets
244 adding changesets
245 adding manifests
245 adding manifests
246 adding file changes
246 adding file changes
247 added 5 changesets with 5 changes to 5 files (+1 heads)
247 added 5 changesets with 5 changes to 5 files (+1 heads)
248 test-debug-phase: new rev 0: x -> 0
248 test-debug-phase: new rev 0: x -> 0
249 test-debug-phase: new rev 1: x -> 0
249 test-debug-phase: new rev 1: x -> 0
250 test-debug-phase: new rev 2: x -> 1
250 test-debug-phase: new rev 2: x -> 1
251 test-debug-phase: new rev 3: x -> 1
251 test-debug-phase: new rev 3: x -> 1
252 test-debug-phase: new rev 4: x -> 1
252 test-debug-phase: new rev 4: x -> 1
253 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
253 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
254 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
254 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
255 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft
255 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft
256 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft
256 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft
257 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft
257 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft
258 $ hglog
258 $ hglog
259 @ 7 2 merge B' and E
259 @ 7 2 merge B' and E
260 |\
260 |\
261 | o 6 1 B'
261 | o 6 1 B'
262 | |
262 | |
263 +---o 5 2 H
263 +---o 5 2 H
264 | |
264 | |
265 o | 4 2 E
265 o | 4 2 E
266 | |
266 | |
267 o | 3 1 D
267 o | 3 1 D
268 | |
268 | |
269 o | 2 1 C
269 o | 2 1 C
270 |/
270 |/
271 o 1 0 B
271 o 1 0 B
272 |
272 |
273 o 0 0 A
273 o 0 0 A
274
274
275 $ cd ../push-dest
275 $ cd ../push-dest
276 $ hglog
276 $ hglog
277 o 4 1 B'
277 o 4 1 B'
278 |
278 |
279 | o 3 1 D
279 | o 3 1 D
280 | |
280 | |
281 | o 2 1 C
281 | o 2 1 C
282 |/
282 |/
283 o 1 0 B
283 o 1 0 B
284 |
284 |
285 o 0 0 A
285 o 0 0 A
286
286
287
287
288 (Issue3303)
288 (Issue3303)
289 Check that remote secret changeset are ignore when checking creation of remote heads
289 Check that remote secret changeset are ignore when checking creation of remote heads
290
290
291 We add a secret head into the push destination. This secret head shadows a
291 We add a secret head into the push destination. This secret head shadows a
292 visible shared between the initial repo and the push destination.
292 visible shared between the initial repo and the push destination.
293
293
294 $ hg up -q 4 # B'
294 $ hg up -q 4 # B'
295 $ mkcommit Z --config phases.new-commit=secret
295 $ mkcommit Z --config phases.new-commit=secret
296 test-debug-phase: new rev 5: x -> 2
296 test-debug-phase: new rev 5: x -> 2
297 test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret
297 test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret
298 $ hg phase .
298 $ hg phase .
299 5: secret
299 5: secret
300
300
301 We now try to push a new public changeset that descend from the common public
301 We now try to push a new public changeset that descend from the common public
302 head shadowed by the remote secret head.
302 head shadowed by the remote secret head.
303
303
304 $ cd ../initialrepo
304 $ cd ../initialrepo
305 $ hg up -q 6 #B'
305 $ hg up -q 6 #B'
306 $ mkcommit I
306 $ mkcommit I
307 test-debug-phase: new rev 8: x -> 1
307 test-debug-phase: new rev 8: x -> 1
308 created new head
308 created new head
309 test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft
309 test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft
310 $ hg push ../push-dest
310 $ hg push ../push-dest
311 pushing to ../push-dest
311 pushing to ../push-dest
312 searching for changes
312 searching for changes
313 adding changesets
313 adding changesets
314 adding manifests
314 adding manifests
315 adding file changes
315 adding file changes
316 added 1 changesets with 1 changes to 1 files (+1 heads)
316 added 1 changesets with 1 changes to 1 files (+1 heads)
317 test-debug-phase: new rev 6: x -> 1
317 test-debug-phase: new rev 6: x -> 1
318 test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft
318 test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft
319
319
320 :note: The "(+1 heads)" is wrong as we do not had any visible head
320 :note: The "(+1 heads)" is wrong as we do not had any visible head
321
321
322 check that branch cache with "served" filter are properly computed and stored
322 check that branch cache with "served" filter are properly computed and stored
323
323
324 $ ls ../push-dest/.hg/cache/branch2*
324 $ ls ../push-dest/.hg/cache/branch2*
325 ../push-dest/.hg/cache/branch2-base
325 ../push-dest/.hg/cache/branch2-base
326 ../push-dest/.hg/cache/branch2-served
326 ../push-dest/.hg/cache/branch2-served
327 $ cat ../push-dest/.hg/cache/branch2-served
327 $ cat ../push-dest/.hg/cache/branch2-served
328 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
328 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
329 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
329 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
330 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
330 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
331 $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too
331 $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too
332 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft
332 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft
333 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret
333 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret
334 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft
334 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft
335 $ ls ../push-dest/.hg/cache/branch2*
335 $ ls ../push-dest/.hg/cache/branch2*
336 ../push-dest/.hg/cache/branch2-base
336 ../push-dest/.hg/cache/branch2-base
337 ../push-dest/.hg/cache/branch2-served
337 ../push-dest/.hg/cache/branch2-served
338 ../push-dest/.hg/cache/branch2-visible
338 ../push-dest/.hg/cache/branch2-visible
339 $ cat ../push-dest/.hg/cache/branch2-served
339 $ cat ../push-dest/.hg/cache/branch2-served
340 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
340 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
341 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
341 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
342 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
342 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
343 $ cat ../push-dest/.hg/cache/branch2-visible
343 $ cat ../push-dest/.hg/cache/branch2-visible
344 6d6770faffce199f1fddd1cf87f6f026138cf061 6
344 6d6770faffce199f1fddd1cf87f6f026138cf061 6
345 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
345 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
346 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default
346 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default
347 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
347 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
348
348
349
349
350 Restore condition prior extra insertion.
350 Restore condition prior extra insertion.
351 $ hg -q --config extensions.mq= strip .
351 $ hg -q --config extensions.mq= strip .
352 $ hg up -q 7
352 $ hg up -q 7
353 $ cd ..
353 $ cd ..
354
354
355 Test secret changeset are not pull
355 Test secret changeset are not pull
356
356
357 $ hg init pull-dest
357 $ hg init pull-dest
358 $ cd pull-dest
358 $ cd pull-dest
359 $ hg pull ../initialrepo
359 $ hg pull ../initialrepo
360 pulling from ../initialrepo
360 pulling from ../initialrepo
361 requesting all changes
361 requesting all changes
362 adding changesets
362 adding changesets
363 adding manifests
363 adding manifests
364 adding file changes
364 adding file changes
365 added 5 changesets with 5 changes to 5 files (+1 heads)
365 added 5 changesets with 5 changes to 5 files (+1 heads)
366 new changesets 4a2df7238c3b:cf9fe039dfd6
366 new changesets 4a2df7238c3b:cf9fe039dfd6
367 test-debug-phase: new rev 0: x -> 0
367 test-debug-phase: new rev 0: x -> 0
368 test-debug-phase: new rev 1: x -> 0
368 test-debug-phase: new rev 1: x -> 0
369 test-debug-phase: new rev 2: x -> 0
369 test-debug-phase: new rev 2: x -> 0
370 test-debug-phase: new rev 3: x -> 0
370 test-debug-phase: new rev 3: x -> 0
371 test-debug-phase: new rev 4: x -> 0
371 test-debug-phase: new rev 4: x -> 0
372 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
372 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
373 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
373 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
374 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
374 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
375 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
375 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
376 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
376 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
377 (run 'hg heads' to see heads, 'hg merge' to merge)
377 (run 'hg heads' to see heads, 'hg merge' to merge)
378 $ hglog
378 $ hglog
379 o 4 0 B'
379 o 4 0 B'
380 |
380 |
381 | o 3 0 D
381 | o 3 0 D
382 | |
382 | |
383 | o 2 0 C
383 | o 2 0 C
384 |/
384 |/
385 o 1 0 B
385 o 1 0 B
386 |
386 |
387 o 0 0 A
387 o 0 0 A
388
388
389 $ cd ..
389 $ cd ..
390
390
391 But secret can still be bundled explicitly
391 But secret can still be bundled explicitly
392
392
393 $ cd initialrepo
393 $ cd initialrepo
394 $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg
394 $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg
395 4 changesets found
395 4 changesets found
396 $ cd ..
396 $ cd ..
397
397
398 Test secret changeset are not cloned
398 Test secret changeset are not cloned
399 (during local clone)
399 (during local clone)
400
400
401 $ hg clone -qU initialrepo clone-dest
401 $ hg clone -qU initialrepo clone-dest
402 test-debug-phase: new rev 0: x -> 0
402 test-debug-phase: new rev 0: x -> 0
403 test-debug-phase: new rev 1: x -> 0
403 test-debug-phase: new rev 1: x -> 0
404 test-debug-phase: new rev 2: x -> 0
404 test-debug-phase: new rev 2: x -> 0
405 test-debug-phase: new rev 3: x -> 0
405 test-debug-phase: new rev 3: x -> 0
406 test-debug-phase: new rev 4: x -> 0
406 test-debug-phase: new rev 4: x -> 0
407 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
407 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
408 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
408 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
409 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
409 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
410 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
410 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
411 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
411 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
412 $ hglog -R clone-dest
412 $ hglog -R clone-dest
413 o 4 0 B'
413 o 4 0 B'
414 |
414 |
415 | o 3 0 D
415 | o 3 0 D
416 | |
416 | |
417 | o 2 0 C
417 | o 2 0 C
418 |/
418 |/
419 o 1 0 B
419 o 1 0 B
420 |
420 |
421 o 0 0 A
421 o 0 0 A
422
422
423
423
424 Test summary
424 Test summary
425
425
426 $ hg summary -R clone-dest --verbose
426 $ hg summary -R clone-dest --verbose
427 parent: -1:000000000000 (no revision checked out)
427 parent: -1:000000000000 (no revision checked out)
428 branch: default
428 branch: default
429 commit: (clean)
429 commit: (clean)
430 update: 5 new changesets (update)
430 update: 5 new changesets (update)
431 $ hg summary -R initialrepo
431 $ hg summary -R initialrepo
432 parent: 7:17a481b3bccb tip
432 parent: 7:17a481b3bccb tip
433 merge B' and E
433 merge B' and E
434 branch: default
434 branch: default
435 commit: (clean) (secret)
435 commit: (clean) (secret)
436 update: 1 new changesets, 2 branch heads (merge)
436 update: 1 new changesets, 2 branch heads (merge)
437 phases: 3 draft, 3 secret
437 phases: 3 draft, 3 secret
438 $ hg summary -R initialrepo --quiet
438 $ hg summary -R initialrepo --quiet
439 parent: 7:17a481b3bccb tip
439 parent: 7:17a481b3bccb tip
440 update: 1 new changesets, 2 branch heads (merge)
440 update: 1 new changesets, 2 branch heads (merge)
441
441
442 Test revset
442 Test revset
443
443
444 $ cd initialrepo
444 $ cd initialrepo
445 $ hglog -r 'public()'
445 $ hglog -r 'public()'
446 o 1 0 B
446 o 1 0 B
447 |
447 |
448 o 0 0 A
448 o 0 0 A
449
449
450 $ hglog -r 'draft()'
450 $ hglog -r 'draft()'
451 o 6 1 B'
451 o 6 1 B'
452 |
452 |
453 ~
453 ~
454 o 3 1 D
454 o 3 1 D
455 |
455 |
456 o 2 1 C
456 o 2 1 C
457 |
457 |
458 ~
458 ~
459 $ hglog -r 'secret()'
459 $ hglog -r 'secret()'
460 @ 7 2 merge B' and E
460 @ 7 2 merge B' and E
461 |\
461 |\
462 | ~
462 | ~
463 | o 5 2 H
463 | o 5 2 H
464 |/
464 |/
465 o 4 2 E
465 o 4 2 E
466 |
466 |
467 ~
467 ~
468
468
469 test that phase are displayed in log at debug level
469 test that phase are displayed in log at debug level
470
470
471 $ hg log --debug
471 $ hg log --debug
472 changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af
472 changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af
473 tag: tip
473 tag: tip
474 phase: secret
474 phase: secret
475 parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
475 parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
476 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
476 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
477 manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8
477 manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8
478 user: test
478 user: test
479 date: Thu Jan 01 00:00:00 1970 +0000
479 date: Thu Jan 01 00:00:00 1970 +0000
480 extra: branch=default
480 extra: branch=default
481 description:
481 description:
482 merge B' and E
482 merge B' and E
483
483
484
484
485 changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
485 changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
486 phase: draft
486 phase: draft
487 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
487 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
488 parent: -1:0000000000000000000000000000000000000000
488 parent: -1:0000000000000000000000000000000000000000
489 manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
489 manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
490 user: test
490 user: test
491 date: Thu Jan 01 00:00:00 1970 +0000
491 date: Thu Jan 01 00:00:00 1970 +0000
492 files+: B'
492 files+: B'
493 extra: branch=default
493 extra: branch=default
494 description:
494 description:
495 B'
495 B'
496
496
497
497
498 changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8
498 changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8
499 phase: secret
499 phase: secret
500 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
500 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
501 parent: -1:0000000000000000000000000000000000000000
501 parent: -1:0000000000000000000000000000000000000000
502 manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
502 manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
503 user: test
503 user: test
504 date: Thu Jan 01 00:00:00 1970 +0000
504 date: Thu Jan 01 00:00:00 1970 +0000
505 files+: H
505 files+: H
506 extra: branch=default
506 extra: branch=default
507 description:
507 description:
508 H
508 H
509
509
510
510
511 changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
511 changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
512 phase: secret
512 phase: secret
513 parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
513 parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
514 parent: -1:0000000000000000000000000000000000000000
514 parent: -1:0000000000000000000000000000000000000000
515 manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
515 manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
516 user: test
516 user: test
517 date: Thu Jan 01 00:00:00 1970 +0000
517 date: Thu Jan 01 00:00:00 1970 +0000
518 files+: E
518 files+: E
519 extra: branch=default
519 extra: branch=default
520 description:
520 description:
521 E
521 E
522
522
523
523
524 changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
524 changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
525 phase: draft
525 phase: draft
526 parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
526 parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
527 parent: -1:0000000000000000000000000000000000000000
527 parent: -1:0000000000000000000000000000000000000000
528 manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
528 manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
529 user: test
529 user: test
530 date: Thu Jan 01 00:00:00 1970 +0000
530 date: Thu Jan 01 00:00:00 1970 +0000
531 files+: D
531 files+: D
532 extra: branch=default
532 extra: branch=default
533 description:
533 description:
534 D
534 D
535
535
536
536
537 changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
537 changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
538 phase: draft
538 phase: draft
539 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
539 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
540 parent: -1:0000000000000000000000000000000000000000
540 parent: -1:0000000000000000000000000000000000000000
541 manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4
541 manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4
542 user: test
542 user: test
543 date: Thu Jan 01 00:00:00 1970 +0000
543 date: Thu Jan 01 00:00:00 1970 +0000
544 files+: C
544 files+: C
545 extra: branch=default
545 extra: branch=default
546 description:
546 description:
547 C
547 C
548
548
549
549
550 changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
550 changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
551 phase: public
551 phase: public
552 parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
552 parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
553 parent: -1:0000000000000000000000000000000000000000
553 parent: -1:0000000000000000000000000000000000000000
554 manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
554 manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
555 user: test
555 user: test
556 date: Thu Jan 01 00:00:00 1970 +0000
556 date: Thu Jan 01 00:00:00 1970 +0000
557 files+: B
557 files+: B
558 extra: branch=default
558 extra: branch=default
559 description:
559 description:
560 B
560 B
561
561
562
562
563 changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
563 changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
564 phase: public
564 phase: public
565 parent: -1:0000000000000000000000000000000000000000
565 parent: -1:0000000000000000000000000000000000000000
566 parent: -1:0000000000000000000000000000000000000000
566 parent: -1:0000000000000000000000000000000000000000
567 manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
567 manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
568 user: test
568 user: test
569 date: Thu Jan 01 00:00:00 1970 +0000
569 date: Thu Jan 01 00:00:00 1970 +0000
570 files+: A
570 files+: A
571 extra: branch=default
571 extra: branch=default
572 description:
572 description:
573 A
573 A
574
574
575
575
576
576
577
577
578 (Issue3707)
578 (Issue3707)
579 test invalid phase name
579 test invalid phase name
580
580
581 $ mkcommit I --config phases.new-commit='babar'
581 $ mkcommit I --config phases.new-commit='babar'
582 transaction abort!
582 transaction abort!
583 rollback completed
583 rollback completed
584 config error: phases.new-commit: not a valid phase name ('babar')
584 config error: phases.new-commit: not a valid phase name ('babar')
585 [30]
585 [30]
586 Test phase command
586 Test phase command
587 ===================
587 ===================
588
588
589 initial picture
589 initial picture
590
590
591 $ hg log -G --template "{rev} {phase} {desc}\n"
591 $ hg log -G --template "{rev} {phase} {desc}\n"
592 @ 7 secret merge B' and E
592 @ 7 secret merge B' and E
593 |\
593 |\
594 | o 6 draft B'
594 | o 6 draft B'
595 | |
595 | |
596 +---o 5 secret H
596 +---o 5 secret H
597 | |
597 | |
598 o | 4 secret E
598 o | 4 secret E
599 | |
599 | |
600 o | 3 draft D
600 o | 3 draft D
601 | |
601 | |
602 o | 2 draft C
602 o | 2 draft C
603 |/
603 |/
604 o 1 public B
604 o 1 public B
605 |
605 |
606 o 0 public A
606 o 0 public A
607
607
608
608
609 display changesets phase
609 display changesets phase
610
610
611 (mixing -r and plain rev specification)
611 (mixing -r and plain rev specification)
612
612
613 $ hg phase 1::4 -r 7
613 $ hg phase 1::4 -r 7
614 1: public
614 1: public
615 2: draft
615 2: draft
616 3: draft
616 3: draft
617 4: secret
617 4: secret
618 7: secret
618 7: secret
619
619
620
620
621 move changeset forward
621 move changeset forward
622
622
623 (with -r option)
623 (with -r option)
624
624
625 $ hg phase --public -r 2
625 $ hg phase --public -r 2
626 test-debug-phase: move rev 2: 1 -> 0
626 test-debug-phase: move rev 2: 1 -> 0
627 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public
627 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public
628 $ hg log -G --template "{rev} {phase} {desc}\n"
628 $ hg log -G --template "{rev} {phase} {desc}\n"
629 @ 7 secret merge B' and E
629 @ 7 secret merge B' and E
630 |\
630 |\
631 | o 6 draft B'
631 | o 6 draft B'
632 | |
632 | |
633 +---o 5 secret H
633 +---o 5 secret H
634 | |
634 | |
635 o | 4 secret E
635 o | 4 secret E
636 | |
636 | |
637 o | 3 draft D
637 o | 3 draft D
638 | |
638 | |
639 o | 2 public C
639 o | 2 public C
640 |/
640 |/
641 o 1 public B
641 o 1 public B
642 |
642 |
643 o 0 public A
643 o 0 public A
644
644
645
645
646 move changeset backward
646 move changeset backward
647
647
648 (without -r option)
648 (without -r option)
649
649
650 $ hg phase --draft --force 2
650 $ hg phase --draft --force 2
651 test-debug-phase: move rev 2: 0 -> 1
651 test-debug-phase: move rev 2: 0 -> 1
652 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft
652 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft
653 $ hg log -G --template "{rev} {phase} {desc}\n"
653 $ hg log -G --template "{rev} {phase} {desc}\n"
654 @ 7 secret merge B' and E
654 @ 7 secret merge B' and E
655 |\
655 |\
656 | o 6 draft B'
656 | o 6 draft B'
657 | |
657 | |
658 +---o 5 secret H
658 +---o 5 secret H
659 | |
659 | |
660 o | 4 secret E
660 o | 4 secret E
661 | |
661 | |
662 o | 3 draft D
662 o | 3 draft D
663 | |
663 | |
664 o | 2 draft C
664 o | 2 draft C
665 |/
665 |/
666 o 1 public B
666 o 1 public B
667 |
667 |
668 o 0 public A
668 o 0 public A
669
669
670
670
671 move changeset forward and backward
671 move changeset forward and backward
672
672
673 $ hg phase --draft --force 1::4
673 $ hg phase --draft --force 1::4
674 test-debug-phase: move rev 1: 0 -> 1
674 test-debug-phase: move rev 1: 0 -> 1
675 test-debug-phase: move rev 4: 2 -> 1
675 test-debug-phase: move rev 4: 2 -> 1
676 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft
676 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft
677 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft
677 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft
678 $ hg log -G --template "{rev} {phase} {desc}\n"
678 $ hg log -G --template "{rev} {phase} {desc}\n"
679 @ 7 secret merge B' and E
679 @ 7 secret merge B' and E
680 |\
680 |\
681 | o 6 draft B'
681 | o 6 draft B'
682 | |
682 | |
683 +---o 5 secret H
683 +---o 5 secret H
684 | |
684 | |
685 o | 4 draft E
685 o | 4 draft E
686 | |
686 | |
687 o | 3 draft D
687 o | 3 draft D
688 | |
688 | |
689 o | 2 draft C
689 o | 2 draft C
690 |/
690 |/
691 o 1 draft B
691 o 1 draft B
692 |
692 |
693 o 0 public A
693 o 0 public A
694
694
695 test partial failure
695 test partial failure
696
696
697 $ hg phase --public 7
697 $ hg phase --public 7
698 test-debug-phase: move rev 1: 1 -> 0
698 test-debug-phase: move rev 1: 1 -> 0
699 test-debug-phase: move rev 2: 1 -> 0
699 test-debug-phase: move rev 2: 1 -> 0
700 test-debug-phase: move rev 3: 1 -> 0
700 test-debug-phase: move rev 3: 1 -> 0
701 test-debug-phase: move rev 4: 1 -> 0
701 test-debug-phase: move rev 4: 1 -> 0
702 test-debug-phase: move rev 6: 1 -> 0
702 test-debug-phase: move rev 6: 1 -> 0
703 test-debug-phase: move rev 7: 2 -> 0
703 test-debug-phase: move rev 7: 2 -> 0
704 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public
704 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public
705 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public
705 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public
706 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public
706 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public
707 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public
707 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public
708 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public
708 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public
709 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public
709 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public
710 $ hg phase --draft '5 or 7'
710 $ hg phase --draft '5 or 7'
711 test-debug-phase: move rev 5: 2 -> 1
711 test-debug-phase: move rev 5: 2 -> 1
712 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft
712 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft
713 cannot move 1 changesets to a higher phase, use --force
713 cannot move 1 changesets to a higher phase, use --force
714 phase changed for 1 changesets
714 phase changed for 1 changesets
715 [1]
715 [1]
716 $ hg log -G --template "{rev} {phase} {desc}\n"
716 $ hg log -G --template "{rev} {phase} {desc}\n"
717 @ 7 public merge B' and E
717 @ 7 public merge B' and E
718 |\
718 |\
719 | o 6 public B'
719 | o 6 public B'
720 | |
720 | |
721 +---o 5 draft H
721 +---o 5 draft H
722 | |
722 | |
723 o | 4 public E
723 o | 4 public E
724 | |
724 | |
725 o | 3 public D
725 o | 3 public D
726 | |
726 | |
727 o | 2 public C
727 o | 2 public C
728 |/
728 |/
729 o 1 public B
729 o 1 public B
730 |
730 |
731 o 0 public A
731 o 0 public A
732
732
733
733
734 test complete failure
734 test complete failure
735
735
736 $ hg phase --draft 7
736 $ hg phase --draft 7
737 cannot move 1 changesets to a higher phase, use --force
737 cannot move 1 changesets to a higher phase, use --force
738 no phases changed
738 no phases changed
739 [1]
739 [1]
740
740
741 $ cd ..
741 $ cd ..
742
742
743 test hidden changeset are not cloned as public (issue3935)
743 test hidden changeset are not cloned as public (issue3935)
744
744
745 $ cd initialrepo
745 $ cd initialrepo
746
746
747 (enabling evolution)
747 (enabling evolution)
748 $ cat >> $HGRCPATH << EOF
748 $ cat >> $HGRCPATH << EOF
749 > [experimental]
749 > [experimental]
750 > evolution.createmarkers=True
750 > evolution.createmarkers=True
751 > EOF
751 > EOF
752
752
753 (making a changeset hidden; H in that case)
753 (making a changeset hidden; H in that case)
754 $ hg debugobsolete `hg id --debug -r 5`
754 $ hg debugobsolete `hg id --debug -r 5`
755 1 new obsolescence markers
755 1 new obsolescence markers
756 obsoleted 1 changesets
756 obsoleted 1 changesets
757
757
758 $ cd ..
758 $ cd ..
759 $ hg clone initialrepo clonewithobs
759 $ hg clone initialrepo clonewithobs
760 requesting all changes
760 requesting all changes
761 adding changesets
761 adding changesets
762 adding manifests
762 adding manifests
763 adding file changes
763 adding file changes
764 added 7 changesets with 6 changes to 6 files
764 added 7 changesets with 6 changes to 6 files
765 new changesets 4a2df7238c3b:17a481b3bccb
765 new changesets 4a2df7238c3b:17a481b3bccb
766 test-debug-phase: new rev 0: x -> 0
766 test-debug-phase: new rev 0: x -> 0
767 test-debug-phase: new rev 1: x -> 0
767 test-debug-phase: new rev 1: x -> 0
768 test-debug-phase: new rev 2: x -> 0
768 test-debug-phase: new rev 2: x -> 0
769 test-debug-phase: new rev 3: x -> 0
769 test-debug-phase: new rev 3: x -> 0
770 test-debug-phase: new rev 4: x -> 0
770 test-debug-phase: new rev 4: x -> 0
771 test-debug-phase: new rev 5: x -> 0
771 test-debug-phase: new rev 5: x -> 0
772 test-debug-phase: new rev 6: x -> 0
772 test-debug-phase: new rev 6: x -> 0
773 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
773 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public
774 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
774 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public
775 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
775 test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public
776 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
776 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public
777 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public
777 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public
778 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
778 test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public
779 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public
779 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public
780 updating to branch default
780 updating to branch default
781 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
781 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
782 $ cd clonewithobs
782 $ cd clonewithobs
783 $ hg log -G --template "{rev} {phase} {desc}\n"
783 $ hg log -G --template "{rev} {phase} {desc}\n"
784 @ 6 public merge B' and E
784 @ 6 public merge B' and E
785 |\
785 |\
786 | o 5 public B'
786 | o 5 public B'
787 | |
787 | |
788 o | 4 public E
788 o | 4 public E
789 | |
789 | |
790 o | 3 public D
790 o | 3 public D
791 | |
791 | |
792 o | 2 public C
792 o | 2 public C
793 |/
793 |/
794 o 1 public B
794 o 1 public B
795 |
795 |
796 o 0 public A
796 o 0 public A
797
797
798
798
799 test verify repo containing hidden changesets, which should not abort just
799 test verify repo containing hidden changesets, which should not abort just
800 because repo.cancopy() is False
800 because repo.cancopy() is False
801
801
802 $ cd ../initialrepo
802 $ cd ../initialrepo
803 $ hg verify
803 $ hg verify -q
804 checking changesets
805 checking manifests
806 crosschecking files in changesets and manifests
807 checking files
808 checked 8 changesets with 7 changes to 7 files
809
804
810 $ cd ..
805 $ cd ..
811
806
812 check whether HG_PENDING makes pending changes only in related
807 check whether HG_PENDING makes pending changes only in related
813 repositories visible to an external hook.
808 repositories visible to an external hook.
814
809
815 (emulate a transaction running concurrently by copied
810 (emulate a transaction running concurrently by copied
816 .hg/phaseroots.pending in subsequent test)
811 .hg/phaseroots.pending in subsequent test)
817
812
818 $ cat > $TESTTMP/savepending.sh <<EOF
813 $ cat > $TESTTMP/savepending.sh <<EOF
819 > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved
814 > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved
820 > exit 1 # to avoid changing phase for subsequent tests
815 > exit 1 # to avoid changing phase for subsequent tests
821 > EOF
816 > EOF
822 $ cd push-dest
817 $ cd push-dest
823 $ hg phase 6
818 $ hg phase 6
824 6: draft
819 6: draft
825 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6
820 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6
826 transaction abort!
821 transaction abort!
827 rollback completed
822 rollback completed
828 abort: pretxnclose hook exited with status 1
823 abort: pretxnclose hook exited with status 1
829 [40]
824 [40]
830 $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending
825 $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending
831
826
832 (check (in)visibility of phaseroot while transaction running in repo)
827 (check (in)visibility of phaseroot while transaction running in repo)
833
828
834 $ cat > $TESTTMP/checkpending.sh <<EOF
829 $ cat > $TESTTMP/checkpending.sh <<EOF
835 > echo '@initialrepo'
830 > echo '@initialrepo'
836 > hg -R "$TESTTMP/initialrepo" phase 7
831 > hg -R "$TESTTMP/initialrepo" phase 7
837 > echo '@push-dest'
832 > echo '@push-dest'
838 > hg -R "$TESTTMP/push-dest" phase 6
833 > hg -R "$TESTTMP/push-dest" phase 6
839 > exit 1 # to avoid changing phase for subsequent tests
834 > exit 1 # to avoid changing phase for subsequent tests
840 > EOF
835 > EOF
841 $ cd ../initialrepo
836 $ cd ../initialrepo
842 $ hg phase 7
837 $ hg phase 7
843 7: public
838 7: public
844 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7
839 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7
845 @initialrepo
840 @initialrepo
846 7: secret
841 7: secret
847 @push-dest
842 @push-dest
848 6: draft
843 6: draft
849 transaction abort!
844 transaction abort!
850 rollback completed
845 rollback completed
851 abort: pretxnclose hook exited with status 1
846 abort: pretxnclose hook exited with status 1
852 [40]
847 [40]
853
848
854 Check that pretxnclose-phase hook can control phase movement
849 Check that pretxnclose-phase hook can control phase movement
855
850
856 $ hg phase --force b3325c91a4d9 --secret
851 $ hg phase --force b3325c91a4d9 --secret
857 test-debug-phase: move rev 3: 0 -> 2
852 test-debug-phase: move rev 3: 0 -> 2
858 test-debug-phase: move rev 4: 0 -> 2
853 test-debug-phase: move rev 4: 0 -> 2
859 test-debug-phase: move rev 5: 1 -> 2
854 test-debug-phase: move rev 5: 1 -> 2
860 test-debug-phase: move rev 7: 0 -> 2
855 test-debug-phase: move rev 7: 0 -> 2
861 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret
856 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret
862 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret
857 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret
863 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret
858 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret
864 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret
859 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret
865 $ hg log -G -T phases
860 $ hg log -G -T phases
866 @ changeset: 7:17a481b3bccb
861 @ changeset: 7:17a481b3bccb
867 |\ tag: tip
862 |\ tag: tip
868 | | phase: secret
863 | | phase: secret
869 | | parent: 6:cf9fe039dfd6
864 | | parent: 6:cf9fe039dfd6
870 | | parent: 4:a603bfb5a83e
865 | | parent: 4:a603bfb5a83e
871 | | user: test
866 | | user: test
872 | | date: Thu Jan 01 00:00:00 1970 +0000
867 | | date: Thu Jan 01 00:00:00 1970 +0000
873 | | summary: merge B' and E
868 | | summary: merge B' and E
874 | |
869 | |
875 | o changeset: 6:cf9fe039dfd6
870 | o changeset: 6:cf9fe039dfd6
876 | | phase: public
871 | | phase: public
877 | | parent: 1:27547f69f254
872 | | parent: 1:27547f69f254
878 | | user: test
873 | | user: test
879 | | date: Thu Jan 01 00:00:00 1970 +0000
874 | | date: Thu Jan 01 00:00:00 1970 +0000
880 | | summary: B'
875 | | summary: B'
881 | |
876 | |
882 o | changeset: 4:a603bfb5a83e
877 o | changeset: 4:a603bfb5a83e
883 | | phase: secret
878 | | phase: secret
884 | | user: test
879 | | user: test
885 | | date: Thu Jan 01 00:00:00 1970 +0000
880 | | date: Thu Jan 01 00:00:00 1970 +0000
886 | | summary: E
881 | | summary: E
887 | |
882 | |
888 o | changeset: 3:b3325c91a4d9
883 o | changeset: 3:b3325c91a4d9
889 | | phase: secret
884 | | phase: secret
890 | | user: test
885 | | user: test
891 | | date: Thu Jan 01 00:00:00 1970 +0000
886 | | date: Thu Jan 01 00:00:00 1970 +0000
892 | | summary: D
887 | | summary: D
893 | |
888 | |
894 o | changeset: 2:f838bfaca5c7
889 o | changeset: 2:f838bfaca5c7
895 |/ phase: public
890 |/ phase: public
896 | user: test
891 | user: test
897 | date: Thu Jan 01 00:00:00 1970 +0000
892 | date: Thu Jan 01 00:00:00 1970 +0000
898 | summary: C
893 | summary: C
899 |
894 |
900 o changeset: 1:27547f69f254
895 o changeset: 1:27547f69f254
901 | phase: public
896 | phase: public
902 | user: test
897 | user: test
903 | date: Thu Jan 01 00:00:00 1970 +0000
898 | date: Thu Jan 01 00:00:00 1970 +0000
904 | summary: B
899 | summary: B
905 |
900 |
906 o changeset: 0:4a2df7238c3b
901 o changeset: 0:4a2df7238c3b
907 phase: public
902 phase: public
908 user: test
903 user: test
909 date: Thu Jan 01 00:00:00 1970 +0000
904 date: Thu Jan 01 00:00:00 1970 +0000
910 summary: A
905 summary: A
911
906
912
907
913 Install a hook that prevent b3325c91a4d9 to become public
908 Install a hook that prevent b3325c91a4d9 to become public
914
909
915 $ cat >> .hg/hgrc << EOF
910 $ cat >> .hg/hgrc << EOF
916 > [hooks]
911 > [hooks]
917 > pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]"
912 > pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]"
918 > EOF
913 > EOF
919
914
920 Try various actions. only the draft move should succeed
915 Try various actions. only the draft move should succeed
921
916
922 $ hg phase --public b3325c91a4d9
917 $ hg phase --public b3325c91a4d9
923 transaction abort!
918 transaction abort!
924 rollback completed
919 rollback completed
925 abort: pretxnclose-phase.nopublish_D hook exited with status 1
920 abort: pretxnclose-phase.nopublish_D hook exited with status 1
926 [40]
921 [40]
927 $ hg phase --public a603bfb5a83e
922 $ hg phase --public a603bfb5a83e
928 transaction abort!
923 transaction abort!
929 rollback completed
924 rollback completed
930 abort: pretxnclose-phase.nopublish_D hook exited with status 1
925 abort: pretxnclose-phase.nopublish_D hook exited with status 1
931 [40]
926 [40]
932 $ hg phase --draft 17a481b3bccb
927 $ hg phase --draft 17a481b3bccb
933 test-debug-phase: move rev 3: 2 -> 1
928 test-debug-phase: move rev 3: 2 -> 1
934 test-debug-phase: move rev 4: 2 -> 1
929 test-debug-phase: move rev 4: 2 -> 1
935 test-debug-phase: move rev 7: 2 -> 1
930 test-debug-phase: move rev 7: 2 -> 1
936 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft
931 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft
937 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft
932 test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft
938 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft
933 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft
939 $ hg phase --public 17a481b3bccb
934 $ hg phase --public 17a481b3bccb
940 transaction abort!
935 transaction abort!
941 rollback completed
936 rollback completed
942 abort: pretxnclose-phase.nopublish_D hook exited with status 1
937 abort: pretxnclose-phase.nopublish_D hook exited with status 1
943 [40]
938 [40]
944
939
945 $ cd ..
940 $ cd ..
946
941
947 Test for the "internal" phase
942 Test for the "internal" phase
948 =============================
943 =============================
949
944
950 Check we deny its usage on older repository
945 Check we deny its usage on older repository
951
946
952 $ hg init no-internal-phase --config format.use-internal-phase=no
947 $ hg init no-internal-phase --config format.use-internal-phase=no
953 $ cd no-internal-phase
948 $ cd no-internal-phase
954 $ hg debugrequires | grep internal-phase
949 $ hg debugrequires | grep internal-phase
955 [1]
950 [1]
956 $ echo X > X
951 $ echo X > X
957 $ hg add X
952 $ hg add X
958 $ hg status
953 $ hg status
959 A X
954 A X
960 $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" 2>&1 | grep ProgrammingError
955 $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" 2>&1 | grep ProgrammingError
961 ** ProgrammingError: this repository does not support the internal phase
956 ** ProgrammingError: this repository does not support the internal phase
962 raise error.ProgrammingError(msg) (no-pyoxidizer !)
957 raise error.ProgrammingError(msg) (no-pyoxidizer !)
963 *ProgrammingError: this repository does not support the internal phase (glob)
958 *ProgrammingError: this repository does not support the internal phase (glob)
964 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" 2>&1 | grep ProgrammingError
959 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" 2>&1 | grep ProgrammingError
965 ** ProgrammingError: this repository does not support the archived phase
960 ** ProgrammingError: this repository does not support the archived phase
966 raise error.ProgrammingError(msg) (no-pyoxidizer !)
961 raise error.ProgrammingError(msg) (no-pyoxidizer !)
967 *ProgrammingError: this repository does not support the archived phase (glob)
962 *ProgrammingError: this repository does not support the archived phase (glob)
968
963
969 $ cd ..
964 $ cd ..
970
965
971 Check it works fine with repository that supports it.
966 Check it works fine with repository that supports it.
972
967
973 $ hg init internal-phase --config format.use-internal-phase=yes
968 $ hg init internal-phase --config format.use-internal-phase=yes
974 $ cd internal-phase
969 $ cd internal-phase
975 $ hg debugrequires | grep internal-phase
970 $ hg debugrequires | grep internal-phase
976 internal-phase-2
971 internal-phase-2
977 $ mkcommit A
972 $ mkcommit A
978 test-debug-phase: new rev 0: x -> 1
973 test-debug-phase: new rev 0: x -> 1
979 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
974 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
980
975
981 Commit an internal changesets
976 Commit an internal changesets
982
977
983 $ echo B > B
978 $ echo B > B
984 $ hg add B
979 $ hg add B
985 $ hg status
980 $ hg status
986 A B
981 A B
987 $ hg --config "phases.new-commit=internal" commit -m "my test internal commit"
982 $ hg --config "phases.new-commit=internal" commit -m "my test internal commit"
988 test-debug-phase: new rev 1: x -> 96
983 test-debug-phase: new rev 1: x -> 96
989 test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal
984 test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal
990
985
991 The changeset is a working parent descendant.
986 The changeset is a working parent descendant.
992 Per the usual visibility rules, it is made visible.
987 Per the usual visibility rules, it is made visible.
993
988
994 $ hg log -G -l 3
989 $ hg log -G -l 3
995 @ changeset: 1:c01c42dffc7f
990 @ changeset: 1:c01c42dffc7f
996 | tag: tip
991 | tag: tip
997 | user: test
992 | user: test
998 | date: Thu Jan 01 00:00:00 1970 +0000
993 | date: Thu Jan 01 00:00:00 1970 +0000
999 | summary: my test internal commit
994 | summary: my test internal commit
1000 |
995 |
1001 o changeset: 0:4a2df7238c3b
996 o changeset: 0:4a2df7238c3b
1002 user: test
997 user: test
1003 date: Thu Jan 01 00:00:00 1970 +0000
998 date: Thu Jan 01 00:00:00 1970 +0000
1004 summary: A
999 summary: A
1005
1000
1006
1001
1007 Commit is hidden as expected
1002 Commit is hidden as expected
1008
1003
1009 $ hg up 0
1004 $ hg up 0
1010 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1005 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1011 $ hg log -G
1006 $ hg log -G
1012 @ changeset: 0:4a2df7238c3b
1007 @ changeset: 0:4a2df7238c3b
1013 tag: tip
1008 tag: tip
1014 user: test
1009 user: test
1015 date: Thu Jan 01 00:00:00 1970 +0000
1010 date: Thu Jan 01 00:00:00 1970 +0000
1016 summary: A
1011 summary: A
1017
1012
1018
1013
1019 Test for archived phase
1014 Test for archived phase
1020 -----------------------
1015 -----------------------
1021
1016
1022 Commit an archived changesets
1017 Commit an archived changesets
1023
1018
1024 $ cd ..
1019 $ cd ..
1025 $ hg clone --quiet --pull internal-phase archived-phase \
1020 $ hg clone --quiet --pull internal-phase archived-phase \
1026 > --config format.exp-archived-phase=yes \
1021 > --config format.exp-archived-phase=yes \
1027 > --config extensions.phasereport='!' \
1022 > --config extensions.phasereport='!' \
1028 > --config hooks.txnclose-phase.test=
1023 > --config hooks.txnclose-phase.test=
1029
1024
1030 $ cd archived-phase
1025 $ cd archived-phase
1031
1026
1032 $ echo B > B
1027 $ echo B > B
1033 $ hg add B
1028 $ hg add B
1034 $ hg status
1029 $ hg status
1035 A B
1030 A B
1036 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit"
1031 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit"
1037 test-debug-phase: new rev 1: x -> 32
1032 test-debug-phase: new rev 1: x -> 32
1038 test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived
1033 test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived
1039
1034
1040 The changeset is a working parent descendant.
1035 The changeset is a working parent descendant.
1041 Per the usual visibility rules, it is made visible.
1036 Per the usual visibility rules, it is made visible.
1042
1037
1043 $ hg log -G -l 3
1038 $ hg log -G -l 3
1044 @ changeset: 1:8df5997c3361
1039 @ changeset: 1:8df5997c3361
1045 | tag: tip
1040 | tag: tip
1046 | user: test
1041 | user: test
1047 | date: Thu Jan 01 00:00:00 1970 +0000
1042 | date: Thu Jan 01 00:00:00 1970 +0000
1048 | summary: my test archived commit
1043 | summary: my test archived commit
1049 |
1044 |
1050 o changeset: 0:4a2df7238c3b
1045 o changeset: 0:4a2df7238c3b
1051 user: test
1046 user: test
1052 date: Thu Jan 01 00:00:00 1970 +0000
1047 date: Thu Jan 01 00:00:00 1970 +0000
1053 summary: A
1048 summary: A
1054
1049
1055
1050
1056 Commit is hidden as expected
1051 Commit is hidden as expected
1057
1052
1058 $ hg up 0
1053 $ hg up 0
1059 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1054 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1060 $ hg log -G
1055 $ hg log -G
1061 @ changeset: 0:4a2df7238c3b
1056 @ changeset: 0:4a2df7238c3b
1062 tag: tip
1057 tag: tip
1063 user: test
1058 user: test
1064 date: Thu Jan 01 00:00:00 1970 +0000
1059 date: Thu Jan 01 00:00:00 1970 +0000
1065 summary: A
1060 summary: A
1066
1061
1067 $ cd ..
1062 $ cd ..
1068
1063
1069 Recommitting an exact match of a public commit shouldn't change it to
1064 Recommitting an exact match of a public commit shouldn't change it to
1070 draft:
1065 draft:
1071
1066
1072 $ cd initialrepo
1067 $ cd initialrepo
1073 $ hg phase -r 2
1068 $ hg phase -r 2
1074 2: public
1069 2: public
1075 $ hg up -C 1
1070 $ hg up -C 1
1076 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
1071 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
1077 $ mkcommit C
1072 $ mkcommit C
1078 warning: commit already existed in the repository!
1073 warning: commit already existed in the repository!
1079 $ hg phase -r 2
1074 $ hg phase -r 2
1080 2: public
1075 2: public
1081
1076
1082 Same, but for secret:
1077 Same, but for secret:
1083
1078
1084 $ hg up 7
1079 $ hg up 7
1085 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1080 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1086 $ mkcommit F -s
1081 $ mkcommit F -s
1087 test-debug-phase: new rev 8: x -> 2
1082 test-debug-phase: new rev 8: x -> 2
1088 test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret
1083 test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret
1089 $ hg up 7
1084 $ hg up 7
1090 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1085 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1091 $ hg phase
1086 $ hg phase
1092 7: draft
1087 7: draft
1093 $ mkcommit F
1088 $ mkcommit F
1094 test-debug-phase: new rev 8: x -> 2
1089 test-debug-phase: new rev 8: x -> 2
1095 warning: commit already existed in the repository!
1090 warning: commit already existed in the repository!
1096 test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret
1091 test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret
1097 $ hg phase -r tip
1092 $ hg phase -r tip
1098 8: secret
1093 8: secret
1099
1094
1100 But what about obsoleted changesets?
1095 But what about obsoleted changesets?
1101
1096
1102 $ hg up 4
1097 $ hg up 4
1103 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1098 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1104 $ mkcommit H
1099 $ mkcommit H
1105 test-debug-phase: new rev 5: x -> 2
1100 test-debug-phase: new rev 5: x -> 2
1106 warning: commit already existed in the repository!
1101 warning: commit already existed in the repository!
1107 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret
1102 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret
1108 $ hg phase -r 5
1103 $ hg phase -r 5
1109 5: secret
1104 5: secret
1110 $ hg par
1105 $ hg par
1111 changeset: 5:a030c6be5127
1106 changeset: 5:a030c6be5127
1112 user: test
1107 user: test
1113 date: Thu Jan 01 00:00:00 1970 +0000
1108 date: Thu Jan 01 00:00:00 1970 +0000
1114 obsolete: pruned
1109 obsolete: pruned
1115 summary: H
1110 summary: H
1116
1111
1117 $ hg up tip
1112 $ hg up tip
1118 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1113 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1119 $ cd ..
1114 $ cd ..
1120
1115
1121 Testing that command line flags override configuration
1116 Testing that command line flags override configuration
1122
1117
1123 $ hg init commit-overrides
1118 $ hg init commit-overrides
1124 $ cd commit-overrides
1119 $ cd commit-overrides
1125
1120
1126 `hg commit --draft` overrides new-commit=secret
1121 `hg commit --draft` overrides new-commit=secret
1127
1122
1128 $ mkcommit A --config phases.new-commit='secret' --draft
1123 $ mkcommit A --config phases.new-commit='secret' --draft
1129 test-debug-phase: new rev 0: x -> 1
1124 test-debug-phase: new rev 0: x -> 1
1130 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
1125 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft
1131 $ hglog
1126 $ hglog
1132 @ 0 1 A
1127 @ 0 1 A
1133
1128
1134
1129
1135 `hg commit --secret` overrides new-commit=draft
1130 `hg commit --secret` overrides new-commit=draft
1136
1131
1137 $ mkcommit B --config phases.new-commit='draft' --secret
1132 $ mkcommit B --config phases.new-commit='draft' --secret
1138 test-debug-phase: new rev 1: x -> 2
1133 test-debug-phase: new rev 1: x -> 2
1139 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> secret
1134 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> secret
1140 $ hglog
1135 $ hglog
1141 @ 1 2 B
1136 @ 1 2 B
1142 |
1137 |
1143 o 0 1 A
1138 o 0 1 A
1144
1139
1145
1140
1146 $ cd ..
1141 $ cd ..
@@ -1,127 +1,117
1 #require serve
1 #require serve
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5
5
6 $ echo foo>foo
6 $ echo foo>foo
7 $ hg addremove
7 $ hg addremove
8 adding foo
8 adding foo
9 $ hg commit -m 1
9 $ hg commit -m 1
10
10
11 $ hg verify
11 $ hg verify -q
12 checking changesets
13 checking manifests
14 crosschecking files in changesets and manifests
15 checking files
16 checked 1 changesets with 1 changes to 1 files
17
12
18 $ hg serve -p $HGPORT -d --pid-file=hg.pid
13 $ hg serve -p $HGPORT -d --pid-file=hg.pid
19 $ cat hg.pid >> $DAEMON_PIDS
14 $ cat hg.pid >> $DAEMON_PIDS
20 $ cd ..
15 $ cd ..
21
16
22 $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy
17 $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy
23 requesting all changes
18 requesting all changes
24 adding changesets
19 adding changesets
25 adding manifests
20 adding manifests
26 adding file changes
21 adding file changes
27 added 1 changesets with 1 changes to 1 files
22 added 1 changesets with 1 changes to 1 files
28 new changesets 340e38bdcde4
23 new changesets 340e38bdcde4
29 updating to branch default
24 updating to branch default
30 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
31
26
32 $ cd copy
27 $ cd copy
33 $ hg verify
28 $ hg verify -q
34 checking changesets
35 checking manifests
36 crosschecking files in changesets and manifests
37 checking files
38 checked 1 changesets with 1 changes to 1 files
39
29
40 $ hg co
30 $ hg co
41 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 $ cat foo
32 $ cat foo
43 foo
33 foo
44
34
45 $ hg manifest --debug
35 $ hg manifest --debug
46 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
36 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
47
37
48 $ hg pull
38 $ hg pull
49 pulling from http://foo@localhost:$HGPORT/
39 pulling from http://foo@localhost:$HGPORT/
50 searching for changes
40 searching for changes
51 no changes found
41 no changes found
52
42
53 $ hg rollback --dry-run --verbose
43 $ hg rollback --dry-run --verbose
54 repository tip rolled back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
44 repository tip rolled back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
55
45
56 Test pull of non-existing 20 character revision specification, making sure plain ascii identifiers
46 Test pull of non-existing 20 character revision specification, making sure plain ascii identifiers
57 not are encoded like a node:
47 not are encoded like a node:
58
48
59 $ hg pull -r 'xxxxxxxxxxxxxxxxxxxy'
49 $ hg pull -r 'xxxxxxxxxxxxxxxxxxxy'
60 pulling from http://foo@localhost:$HGPORT/
50 pulling from http://foo@localhost:$HGPORT/
61 abort: unknown revision 'xxxxxxxxxxxxxxxxxxxy'
51 abort: unknown revision 'xxxxxxxxxxxxxxxxxxxy'
62 [255]
52 [255]
63 $ hg pull -r 'xxxxxxxxxxxxxxxxxx y'
53 $ hg pull -r 'xxxxxxxxxxxxxxxxxx y'
64 pulling from http://foo@localhost:$HGPORT/
54 pulling from http://foo@localhost:$HGPORT/
65 abort: unknown revision 'xxxxxxxxxxxxxxxxxx y'
55 abort: unknown revision 'xxxxxxxxxxxxxxxxxx y'
66 [255]
56 [255]
67
57
68 Test pull of working copy revision
58 Test pull of working copy revision
69 $ hg pull -r 'ffffffffffff'
59 $ hg pull -r 'ffffffffffff'
70 pulling from http://foo@localhost:$HGPORT/
60 pulling from http://foo@localhost:$HGPORT/
71 abort: unknown revision 'ffffffffffff'
61 abort: unknown revision 'ffffffffffff'
72 [255]
62 [255]
73
63
74 Test 'file:' uri handling:
64 Test 'file:' uri handling:
75
65
76 $ hg pull -q file://../test-does-not-exist
66 $ hg pull -q file://../test-does-not-exist
77 abort: file:// URLs can only refer to localhost
67 abort: file:// URLs can only refer to localhost
78 [255]
68 [255]
79
69
80 $ hg pull -q file://../test
70 $ hg pull -q file://../test
81 abort: file:// URLs can only refer to localhost
71 abort: file:// URLs can only refer to localhost
82 [255]
72 [255]
83
73
84 MSYS changes 'file:' into 'file;'
74 MSYS changes 'file:' into 'file;'
85
75
86 #if no-msys
76 #if no-msys
87 $ hg pull -q file:../test # no-msys
77 $ hg pull -q file:../test # no-msys
88 #endif
78 #endif
89
79
90 It's tricky to make file:// URLs working on every platform with
80 It's tricky to make file:// URLs working on every platform with
91 regular shell commands.
81 regular shell commands.
92
82
93 $ URL=`"$PYTHON" -c "import os; print('file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
83 $ URL=`"$PYTHON" -c "import os; print('file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
94 $ hg pull -q "$URL"
84 $ hg pull -q "$URL"
95 abort: file:// URLs can only refer to localhost
85 abort: file:// URLs can only refer to localhost
96 [255]
86 [255]
97
87
98 $ URL=`"$PYTHON" -c "import os; print('file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
88 $ URL=`"$PYTHON" -c "import os; print('file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
99 $ hg pull -q "$URL"
89 $ hg pull -q "$URL"
100
90
101 SEC: check for unsafe ssh url
91 SEC: check for unsafe ssh url
102
92
103 $ cat >> $HGRCPATH << EOF
93 $ cat >> $HGRCPATH << EOF
104 > [ui]
94 > [ui]
105 > ssh = sh -c "read l; read l; read l"
95 > ssh = sh -c "read l; read l; read l"
106 > EOF
96 > EOF
107
97
108 $ hg pull 'ssh://-oProxyCommand=touch${IFS}owned/path'
98 $ hg pull 'ssh://-oProxyCommand=touch${IFS}owned/path'
109 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
99 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
110 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
100 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
111 [255]
101 [255]
112 $ hg pull 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
102 $ hg pull 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
113 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
103 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
114 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
104 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
115 [255]
105 [255]
116 $ hg pull 'ssh://fakehost|touch${IFS}owned/path'
106 $ hg pull 'ssh://fakehost|touch${IFS}owned/path'
117 pulling from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
107 pulling from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
118 abort: no suitable response from remote hg
108 abort: no suitable response from remote hg
119 [255]
109 [255]
120 $ hg --config ui.timestamp-output=true pull 'ssh://fakehost%7Ctouch%20owned/path'
110 $ hg --config ui.timestamp-output=true pull 'ssh://fakehost%7Ctouch%20owned/path'
121 \[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\] pulling from ssh://fakehost%7Ctouch%20owned/path (re)
111 \[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\] pulling from ssh://fakehost%7Ctouch%20owned/path (re)
122 \[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\] abort: no suitable response from remote hg (re)
112 \[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\] abort: no suitable response from remote hg (re)
123 [255]
113 [255]
124
114
125 $ [ ! -f owned ] || echo 'you got owned'
115 $ [ ! -f owned ] || echo 'you got owned'
126
116
127 $ cd ..
117 $ cd ..
@@ -1,33 +1,28
1 #require unix-permissions no-root
1 #require unix-permissions no-root
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo foo > b
5 $ echo foo > b
6 $ hg add b
6 $ hg add b
7 $ hg ci -m "b"
7 $ hg ci -m "b"
8
8
9 $ chmod -w .hg/store
9 $ chmod -w .hg/store
10
10
11 $ cd ..
11 $ cd ..
12
12
13 $ hg clone a b
13 $ hg clone a b
14 requesting all changes
14 requesting all changes
15 adding changesets
15 adding changesets
16 adding manifests
16 adding manifests
17 adding file changes
17 adding file changes
18 added 1 changesets with 1 changes to 1 files
18 added 1 changesets with 1 changes to 1 files
19 new changesets 97310831fa1a
19 new changesets 97310831fa1a
20 updating to branch default
20 updating to branch default
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22
22
23 $ chmod +w a/.hg/store # let test clean up
23 $ chmod +w a/.hg/store # let test clean up
24
24
25 $ cd b
25 $ cd b
26 $ hg verify
26 $ hg verify -q
27 checking changesets
28 checking manifests
29 crosschecking files in changesets and manifests
30 checking files
31 checked 1 changesets with 1 changes to 1 files
32
27
33 $ cd ..
28 $ cd ..
@@ -1,75 +1,70
1 Corrupt an hg repo with two pulls.
1 Corrupt an hg repo with two pulls.
2 create one repo with a long history
2 create one repo with a long history
3
3
4 $ hg init source1
4 $ hg init source1
5 $ cd source1
5 $ cd source1
6 $ touch foo
6 $ touch foo
7 $ hg add foo
7 $ hg add foo
8 $ for i in 1 2 3 4 5 6 7 8 9 10; do
8 $ for i in 1 2 3 4 5 6 7 8 9 10; do
9 > echo $i >> foo
9 > echo $i >> foo
10 > hg ci -m $i
10 > hg ci -m $i
11 > done
11 > done
12 $ cd ..
12 $ cd ..
13
13
14 create one repo with a shorter history
14 create one repo with a shorter history
15
15
16 $ hg clone -r 0 source1 source2
16 $ hg clone -r 0 source1 source2
17 adding changesets
17 adding changesets
18 adding manifests
18 adding manifests
19 adding file changes
19 adding file changes
20 added 1 changesets with 1 changes to 1 files
20 added 1 changesets with 1 changes to 1 files
21 new changesets 495a0ec48aaf
21 new changesets 495a0ec48aaf
22 updating to branch default
22 updating to branch default
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 $ cd source2
24 $ cd source2
25 $ echo a >> foo
25 $ echo a >> foo
26 $ hg ci -m a
26 $ hg ci -m a
27 $ cd ..
27 $ cd ..
28
28
29 create a third repo to pull both other repos into it
29 create a third repo to pull both other repos into it
30
30
31 $ hg init corrupted
31 $ hg init corrupted
32 $ cd corrupted
32 $ cd corrupted
33
33
34 use a hook to make the second pull start while the first one is still running
34 use a hook to make the second pull start while the first one is still running
35
35
36 $ echo '[hooks]' >> .hg/hgrc
36 $ echo '[hooks]' >> .hg/hgrc
37 $ echo 'prechangegroup = sleep 5' >> .hg/hgrc
37 $ echo 'prechangegroup = sleep 5' >> .hg/hgrc
38
38
39 start a pull...
39 start a pull...
40
40
41 $ hg pull ../source1 > pull.out 2>&1 &
41 $ hg pull ../source1 > pull.out 2>&1 &
42
42
43 ... and start another pull before the first one has finished
43 ... and start another pull before the first one has finished
44
44
45 $ sleep 1
45 $ sleep 1
46 $ hg pull ../source2 2>/dev/null
46 $ hg pull ../source2 2>/dev/null
47 pulling from ../source2
47 pulling from ../source2
48 searching for changes
48 searching for changes
49 adding changesets
49 adding changesets
50 adding manifests
50 adding manifests
51 adding file changes
51 adding file changes
52 added 1 changesets with 1 changes to 1 files (+1 heads)
52 added 1 changesets with 1 changes to 1 files (+1 heads)
53 new changesets ca3c05af513e
53 new changesets ca3c05af513e
54 (run 'hg heads' to see heads, 'hg merge' to merge)
54 (run 'hg heads' to see heads, 'hg merge' to merge)
55 $ cat pull.out
55 $ cat pull.out
56 pulling from ../source1
56 pulling from ../source1
57 requesting all changes
57 requesting all changes
58 adding changesets
58 adding changesets
59 adding manifests
59 adding manifests
60 adding file changes
60 adding file changes
61 added 10 changesets with 10 changes to 1 files
61 added 10 changesets with 10 changes to 1 files
62 new changesets 495a0ec48aaf:1e7b6c812ca8
62 new changesets 495a0ec48aaf:1e7b6c812ca8
63 (run 'hg update' to get a working copy)
63 (run 'hg update' to get a working copy)
64
64
65 see the result
65 see the result
66
66
67 $ wait
67 $ wait
68 $ hg verify
68 $ hg verify -q
69 checking changesets
70 checking manifests
71 crosschecking files in changesets and manifests
72 checking files
73 checked 11 changesets with 11 changes to 1 files
74
69
75 $ cd ..
70 $ cd ..
@@ -1,402 +1,342
1 ==================================
1 ==================================
2 Basic testing for the push command
2 Basic testing for the push command
3 ==================================
3 ==================================
4
4
5 Testing of the '--rev' flag
5 Testing of the '--rev' flag
6 ===========================
6 ===========================
7
7
8 $ hg init test-revflag
8 $ hg init test-revflag
9 $ hg -R test-revflag unbundle "$TESTDIR/bundles/remote.hg"
9 $ hg -R test-revflag unbundle "$TESTDIR/bundles/remote.hg"
10 adding changesets
10 adding changesets
11 adding manifests
11 adding manifests
12 adding file changes
12 adding file changes
13 added 9 changesets with 7 changes to 4 files (+1 heads)
13 added 9 changesets with 7 changes to 4 files (+1 heads)
14 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
14 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
15 (run 'hg heads' to see heads, 'hg merge' to merge)
15 (run 'hg heads' to see heads, 'hg merge' to merge)
16
16
17 $ for i in 0 1 2 3 4 5 6 7 8; do
17 $ for i in 0 1 2 3 4 5 6 7 8; do
18 > echo
18 > echo
19 > hg init test-revflag-"$i"
19 > hg init test-revflag-"$i"
20 > hg -R test-revflag push -r "$i" test-revflag-"$i"
20 > hg -R test-revflag push -r "$i" test-revflag-"$i"
21 > hg -R test-revflag-"$i" verify
21 > hg -R test-revflag-"$i" verify -q
22 > done
22 > done
23
23
24 pushing to test-revflag-0
24 pushing to test-revflag-0
25 searching for changes
25 searching for changes
26 adding changesets
26 adding changesets
27 adding manifests
27 adding manifests
28 adding file changes
28 adding file changes
29 added 1 changesets with 1 changes to 1 files
29 added 1 changesets with 1 changes to 1 files
30 checking changesets
31 checking manifests
32 crosschecking files in changesets and manifests
33 checking files
34 checked 1 changesets with 1 changes to 1 files
35
30
36 pushing to test-revflag-1
31 pushing to test-revflag-1
37 searching for changes
32 searching for changes
38 adding changesets
33 adding changesets
39 adding manifests
34 adding manifests
40 adding file changes
35 adding file changes
41 added 2 changesets with 2 changes to 1 files
36 added 2 changesets with 2 changes to 1 files
42 checking changesets
43 checking manifests
44 crosschecking files in changesets and manifests
45 checking files
46 checked 2 changesets with 2 changes to 1 files
47
37
48 pushing to test-revflag-2
38 pushing to test-revflag-2
49 searching for changes
39 searching for changes
50 adding changesets
40 adding changesets
51 adding manifests
41 adding manifests
52 adding file changes
42 adding file changes
53 added 3 changesets with 3 changes to 1 files
43 added 3 changesets with 3 changes to 1 files
54 checking changesets
55 checking manifests
56 crosschecking files in changesets and manifests
57 checking files
58 checked 3 changesets with 3 changes to 1 files
59
44
60 pushing to test-revflag-3
45 pushing to test-revflag-3
61 searching for changes
46 searching for changes
62 adding changesets
47 adding changesets
63 adding manifests
48 adding manifests
64 adding file changes
49 adding file changes
65 added 4 changesets with 4 changes to 1 files
50 added 4 changesets with 4 changes to 1 files
66 checking changesets
67 checking manifests
68 crosschecking files in changesets and manifests
69 checking files
70 checked 4 changesets with 4 changes to 1 files
71
51
72 pushing to test-revflag-4
52 pushing to test-revflag-4
73 searching for changes
53 searching for changes
74 adding changesets
54 adding changesets
75 adding manifests
55 adding manifests
76 adding file changes
56 adding file changes
77 added 2 changesets with 2 changes to 1 files
57 added 2 changesets with 2 changes to 1 files
78 checking changesets
79 checking manifests
80 crosschecking files in changesets and manifests
81 checking files
82 checked 2 changesets with 2 changes to 1 files
83
58
84 pushing to test-revflag-5
59 pushing to test-revflag-5
85 searching for changes
60 searching for changes
86 adding changesets
61 adding changesets
87 adding manifests
62 adding manifests
88 adding file changes
63 adding file changes
89 added 3 changesets with 3 changes to 1 files
64 added 3 changesets with 3 changes to 1 files
90 checking changesets
91 checking manifests
92 crosschecking files in changesets and manifests
93 checking files
94 checked 3 changesets with 3 changes to 1 files
95
65
96 pushing to test-revflag-6
66 pushing to test-revflag-6
97 searching for changes
67 searching for changes
98 adding changesets
68 adding changesets
99 adding manifests
69 adding manifests
100 adding file changes
70 adding file changes
101 added 4 changesets with 5 changes to 2 files
71 added 4 changesets with 5 changes to 2 files
102 checking changesets
103 checking manifests
104 crosschecking files in changesets and manifests
105 checking files
106 checked 4 changesets with 5 changes to 2 files
107
72
108 pushing to test-revflag-7
73 pushing to test-revflag-7
109 searching for changes
74 searching for changes
110 adding changesets
75 adding changesets
111 adding manifests
76 adding manifests
112 adding file changes
77 adding file changes
113 added 5 changesets with 6 changes to 3 files
78 added 5 changesets with 6 changes to 3 files
114 checking changesets
115 checking manifests
116 crosschecking files in changesets and manifests
117 checking files
118 checked 5 changesets with 6 changes to 3 files
119
79
120 pushing to test-revflag-8
80 pushing to test-revflag-8
121 searching for changes
81 searching for changes
122 adding changesets
82 adding changesets
123 adding manifests
83 adding manifests
124 adding file changes
84 adding file changes
125 added 5 changesets with 5 changes to 2 files
85 added 5 changesets with 5 changes to 2 files
126 checking changesets
127 checking manifests
128 crosschecking files in changesets and manifests
129 checking files
130 checked 5 changesets with 5 changes to 2 files
131
86
132 $ cd test-revflag-8
87 $ cd test-revflag-8
133
88
134 $ hg pull ../test-revflag-7
89 $ hg pull ../test-revflag-7
135 pulling from ../test-revflag-7
90 pulling from ../test-revflag-7
136 searching for changes
91 searching for changes
137 adding changesets
92 adding changesets
138 adding manifests
93 adding manifests
139 adding file changes
94 adding file changes
140 added 4 changesets with 2 changes to 3 files (+1 heads)
95 added 4 changesets with 2 changes to 3 files (+1 heads)
141 new changesets c70afb1ee985:faa2e4234c7a
96 new changesets c70afb1ee985:faa2e4234c7a
142 (run 'hg heads' to see heads, 'hg merge' to merge)
97 (run 'hg heads' to see heads, 'hg merge' to merge)
143
98
144 $ hg verify
99 $ hg verify -q
145 checking changesets
146 checking manifests
147 crosschecking files in changesets and manifests
148 checking files
149 checked 9 changesets with 7 changes to 4 files
150
100
151 $ cd ..
101 $ cd ..
152
102
153 Test server side validation during push
103 Test server side validation during push
154 =======================================
104 =======================================
155
105
156 $ hg init test-validation
106 $ hg init test-validation
157 $ cd test-validation
107 $ cd test-validation
158
108
159 $ cat > .hg/hgrc <<EOF
109 $ cat > .hg/hgrc <<EOF
160 > [server]
110 > [server]
161 > validate=1
111 > validate=1
162 > EOF
112 > EOF
163
113
164 $ echo alpha > alpha
114 $ echo alpha > alpha
165 $ echo beta > beta
115 $ echo beta > beta
166 $ hg addr
116 $ hg addr
167 adding alpha
117 adding alpha
168 adding beta
118 adding beta
169 $ hg ci -m 1
119 $ hg ci -m 1
170
120
171 $ cd ..
121 $ cd ..
172 $ hg clone test-validation test-validation-clone
122 $ hg clone test-validation test-validation-clone
173 updating to branch default
123 updating to branch default
174 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
124 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
175
125
176 #if reporevlogstore
126 #if reporevlogstore
177
127
178 Test spurious filelog entries:
128 Test spurious filelog entries:
179
129
180 $ cd test-validation-clone
130 $ cd test-validation-clone
181 $ echo blah >> beta
131 $ echo blah >> beta
182 $ cp .hg/store/data/beta.i tmp1
132 $ cp .hg/store/data/beta.i tmp1
183 $ hg ci -m 2
133 $ hg ci -m 2
184 $ cp .hg/store/data/beta.i tmp2
134 $ cp .hg/store/data/beta.i tmp2
185 $ hg -q rollback
135 $ hg -q rollback
186 $ mv tmp2 .hg/store/data/beta.i
136 $ mv tmp2 .hg/store/data/beta.i
187 $ echo blah >> beta
137 $ echo blah >> beta
188 $ hg ci -m '2 (corrupt)'
138 $ hg ci -m '2 (corrupt)'
189
139
190 Expected to fail:
140 Expected to fail:
191
141
192 $ hg verify
142 $ hg verify -q
193 checking changesets
194 checking manifests
195 crosschecking files in changesets and manifests
196 checking files
197 beta@1: dddc47b3ba30 not in manifests
143 beta@1: dddc47b3ba30 not in manifests
198 checked 2 changesets with 4 changes to 2 files
199 1 integrity errors encountered!
144 1 integrity errors encountered!
200 (first damaged changeset appears to be 1)
145 (first damaged changeset appears to be 1)
201 [1]
146 [1]
202
147
203 $ hg push
148 $ hg push
204 pushing to $TESTTMP/test-validation
149 pushing to $TESTTMP/test-validation
205 searching for changes
150 searching for changes
206 adding changesets
151 adding changesets
207 adding manifests
152 adding manifests
208 adding file changes
153 adding file changes
209 transaction abort!
154 transaction abort!
210 rollback completed
155 rollback completed
211 abort: received spurious file revlog entry
156 abort: received spurious file revlog entry
212 [255]
157 [255]
213
158
214 $ hg -q rollback
159 $ hg -q rollback
215 $ mv tmp1 .hg/store/data/beta.i
160 $ mv tmp1 .hg/store/data/beta.i
216 $ echo beta > beta
161 $ echo beta > beta
217
162
218 Test missing filelog entries:
163 Test missing filelog entries:
219
164
220 $ cp .hg/store/data/beta.i tmp
165 $ cp .hg/store/data/beta.i tmp
221 $ echo blah >> beta
166 $ echo blah >> beta
222 $ hg ci -m '2 (corrupt)'
167 $ hg ci -m '2 (corrupt)'
223 $ mv tmp .hg/store/data/beta.i
168 $ mv tmp .hg/store/data/beta.i
224
169
225 Expected to fail:
170 Expected to fail:
226
171
227 $ hg verify
172 $ hg verify -q
228 checking changesets
229 checking manifests
230 crosschecking files in changesets and manifests
231 checking files
232 beta@1: manifest refers to unknown revision dddc47b3ba30
173 beta@1: manifest refers to unknown revision dddc47b3ba30
233 checked 2 changesets with 2 changes to 2 files
234 1 integrity errors encountered!
174 1 integrity errors encountered!
235 (first damaged changeset appears to be 1)
175 (first damaged changeset appears to be 1)
236 [1]
176 [1]
237
177
238 $ hg push
178 $ hg push
239 pushing to $TESTTMP/test-validation
179 pushing to $TESTTMP/test-validation
240 searching for changes
180 searching for changes
241 adding changesets
181 adding changesets
242 adding manifests
182 adding manifests
243 adding file changes
183 adding file changes
244 transaction abort!
184 transaction abort!
245 rollback completed
185 rollback completed
246 abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
186 abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
247 [255]
187 [255]
248
188
249 $ cd ..
189 $ cd ..
250
190
251 #endif
191 #endif
252
192
253 Test push hook locking
193 Test push hook locking
254 =====================
194 =====================
255
195
256 $ hg init 1
196 $ hg init 1
257
197
258 $ echo '[ui]' >> 1/.hg/hgrc
198 $ echo '[ui]' >> 1/.hg/hgrc
259 $ echo 'timeout = 10' >> 1/.hg/hgrc
199 $ echo 'timeout = 10' >> 1/.hg/hgrc
260
200
261 $ echo foo > 1/foo
201 $ echo foo > 1/foo
262 $ hg --cwd 1 ci -A -m foo
202 $ hg --cwd 1 ci -A -m foo
263 adding foo
203 adding foo
264
204
265 $ hg clone 1 2
205 $ hg clone 1 2
266 updating to branch default
206 updating to branch default
267 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
207 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
268
208
269 $ hg clone 2 3
209 $ hg clone 2 3
270 updating to branch default
210 updating to branch default
271 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
272
212
273 $ cat <<EOF > $TESTTMP/debuglocks-pretxn-hook.sh
213 $ cat <<EOF > $TESTTMP/debuglocks-pretxn-hook.sh
274 > hg debuglocks
214 > hg debuglocks
275 > true
215 > true
276 > EOF
216 > EOF
277 $ echo '[hooks]' >> 2/.hg/hgrc
217 $ echo '[hooks]' >> 2/.hg/hgrc
278 $ echo "pretxnchangegroup.a = sh $TESTTMP/debuglocks-pretxn-hook.sh" >> 2/.hg/hgrc
218 $ echo "pretxnchangegroup.a = sh $TESTTMP/debuglocks-pretxn-hook.sh" >> 2/.hg/hgrc
279 $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
219 $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
280
220
281 $ echo bar >> 3/foo
221 $ echo bar >> 3/foo
282 $ hg --cwd 3 ci -m bar
222 $ hg --cwd 3 ci -m bar
283
223
284 $ hg --cwd 3 push ../2 --config devel.legacy.exchange=bundle1
224 $ hg --cwd 3 push ../2 --config devel.legacy.exchange=bundle1
285 pushing to ../2
225 pushing to ../2
286 searching for changes
226 searching for changes
287 adding changesets
227 adding changesets
288 adding manifests
228 adding manifests
289 adding file changes
229 adding file changes
290 lock: user *, process * (*s) (glob)
230 lock: user *, process * (*s) (glob)
291 wlock: free
231 wlock: free
292 added 1 changesets with 1 changes to 1 files
232 added 1 changesets with 1 changes to 1 files
293
233
294 $ hg --cwd 1 --config extensions.strip= strip tip -q
234 $ hg --cwd 1 --config extensions.strip= strip tip -q
295 $ hg --cwd 2 --config extensions.strip= strip tip -q
235 $ hg --cwd 2 --config extensions.strip= strip tip -q
296 $ hg --cwd 3 push ../2 # bundle2+
236 $ hg --cwd 3 push ../2 # bundle2+
297 pushing to ../2
237 pushing to ../2
298 searching for changes
238 searching for changes
299 adding changesets
239 adding changesets
300 adding manifests
240 adding manifests
301 adding file changes
241 adding file changes
302 lock: user *, process * (*s) (glob)
242 lock: user *, process * (*s) (glob)
303 wlock: user *, process * (*s) (glob)
243 wlock: user *, process * (*s) (glob)
304 added 1 changesets with 1 changes to 1 files
244 added 1 changesets with 1 changes to 1 files
305
245
306 Test bare push with multiple race checking options
246 Test bare push with multiple race checking options
307 --------------------------------------------------
247 --------------------------------------------------
308
248
309 $ hg init test-bare-push-no-concurrency
249 $ hg init test-bare-push-no-concurrency
310 $ hg init test-bare-push-unrelated-concurrency
250 $ hg init test-bare-push-unrelated-concurrency
311 $ hg -R test-revflag push -r 0 test-bare-push-no-concurrency --config server.concurrent-push-mode=strict
251 $ hg -R test-revflag push -r 0 test-bare-push-no-concurrency --config server.concurrent-push-mode=strict
312 pushing to test-bare-push-no-concurrency
252 pushing to test-bare-push-no-concurrency
313 searching for changes
253 searching for changes
314 adding changesets
254 adding changesets
315 adding manifests
255 adding manifests
316 adding file changes
256 adding file changes
317 added 1 changesets with 1 changes to 1 files
257 added 1 changesets with 1 changes to 1 files
318 $ hg -R test-revflag push -r 0 test-bare-push-unrelated-concurrency --config server.concurrent-push-mode=check-related
258 $ hg -R test-revflag push -r 0 test-bare-push-unrelated-concurrency --config server.concurrent-push-mode=check-related
319 pushing to test-bare-push-unrelated-concurrency
259 pushing to test-bare-push-unrelated-concurrency
320 searching for changes
260 searching for changes
321 adding changesets
261 adding changesets
322 adding manifests
262 adding manifests
323 adding file changes
263 adding file changes
324 added 1 changesets with 1 changes to 1 files
264 added 1 changesets with 1 changes to 1 files
325
265
326 SEC: check for unsafe ssh url
266 SEC: check for unsafe ssh url
327
267
328 $ cat >> $HGRCPATH << EOF
268 $ cat >> $HGRCPATH << EOF
329 > [ui]
269 > [ui]
330 > ssh = sh -c "read l; read l; read l"
270 > ssh = sh -c "read l; read l; read l"
331 > EOF
271 > EOF
332
272
333 $ hg -R test-revflag push 'ssh://-oProxyCommand=touch${IFS}owned/path'
273 $ hg -R test-revflag push 'ssh://-oProxyCommand=touch${IFS}owned/path'
334 pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
274 pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
335 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
275 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
336 [255]
276 [255]
337 $ hg -R test-revflag push 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
277 $ hg -R test-revflag push 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
338 pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
278 pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
339 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
279 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
340 [255]
280 [255]
341 $ hg -R test-revflag push 'ssh://fakehost|touch${IFS}owned/path'
281 $ hg -R test-revflag push 'ssh://fakehost|touch${IFS}owned/path'
342 pushing to ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
282 pushing to ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
343 abort: no suitable response from remote hg
283 abort: no suitable response from remote hg
344 [255]
284 [255]
345 $ hg -R test-revflag push 'ssh://fakehost%7Ctouch%20owned/path'
285 $ hg -R test-revflag push 'ssh://fakehost%7Ctouch%20owned/path'
346 pushing to ssh://fakehost%7Ctouch%20owned/path
286 pushing to ssh://fakehost%7Ctouch%20owned/path
347 abort: no suitable response from remote hg
287 abort: no suitable response from remote hg
348 [255]
288 [255]
349
289
350 $ [ ! -f owned ] || echo 'you got owned'
290 $ [ ! -f owned ] || echo 'you got owned'
351
291
352 Test `commands.push.require-revs`
292 Test `commands.push.require-revs`
353 ---------------------------------
293 ---------------------------------
354
294
355 $ hg clone -q test-revflag test-require-revs-source
295 $ hg clone -q test-revflag test-require-revs-source
356 $ hg init test-require-revs-dest
296 $ hg init test-require-revs-dest
357 $ cd test-require-revs-source
297 $ cd test-require-revs-source
358 $ cat >> .hg/hgrc << EOF
298 $ cat >> .hg/hgrc << EOF
359 > [paths]
299 > [paths]
360 > default = ../test-require-revs-dest
300 > default = ../test-require-revs-dest
361 > [commands]
301 > [commands]
362 > push.require-revs=1
302 > push.require-revs=1
363 > EOF
303 > EOF
364 $ hg push
304 $ hg push
365 pushing to $TESTTMP/test-require-revs-dest
305 pushing to $TESTTMP/test-require-revs-dest
366 abort: no revisions specified to push
306 abort: no revisions specified to push
367 (did you mean "hg push -r ."?)
307 (did you mean "hg push -r ."?)
368 [10]
308 [10]
369 $ hg push -r 0
309 $ hg push -r 0
370 pushing to $TESTTMP/test-require-revs-dest
310 pushing to $TESTTMP/test-require-revs-dest
371 searching for changes
311 searching for changes
372 adding changesets
312 adding changesets
373 adding manifests
313 adding manifests
374 adding file changes
314 adding file changes
375 added 1 changesets with 1 changes to 1 files
315 added 1 changesets with 1 changes to 1 files
376 $ hg bookmark -r 0 push-this-bookmark
316 $ hg bookmark -r 0 push-this-bookmark
377 (test that -B (bookmark) works for specifying "revs")
317 (test that -B (bookmark) works for specifying "revs")
378 $ hg push -B push-this-bookmark
318 $ hg push -B push-this-bookmark
379 pushing to $TESTTMP/test-require-revs-dest
319 pushing to $TESTTMP/test-require-revs-dest
380 searching for changes
320 searching for changes
381 no changes found
321 no changes found
382 exporting bookmark push-this-bookmark
322 exporting bookmark push-this-bookmark
383 [1]
323 [1]
384 (test that -b (branch) works for specifying "revs")
324 (test that -b (branch) works for specifying "revs")
385 $ hg push -b default
325 $ hg push -b default
386 pushing to $TESTTMP/test-require-revs-dest
326 pushing to $TESTTMP/test-require-revs-dest
387 searching for changes
327 searching for changes
388 abort: push creates new remote head [0-9a-f]+ (re)
328 abort: push creates new remote head [0-9a-f]+ (re)
389 (merge or see 'hg help push' for details about pushing new heads)
329 (merge or see 'hg help push' for details about pushing new heads)
390 [20]
330 [20]
391 (demonstrate that even though we don't have anything to exchange, we're still
331 (demonstrate that even though we don't have anything to exchange, we're still
392 showing the error)
332 showing the error)
393 $ hg push
333 $ hg push
394 pushing to $TESTTMP/test-require-revs-dest
334 pushing to $TESTTMP/test-require-revs-dest
395 abort: no revisions specified to push
335 abort: no revisions specified to push
396 (did you mean "hg push -r ."?)
336 (did you mean "hg push -r ."?)
397 [10]
337 [10]
398 $ hg push --config paths.default:pushrev=0
338 $ hg push --config paths.default:pushrev=0
399 pushing to $TESTTMP/test-require-revs-dest
339 pushing to $TESTTMP/test-require-revs-dest
400 searching for changes
340 searching for changes
401 no changes found
341 no changes found
402 [1]
342 [1]
@@ -1,132 +1,122
1 #require reporevlogstore
1 #require reporevlogstore
2
2
3 A repo with unknown revlogv2 requirement string cannot be opened
3 A repo with unknown revlogv2 requirement string cannot be opened
4
4
5 $ hg init invalidreq
5 $ hg init invalidreq
6 $ cd invalidreq
6 $ cd invalidreq
7 $ echo exp-revlogv2.unknown >> .hg/requires
7 $ echo exp-revlogv2.unknown >> .hg/requires
8 $ hg log
8 $ hg log
9 abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown
9 abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown
10 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
10 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
11 [255]
11 [255]
12 $ cd ..
12 $ cd ..
13
13
14 Can create and open repo with revlog v2 requirement
14 Can create and open repo with revlog v2 requirement
15
15
16 $ cat >> $HGRCPATH << EOF
16 $ cat >> $HGRCPATH << EOF
17 > [experimental]
17 > [experimental]
18 > revlogv2 = enable-unstable-format-and-corrupt-my-data
18 > revlogv2 = enable-unstable-format-and-corrupt-my-data
19 > EOF
19 > EOF
20
20
21 $ hg init new-repo
21 $ hg init new-repo
22 $ cd new-repo
22 $ cd new-repo
23 $ hg debugrequires | grep revlogv2
23 $ hg debugrequires | grep revlogv2
24 exp-revlogv2.2
24 exp-revlogv2.2
25 dirstate-v2 (dirstate-v2 !)
25 dirstate-v2 (dirstate-v2 !)
26
26
27 $ hg log
27 $ hg log
28
28
29 Unknown flags to revlog are rejected
29 Unknown flags to revlog are rejected
30
30
31 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
31 >>> with open('.hg/store/00changelog.i', 'wb') as fh:
32 ... fh.write(b'\xff\x00\xde\xad') and None
32 ... fh.write(b'\xff\x00\xde\xad') and None
33
33
34 $ hg log
34 $ hg log
35 abort: unknown flags (0xff00) in version 57005 revlog 00changelog
35 abort: unknown flags (0xff00) in version 57005 revlog 00changelog
36 [50]
36 [50]
37
37
38 $ cd ..
38 $ cd ..
39
39
40 Writing a simple revlog v2 works
40 Writing a simple revlog v2 works
41
41
42 $ hg init simple
42 $ hg init simple
43 $ cd simple
43 $ cd simple
44 $ touch foo
44 $ touch foo
45 $ hg -q commit -A -m initial
45 $ hg -q commit -A -m initial
46
46
47 $ hg log
47 $ hg log
48 changeset: 0:96ee1d7354c4
48 changeset: 0:96ee1d7354c4
49 tag: tip
49 tag: tip
50 user: test
50 user: test
51 date: Thu Jan 01 00:00:00 1970 +0000
51 date: Thu Jan 01 00:00:00 1970 +0000
52 summary: initial
52 summary: initial
53
53
54
54
55 Header written as expected
55 Header written as expected
56
56
57 $ f --hexdump --bytes 4 .hg/store/00changelog.i
57 $ f --hexdump --bytes 4 .hg/store/00changelog.i
58 .hg/store/00changelog.i:
58 .hg/store/00changelog.i:
59 0000: 00 00 de ad |....|
59 0000: 00 00 de ad |....|
60
60
61 $ f --hexdump --bytes 4 .hg/store/data/foo.i
61 $ f --hexdump --bytes 4 .hg/store/data/foo.i
62 .hg/store/data/foo.i:
62 .hg/store/data/foo.i:
63 0000: 00 00 de ad |....|
63 0000: 00 00 de ad |....|
64
64
65 Bundle use a compatible changegroup format
65 Bundle use a compatible changegroup format
66 ------------------------------------------
66 ------------------------------------------
67
67
68 $ hg bundle --all ../basic.hg
68 $ hg bundle --all ../basic.hg
69 1 changesets found
69 1 changesets found
70 $ hg debugbundle --spec ../basic.hg
70 $ hg debugbundle --spec ../basic.hg
71 bzip2-v2
71 bzip2-v2
72
72
73 The expected files are generated
73 The expected files are generated
74 --------------------------------
74 --------------------------------
75
75
76 We should have have:
76 We should have have:
77 - a docket
77 - a docket
78 - a index file with a unique name
78 - a index file with a unique name
79 - a data file
79 - a data file
80
80
81 $ ls .hg/store/00changelog* .hg/store/00manifest*
81 $ ls .hg/store/00changelog* .hg/store/00manifest*
82 .hg/store/00changelog-1335303a.sda
82 .hg/store/00changelog-1335303a.sda
83 .hg/store/00changelog-6b8ab34b.idx
83 .hg/store/00changelog-6b8ab34b.idx
84 .hg/store/00changelog-b875dfc5.dat
84 .hg/store/00changelog-b875dfc5.dat
85 .hg/store/00changelog.i
85 .hg/store/00changelog.i
86 .hg/store/00manifest-05a21d65.idx
86 .hg/store/00manifest-05a21d65.idx
87 .hg/store/00manifest-43c37dde.dat
87 .hg/store/00manifest-43c37dde.dat
88 .hg/store/00manifest-e2c9362a.sda
88 .hg/store/00manifest-e2c9362a.sda
89 .hg/store/00manifest.i
89 .hg/store/00manifest.i
90
90
91 Local clone works
91 Local clone works
92 -----------------
92 -----------------
93
93
94 $ hg clone . ../cloned-repo
94 $ hg clone . ../cloned-repo
95 updating to branch default
95 updating to branch default
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 $ hg tip | tee ../tip-new
97 $ hg tip | tee ../tip-new
98 changeset: 0:96ee1d7354c4
98 changeset: 0:96ee1d7354c4
99 tag: tip
99 tag: tip
100 user: test
100 user: test
101 date: Thu Jan 01 00:00:00 1970 +0000
101 date: Thu Jan 01 00:00:00 1970 +0000
102 summary: initial
102 summary: initial
103
103
104 $ hg tip -R ../cloned-repo | tee ../tip-cloned
104 $ hg tip -R ../cloned-repo | tee ../tip-cloned
105 changeset: 0:96ee1d7354c4
105 changeset: 0:96ee1d7354c4
106 tag: tip
106 tag: tip
107 user: test
107 user: test
108 date: Thu Jan 01 00:00:00 1970 +0000
108 date: Thu Jan 01 00:00:00 1970 +0000
109 summary: initial
109 summary: initial
110
110
111
111
112 The two repository should be identical, this diff MUST be empty
112 The two repository should be identical, this diff MUST be empty
113
113
114 $ cmp ../tip-new ../tip-cloned || diff -U8 ../tip-new ../tip-cloned
114 $ cmp ../tip-new ../tip-cloned || diff -U8 ../tip-new ../tip-cloned
115
115
116
116
117 hg verify should be happy
117 hg verify should be happy
118 -------------------------
118 -------------------------
119
119
120 $ hg verify
120 $ hg verify -q
121 checking changesets
122 checking manifests
123 crosschecking files in changesets and manifests
124 checking files
125 checked 1 changesets with 1 changes to 1 files
126
121
127 $ hg verify -R ../cloned-repo
122 $ hg verify -R ../cloned-repo -q
128 checking changesets
129 checking manifests
130 crosschecking files in changesets and manifests
131 checking files
132 checked 1 changesets with 1 changes to 1 files
@@ -1,117 +1,112
1 #require rhg
1 #require rhg
2
2
3 $ NO_FALLBACK="env RHG_ON_UNSUPPORTED=abort"
3 $ NO_FALLBACK="env RHG_ON_UNSUPPORTED=abort"
4
4
5 Rhg works well when sparse working copy is enabled.
5 Rhg works well when sparse working copy is enabled.
6
6
7 $ cd "$TESTTMP"
7 $ cd "$TESTTMP"
8 $ hg init repo-sparse
8 $ hg init repo-sparse
9 $ cd repo-sparse
9 $ cd repo-sparse
10 $ cat > .hg/hgrc <<EOF
10 $ cat > .hg/hgrc <<EOF
11 > [extensions]
11 > [extensions]
12 > sparse=
12 > sparse=
13 > EOF
13 > EOF
14
14
15 $ echo a > show
15 $ echo a > show
16 $ echo x > hide
16 $ echo x > hide
17 $ mkdir dir1 dir2
17 $ mkdir dir1 dir2
18 $ echo x > dir1/x
18 $ echo x > dir1/x
19 $ echo y > dir1/y
19 $ echo y > dir1/y
20 $ echo z > dir2/z
20 $ echo z > dir2/z
21
21
22 $ hg ci -Aqm 'initial'
22 $ hg ci -Aqm 'initial'
23 $ hg debugsparse --include 'show'
23 $ hg debugsparse --include 'show'
24 $ ls -A
24 $ ls -A
25 .hg
25 .hg
26 show
26 show
27
27
28 $ tip=$(hg log -r . --template '{node}')
28 $ tip=$(hg log -r . --template '{node}')
29 $ $NO_FALLBACK rhg files -r "$tip"
29 $ $NO_FALLBACK rhg files -r "$tip"
30 dir1/x
30 dir1/x
31 dir1/y
31 dir1/y
32 dir2/z
32 dir2/z
33 hide
33 hide
34 show
34 show
35 $ $NO_FALLBACK rhg files
35 $ $NO_FALLBACK rhg files
36 show
36 show
37
37
38 $ $NO_FALLBACK rhg cat -r "$tip" hide
38 $ $NO_FALLBACK rhg cat -r "$tip" hide
39 x
39 x
40
40
41 $ cd ..
41 $ cd ..
42
42
43 We support most things when narrow is enabled, too, with a couple of caveats.
43 We support most things when narrow is enabled, too, with a couple of caveats.
44
44
45 $ . "$TESTDIR/narrow-library.sh"
45 $ . "$TESTDIR/narrow-library.sh"
46 $ real_hg=$RHG_FALLBACK_EXECUTABLE
46 $ real_hg=$RHG_FALLBACK_EXECUTABLE
47
47
48 $ cat >> $HGRCPATH <<EOF
48 $ cat >> $HGRCPATH <<EOF
49 > [extensions]
49 > [extensions]
50 > narrow=
50 > narrow=
51 > EOF
51 > EOF
52
52
53 $ hg clone --narrow ./repo-sparse repo-narrow --include dir1
53 $ hg clone --narrow ./repo-sparse repo-narrow --include dir1
54 requesting all changes
54 requesting all changes
55 adding changesets
55 adding changesets
56 adding manifests
56 adding manifests
57 adding file changes
57 adding file changes
58 added 1 changesets with 2 changes to 2 files
58 added 1 changesets with 2 changes to 2 files
59 new changesets 6d714a4a2998
59 new changesets 6d714a4a2998
60 updating to branch default
60 updating to branch default
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62
62
63 $ cd repo-narrow
63 $ cd repo-narrow
64
64
65 $ $NO_FALLBACK rhg cat -r "$tip" dir1/x
65 $ $NO_FALLBACK rhg cat -r "$tip" dir1/x
66 x
66 x
67 $ "$real_hg" cat -r "$tip" dir1/x
67 $ "$real_hg" cat -r "$tip" dir1/x
68 x
68 x
69
69
70 TODO: bad error message
70 TODO: bad error message
71
71
72 $ $NO_FALLBACK rhg cat -r "$tip" hide
72 $ $NO_FALLBACK rhg cat -r "$tip" hide
73 abort: invalid revision identifier: 6d714a4a2998cbfd0620db44da58b749f6565d63
73 abort: invalid revision identifier: 6d714a4a2998cbfd0620db44da58b749f6565d63
74 [255]
74 [255]
75 $ "$real_hg" cat -r "$tip" hide
75 $ "$real_hg" cat -r "$tip" hide
76 [1]
76 [1]
77
77
78 A naive implementation of [rhg files] leaks the paths that are supposed to be
78 A naive implementation of [rhg files] leaks the paths that are supposed to be
79 hidden by narrow, so we just fall back to hg.
79 hidden by narrow, so we just fall back to hg.
80
80
81 $ $NO_FALLBACK rhg files -r "$tip"
81 $ $NO_FALLBACK rhg files -r "$tip"
82 unsupported feature: rhg files -r <rev> is not supported in narrow clones
82 unsupported feature: rhg files -r <rev> is not supported in narrow clones
83 [252]
83 [252]
84 $ "$real_hg" files -r "$tip"
84 $ "$real_hg" files -r "$tip"
85 dir1/x
85 dir1/x
86 dir1/y
86 dir1/y
87
87
88 Hg status needs to do some filtering based on narrow spec
88 Hg status needs to do some filtering based on narrow spec
89
89
90 $ mkdir dir2
90 $ mkdir dir2
91 $ touch dir2/q
91 $ touch dir2/q
92 $ "$real_hg" status
92 $ "$real_hg" status
93 $ $NO_FALLBACK rhg --config rhg.status=true status
93 $ $NO_FALLBACK rhg --config rhg.status=true status
94
94
95 Adding "orphaned" index files:
95 Adding "orphaned" index files:
96
96
97 $ (cd ..; cp repo-sparse/.hg/store/data/hide.i repo-narrow/.hg/store/data/hide.i)
97 $ (cd ..; cp repo-sparse/.hg/store/data/hide.i repo-narrow/.hg/store/data/hide.i)
98 $ (cd ..; mkdir repo-narrow/.hg/store/data/dir2; cp repo-sparse/.hg/store/data/dir2/z.i repo-narrow/.hg/store/data/dir2/z.i)
98 $ (cd ..; mkdir repo-narrow/.hg/store/data/dir2; cp repo-sparse/.hg/store/data/dir2/z.i repo-narrow/.hg/store/data/dir2/z.i)
99 $ "$real_hg" verify
99 $ "$real_hg" verify -q
100 checking changesets
101 checking manifests
102 crosschecking files in changesets and manifests
103 checking files
104 checked 1 changesets with 2 changes to 2 files
105
100
106 $ "$real_hg" files -r "$tip"
101 $ "$real_hg" files -r "$tip"
107 dir1/x
102 dir1/x
108 dir1/y
103 dir1/y
109
104
110 # TODO: even though [hg files] hides the orphaned dir2/z, [hg cat] still shows it.
105 # TODO: even though [hg files] hides the orphaned dir2/z, [hg cat] still shows it.
111 # rhg has the same issue, but at least it's not specific to rhg.
106 # rhg has the same issue, but at least it's not specific to rhg.
112 # This is despite [hg verify] succeeding above.
107 # This is despite [hg verify] succeeding above.
113
108
114 $ $NO_FALLBACK rhg cat -r "$tip" dir2/z
109 $ $NO_FALLBACK rhg cat -r "$tip" dir2/z
115 z
110 z
116 $ "$real_hg" cat -r "$tip" dir2/z
111 $ "$real_hg" cat -r "$tip" dir2/z
117 z
112 z
@@ -1,468 +1,442
1 setup repo
1 setup repo
2 $ hg init t
2 $ hg init t
3 $ cd t
3 $ cd t
4 $ echo a > a
4 $ echo a > a
5 $ hg commit -Am'add a'
5 $ hg commit -Am'add a'
6 adding a
6 adding a
7 $ hg verify
7 $ hg verify -q
8 checking changesets
9 checking manifests
10 crosschecking files in changesets and manifests
11 checking files
12 checked 1 changesets with 1 changes to 1 files
13 $ hg parents
8 $ hg parents
14 changeset: 0:1f0dee641bb7
9 changeset: 0:1f0dee641bb7
15 tag: tip
10 tag: tip
16 user: test
11 user: test
17 date: Thu Jan 01 00:00:00 1970 +0000
12 date: Thu Jan 01 00:00:00 1970 +0000
18 summary: add a
13 summary: add a
19
14
20
15
21 rollback to null revision
16 rollback to null revision
22 $ hg status
17 $ hg status
23 $ hg rollback
18 $ hg rollback
24 repository tip rolled back to revision -1 (undo commit)
19 repository tip rolled back to revision -1 (undo commit)
25 working directory now based on revision -1
20 working directory now based on revision -1
26 $ hg verify
21 $ hg verify -q
27 checking changesets
28 checking manifests
29 crosschecking files in changesets and manifests
30 checking files
31 checked 0 changesets with 0 changes to 0 files
32 $ hg parents
22 $ hg parents
33 $ hg status
23 $ hg status
34 A a
24 A a
35
25
36 Two changesets this time so we rollback to a real changeset
26 Two changesets this time so we rollback to a real changeset
37 $ hg commit -m'add a again'
27 $ hg commit -m'add a again'
38 $ echo a >> a
28 $ echo a >> a
39 $ hg commit -m'modify a'
29 $ hg commit -m'modify a'
40
30
41 Test issue 902 (current branch is preserved)
31 Test issue 902 (current branch is preserved)
42 $ hg branch test
32 $ hg branch test
43 marked working directory as branch test
33 marked working directory as branch test
44 (branches are permanent and global, did you want a bookmark?)
34 (branches are permanent and global, did you want a bookmark?)
45 $ hg rollback
35 $ hg rollback
46 repository tip rolled back to revision 0 (undo commit)
36 repository tip rolled back to revision 0 (undo commit)
47 working directory now based on revision 0
37 working directory now based on revision 0
48 $ hg branch
38 $ hg branch
49 default
39 default
50
40
51 Test issue 1635 (commit message saved)
41 Test issue 1635 (commit message saved)
52 $ cat .hg/last-message.txt ; echo
42 $ cat .hg/last-message.txt ; echo
53 modify a
43 modify a
54
44
55 Test rollback of hg before issue 902 was fixed
45 Test rollback of hg before issue 902 was fixed
56
46
57 $ hg commit -m "test3"
47 $ hg commit -m "test3"
58 $ hg branch test
48 $ hg branch test
59 marked working directory as branch test
49 marked working directory as branch test
60 (branches are permanent and global, did you want a bookmark?)
50 (branches are permanent and global, did you want a bookmark?)
61 $ rm .hg/undo.branch
51 $ rm .hg/undo.branch
62 $ hg rollback
52 $ hg rollback
63 repository tip rolled back to revision 0 (undo commit)
53 repository tip rolled back to revision 0 (undo commit)
64 named branch could not be reset: current branch is still 'test'
54 named branch could not be reset: current branch is still 'test'
65 working directory now based on revision 0
55 working directory now based on revision 0
66 $ hg branch
56 $ hg branch
67 test
57 test
68
58
69 working dir unaffected by rollback: do not restore dirstate et. al.
59 working dir unaffected by rollback: do not restore dirstate et. al.
70 $ hg log --template '{rev} {branch} {desc|firstline}\n'
60 $ hg log --template '{rev} {branch} {desc|firstline}\n'
71 0 default add a again
61 0 default add a again
72 $ hg status
62 $ hg status
73 M a
63 M a
74 $ hg bookmark foo
64 $ hg bookmark foo
75 $ hg commit -m'modify a again'
65 $ hg commit -m'modify a again'
76 $ echo b > b
66 $ echo b > b
77 $ hg bookmark bar -r default #making bar active, before the transaction
67 $ hg bookmark bar -r default #making bar active, before the transaction
78 $ hg commit -Am'add b'
68 $ hg commit -Am'add b'
79 adding b
69 adding b
80 $ hg log --template '{rev} {branch} {desc|firstline}\n'
70 $ hg log --template '{rev} {branch} {desc|firstline}\n'
81 2 test add b
71 2 test add b
82 1 test modify a again
72 1 test modify a again
83 0 default add a again
73 0 default add a again
84 $ hg update bar
74 $ hg update bar
85 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
86 (activating bookmark bar)
76 (activating bookmark bar)
87 $ cat .hg/undo.branch ; echo
77 $ cat .hg/undo.branch ; echo
88 test
78 test
89 $ hg rollback -f
79 $ hg rollback -f
90 repository tip rolled back to revision 1 (undo commit)
80 repository tip rolled back to revision 1 (undo commit)
91 $ hg id -n
81 $ hg id -n
92 0
82 0
93 $ hg branch
83 $ hg branch
94 default
84 default
95 $ cat .hg/bookmarks.current ; echo
85 $ cat .hg/bookmarks.current ; echo
96 bar
86 bar
97 $ hg bookmark --delete foo bar
87 $ hg bookmark --delete foo bar
98
88
99 rollback by pretxncommit saves commit message (issue1635)
89 rollback by pretxncommit saves commit message (issue1635)
100
90
101 $ echo a >> a
91 $ echo a >> a
102 $ hg --config hooks.pretxncommit=false commit -m"precious commit message"
92 $ hg --config hooks.pretxncommit=false commit -m"precious commit message"
103 transaction abort!
93 transaction abort!
104 rollback completed
94 rollback completed
105 abort: pretxncommit hook exited with status * (glob)
95 abort: pretxncommit hook exited with status * (glob)
106 [40]
96 [40]
107 $ cat .hg/last-message.txt ; echo
97 $ cat .hg/last-message.txt ; echo
108 precious commit message
98 precious commit message
109
99
110 same thing, but run $EDITOR
100 same thing, but run $EDITOR
111
101
112 $ cat > editor.sh << '__EOF__'
102 $ cat > editor.sh << '__EOF__'
113 > echo "another precious commit message" > "$1"
103 > echo "another precious commit message" > "$1"
114 > __EOF__
104 > __EOF__
115 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1
105 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1
116 transaction abort!
106 transaction abort!
117 rollback completed
107 rollback completed
118 note: commit message saved in .hg/last-message.txt
108 note: commit message saved in .hg/last-message.txt
119 note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it
109 note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it
120 abort: pretxncommit hook exited with status * (glob)
110 abort: pretxncommit hook exited with status * (glob)
121 [40]
111 [40]
122 $ cat .hg/last-message.txt
112 $ cat .hg/last-message.txt
123 another precious commit message
113 another precious commit message
124
114
125 test rollback on served repository
115 test rollback on served repository
126
116
127 #if serve
117 #if serve
128 $ hg commit -m "precious commit message"
118 $ hg commit -m "precious commit message"
129 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
119 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
130 $ cat hg.pid >> $DAEMON_PIDS
120 $ cat hg.pid >> $DAEMON_PIDS
131 $ cd ..
121 $ cd ..
132 $ hg clone http://localhost:$HGPORT u
122 $ hg clone http://localhost:$HGPORT u
133 requesting all changes
123 requesting all changes
134 adding changesets
124 adding changesets
135 adding manifests
125 adding manifests
136 adding file changes
126 adding file changes
137 added 3 changesets with 2 changes to 1 files (+1 heads)
127 added 3 changesets with 2 changes to 1 files (+1 heads)
138 new changesets 23b0221f3370:068774709090
128 new changesets 23b0221f3370:068774709090
139 updating to branch default
129 updating to branch default
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 $ cd u
131 $ cd u
142 $ hg id default
132 $ hg id default
143 068774709090
133 068774709090
144
134
145 now rollback and observe that 'hg serve' reloads the repository and
135 now rollback and observe that 'hg serve' reloads the repository and
146 presents the correct tip changeset:
136 presents the correct tip changeset:
147
137
148 $ hg -R ../t rollback
138 $ hg -R ../t rollback
149 repository tip rolled back to revision 1 (undo commit)
139 repository tip rolled back to revision 1 (undo commit)
150 working directory now based on revision 0
140 working directory now based on revision 0
151 $ hg id default
141 $ hg id default
152 791dd2169706
142 791dd2169706
153
143
154 $ killdaemons.py
144 $ killdaemons.py
155 #endif
145 #endif
156
146
157 update to older changeset and then refuse rollback, because
147 update to older changeset and then refuse rollback, because
158 that would lose data (issue2998)
148 that would lose data (issue2998)
159 $ cd ../t
149 $ cd ../t
160 $ hg -q update
150 $ hg -q update
161 $ rm `hg status -un`
151 $ rm `hg status -un`
162 $ template='{rev}:{node|short} [{branch}] {desc|firstline}\n'
152 $ template='{rev}:{node|short} [{branch}] {desc|firstline}\n'
163 $ echo 'valuable new file' > b
153 $ echo 'valuable new file' > b
164 $ echo 'valuable modification' >> a
154 $ echo 'valuable modification' >> a
165 $ hg commit -A -m'a valuable change'
155 $ hg commit -A -m'a valuable change'
166 adding b
156 adding b
167 $ hg update 0
157 $ hg update 0
168 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
158 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
169 $ hg rollback
159 $ hg rollback
170 abort: rollback of last commit while not checked out may lose data
160 abort: rollback of last commit while not checked out may lose data
171 (use -f to force)
161 (use -f to force)
172 [255]
162 [255]
173 $ hg tip -q
163 $ hg tip -q
174 2:4d9cd3795eea
164 2:4d9cd3795eea
175 $ hg rollback -f
165 $ hg rollback -f
176 repository tip rolled back to revision 1 (undo commit)
166 repository tip rolled back to revision 1 (undo commit)
177 $ hg status
167 $ hg status
178 $ hg log --removed b # yep, it's gone
168 $ hg log --removed b # yep, it's gone
179
169
180 same again, but emulate an old client that doesn't write undo.desc
170 same again, but emulate an old client that doesn't write undo.desc
181 $ hg -q update
171 $ hg -q update
182 $ echo 'valuable modification redux' >> a
172 $ echo 'valuable modification redux' >> a
183 $ hg commit -m'a valuable change redux'
173 $ hg commit -m'a valuable change redux'
184 $ rm .hg/undo.desc
174 $ rm .hg/undo.desc
185 $ hg update 0
175 $ hg update 0
186 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 $ hg rollback
177 $ hg rollback
188 rolling back unknown transaction
178 rolling back unknown transaction
189 $ cat a
179 $ cat a
190 a
180 a
191
181
192 corrupt journal test
182 corrupt journal test
193 $ echo "foo" > .hg/store/journal
183 $ echo "foo" > .hg/store/journal
194 $ hg recover --verify
184 $ hg recover --verify -q
195 rolling back interrupted transaction
196 couldn't read journal entry 'foo\n'!
185 couldn't read journal entry 'foo\n'!
197 checking changesets
198 checking manifests
199 crosschecking files in changesets and manifests
200 checking files
201 checked 2 changesets with 2 changes to 1 files
202
186
203 rollback disabled by config
187 rollback disabled by config
204 $ cat >> $HGRCPATH <<EOF
188 $ cat >> $HGRCPATH <<EOF
205 > [ui]
189 > [ui]
206 > rollback = false
190 > rollback = false
207 > EOF
191 > EOF
208 $ echo narf >> pinky-sayings.txt
192 $ echo narf >> pinky-sayings.txt
209 $ hg add pinky-sayings.txt
193 $ hg add pinky-sayings.txt
210 $ hg ci -m 'First one.'
194 $ hg ci -m 'First one.'
211 $ hg rollback
195 $ hg rollback
212 abort: rollback is disabled because it is unsafe
196 abort: rollback is disabled because it is unsafe
213 (see `hg help -v rollback` for information)
197 (see `hg help -v rollback` for information)
214 [255]
198 [255]
215
199
216 $ cd ..
200 $ cd ..
217
201
218 I/O errors on stdio are handled properly (issue5658)
202 I/O errors on stdio are handled properly (issue5658)
219
203
220 $ cat > badui.py << EOF
204 $ cat > badui.py << EOF
221 > import errno
205 > import errno
222 > from mercurial.i18n import _
206 > from mercurial.i18n import _
223 > from mercurial import (
207 > from mercurial import (
224 > error,
208 > error,
225 > registrar,
209 > registrar,
226 > ui as uimod,
210 > ui as uimod,
227 > )
211 > )
228 >
212 >
229 > configtable = {}
213 > configtable = {}
230 > configitem = registrar.configitem(configtable)
214 > configitem = registrar.configitem(configtable)
231 >
215 >
232 > configitem(b'ui', b'ioerrors',
216 > configitem(b'ui', b'ioerrors',
233 > default=list,
217 > default=list,
234 > )
218 > )
235 >
219 >
236 > def pretxncommit(ui, repo, **kwargs):
220 > def pretxncommit(ui, repo, **kwargs):
237 > ui.warn(b'warn during pretxncommit\n')
221 > ui.warn(b'warn during pretxncommit\n')
238 >
222 >
239 > def pretxnclose(ui, repo, **kwargs):
223 > def pretxnclose(ui, repo, **kwargs):
240 > ui.warn(b'warn during pretxnclose\n')
224 > ui.warn(b'warn during pretxnclose\n')
241 >
225 >
242 > def txnclose(ui, repo, **kwargs):
226 > def txnclose(ui, repo, **kwargs):
243 > ui.warn(b'warn during txnclose\n')
227 > ui.warn(b'warn during txnclose\n')
244 >
228 >
245 > def txnabort(ui, repo, **kwargs):
229 > def txnabort(ui, repo, **kwargs):
246 > ui.warn(b'warn during abort\n')
230 > ui.warn(b'warn during abort\n')
247 >
231 >
248 > class fdproxy(object):
232 > class fdproxy(object):
249 > def __init__(self, ui, o):
233 > def __init__(self, ui, o):
250 > self._ui = ui
234 > self._ui = ui
251 > self._o = o
235 > self._o = o
252 >
236 >
253 > def __getattr__(self, attr):
237 > def __getattr__(self, attr):
254 > return getattr(self._o, attr)
238 > return getattr(self._o, attr)
255 >
239 >
256 > def write(self, msg):
240 > def write(self, msg):
257 > errors = set(self._ui.configlist(b'ui', b'ioerrors'))
241 > errors = set(self._ui.configlist(b'ui', b'ioerrors'))
258 > pretxncommit = msg == b'warn during pretxncommit\n'
242 > pretxncommit = msg == b'warn during pretxncommit\n'
259 > pretxnclose = msg == b'warn during pretxnclose\n'
243 > pretxnclose = msg == b'warn during pretxnclose\n'
260 > txnclose = msg == b'warn during txnclose\n'
244 > txnclose = msg == b'warn during txnclose\n'
261 > txnabort = msg == b'warn during abort\n'
245 > txnabort = msg == b'warn during abort\n'
262 > msgabort = msg == _(b'transaction abort!\n')
246 > msgabort = msg == _(b'transaction abort!\n')
263 > msgrollback = msg == _(b'rollback completed\n')
247 > msgrollback = msg == _(b'rollback completed\n')
264 >
248 >
265 > if pretxncommit and b'pretxncommit' in errors:
249 > if pretxncommit and b'pretxncommit' in errors:
266 > raise IOError(errno.EPIPE, 'simulated epipe')
250 > raise IOError(errno.EPIPE, 'simulated epipe')
267 > if pretxnclose and b'pretxnclose' in errors:
251 > if pretxnclose and b'pretxnclose' in errors:
268 > raise IOError(errno.EIO, 'simulated eio')
252 > raise IOError(errno.EIO, 'simulated eio')
269 > if txnclose and b'txnclose' in errors:
253 > if txnclose and b'txnclose' in errors:
270 > raise IOError(errno.EBADF, 'simulated badf')
254 > raise IOError(errno.EBADF, 'simulated badf')
271 > if txnabort and b'txnabort' in errors:
255 > if txnabort and b'txnabort' in errors:
272 > raise IOError(errno.EPIPE, 'simulated epipe')
256 > raise IOError(errno.EPIPE, 'simulated epipe')
273 > if msgabort and b'msgabort' in errors:
257 > if msgabort and b'msgabort' in errors:
274 > raise IOError(errno.EBADF, 'simulated ebadf')
258 > raise IOError(errno.EBADF, 'simulated ebadf')
275 > if msgrollback and b'msgrollback' in errors:
259 > if msgrollback and b'msgrollback' in errors:
276 > raise IOError(errno.EIO, 'simulated eio')
260 > raise IOError(errno.EIO, 'simulated eio')
277 >
261 >
278 > return self._o.write(msg)
262 > return self._o.write(msg)
279 >
263 >
280 > def uisetup(ui):
264 > def uisetup(ui):
281 > class badui(ui.__class__):
265 > class badui(ui.__class__):
282 > def _write(self, dest, *args, **kwargs):
266 > def _write(self, dest, *args, **kwargs):
283 > olderr = self.ferr
267 > olderr = self.ferr
284 > try:
268 > try:
285 > if dest is self.ferr:
269 > if dest is self.ferr:
286 > self.ferr = dest = fdproxy(self, olderr)
270 > self.ferr = dest = fdproxy(self, olderr)
287 > return super(badui, self)._write(dest, *args, **kwargs)
271 > return super(badui, self)._write(dest, *args, **kwargs)
288 > finally:
272 > finally:
289 > self.ferr = olderr
273 > self.ferr = olderr
290 >
274 >
291 > ui.__class__ = badui
275 > ui.__class__ = badui
292 >
276 >
293 > def reposetup(ui, repo):
277 > def reposetup(ui, repo):
294 > ui.setconfig(b'hooks', b'pretxnclose.badui', pretxnclose, b'badui')
278 > ui.setconfig(b'hooks', b'pretxnclose.badui', pretxnclose, b'badui')
295 > ui.setconfig(b'hooks', b'txnclose.badui', txnclose, b'badui')
279 > ui.setconfig(b'hooks', b'txnclose.badui', txnclose, b'badui')
296 > ui.setconfig(b'hooks', b'pretxncommit.badui', pretxncommit, b'badui')
280 > ui.setconfig(b'hooks', b'pretxncommit.badui', pretxncommit, b'badui')
297 > ui.setconfig(b'hooks', b'txnabort.badui', txnabort, b'badui')
281 > ui.setconfig(b'hooks', b'txnabort.badui', txnabort, b'badui')
298 > EOF
282 > EOF
299
283
300 $ cat >> $HGRCPATH << EOF
284 $ cat >> $HGRCPATH << EOF
301 > [extensions]
285 > [extensions]
302 > badui = $TESTTMP/badui.py
286 > badui = $TESTTMP/badui.py
303 > EOF
287 > EOF
304
288
305 An I/O error during pretxncommit is handled
289 An I/O error during pretxncommit is handled
306
290
307 $ hg init ioerror-pretxncommit
291 $ hg init ioerror-pretxncommit
308 $ cd ioerror-pretxncommit
292 $ cd ioerror-pretxncommit
309 $ echo 0 > foo
293 $ echo 0 > foo
310 $ hg -q commit -A -m initial
294 $ hg -q commit -A -m initial
311 warn during pretxncommit
295 warn during pretxncommit
312 warn during pretxnclose
296 warn during pretxnclose
313 warn during txnclose
297 warn during txnclose
314 $ echo 1 > foo
298 $ echo 1 > foo
315 $ hg --config ui.ioerrors=pretxncommit commit -m 'error during pretxncommit'
299 $ hg --config ui.ioerrors=pretxncommit commit -m 'error during pretxncommit'
316 warn during pretxnclose
300 warn during pretxnclose
317 warn during txnclose
301 warn during txnclose
318
302
319 $ hg commit -m 'commit 1'
303 $ hg commit -m 'commit 1'
320 nothing changed
304 nothing changed
321 [1]
305 [1]
322
306
323 $ cd ..
307 $ cd ..
324
308
325 An I/O error during pretxnclose is handled
309 An I/O error during pretxnclose is handled
326
310
327 $ hg init ioerror-pretxnclose
311 $ hg init ioerror-pretxnclose
328 $ cd ioerror-pretxnclose
312 $ cd ioerror-pretxnclose
329 $ echo 0 > foo
313 $ echo 0 > foo
330 $ hg -q commit -A -m initial
314 $ hg -q commit -A -m initial
331 warn during pretxncommit
315 warn during pretxncommit
332 warn during pretxnclose
316 warn during pretxnclose
333 warn during txnclose
317 warn during txnclose
334
318
335 $ echo 1 > foo
319 $ echo 1 > foo
336 $ hg --config ui.ioerrors=pretxnclose commit -m 'error during pretxnclose'
320 $ hg --config ui.ioerrors=pretxnclose commit -m 'error during pretxnclose'
337 warn during pretxncommit
321 warn during pretxncommit
338 warn during txnclose
322 warn during txnclose
339
323
340 $ hg commit -m 'commit 1'
324 $ hg commit -m 'commit 1'
341 nothing changed
325 nothing changed
342 [1]
326 [1]
343
327
344 $ cd ..
328 $ cd ..
345
329
346 An I/O error during txnclose is handled
330 An I/O error during txnclose is handled
347
331
348 $ hg init ioerror-txnclose
332 $ hg init ioerror-txnclose
349 $ cd ioerror-txnclose
333 $ cd ioerror-txnclose
350 $ echo 0 > foo
334 $ echo 0 > foo
351 $ hg -q commit -A -m initial
335 $ hg -q commit -A -m initial
352 warn during pretxncommit
336 warn during pretxncommit
353 warn during pretxnclose
337 warn during pretxnclose
354 warn during txnclose
338 warn during txnclose
355
339
356 $ echo 1 > foo
340 $ echo 1 > foo
357 $ hg --config ui.ioerrors=txnclose commit -m 'error during txnclose'
341 $ hg --config ui.ioerrors=txnclose commit -m 'error during txnclose'
358 warn during pretxncommit
342 warn during pretxncommit
359 warn during pretxnclose
343 warn during pretxnclose
360
344
361 $ hg commit -m 'commit 1'
345 $ hg commit -m 'commit 1'
362 nothing changed
346 nothing changed
363 [1]
347 [1]
364
348
365 $ cd ..
349 $ cd ..
366
350
367 An I/O error writing "transaction abort" is handled
351 An I/O error writing "transaction abort" is handled
368
352
369 $ hg init ioerror-msgabort
353 $ hg init ioerror-msgabort
370 $ cd ioerror-msgabort
354 $ cd ioerror-msgabort
371
355
372 $ echo 0 > foo
356 $ echo 0 > foo
373 $ hg -q commit -A -m initial
357 $ hg -q commit -A -m initial
374 warn during pretxncommit
358 warn during pretxncommit
375 warn during pretxnclose
359 warn during pretxnclose
376 warn during txnclose
360 warn during txnclose
377
361
378 $ echo 1 > foo
362 $ echo 1 > foo
379 $ hg --config ui.ioerrors=msgabort --config hooks.pretxncommit=false commit -m 'error during abort message'
363 $ hg --config ui.ioerrors=msgabort --config hooks.pretxncommit=false commit -m 'error during abort message'
380 warn during abort
364 warn during abort
381 rollback completed
365 rollback completed
382 abort: pretxncommit hook exited with status 1
366 abort: pretxncommit hook exited with status 1
383 [40]
367 [40]
384
368
385 $ hg commit -m 'commit 1'
369 $ hg commit -m 'commit 1'
386 warn during pretxncommit
370 warn during pretxncommit
387 warn during pretxnclose
371 warn during pretxnclose
388 warn during txnclose
372 warn during txnclose
389
373
390 $ cd ..
374 $ cd ..
391
375
392 An I/O error during txnabort should still result in rollback
376 An I/O error during txnabort should still result in rollback
393
377
394 $ hg init ioerror-txnabort
378 $ hg init ioerror-txnabort
395 $ cd ioerror-txnabort
379 $ cd ioerror-txnabort
396
380
397 $ echo 0 > foo
381 $ echo 0 > foo
398 $ hg -q commit -A -m initial
382 $ hg -q commit -A -m initial
399 warn during pretxncommit
383 warn during pretxncommit
400 warn during pretxnclose
384 warn during pretxnclose
401 warn during txnclose
385 warn during txnclose
402
386
403 $ echo 1 > foo
387 $ echo 1 > foo
404 $ hg --config ui.ioerrors=txnabort --config hooks.pretxncommit=false commit -m 'error during abort'
388 $ hg --config ui.ioerrors=txnabort --config hooks.pretxncommit=false commit -m 'error during abort'
405 transaction abort!
389 transaction abort!
406 rollback completed
390 rollback completed
407 abort: pretxncommit hook exited with status 1
391 abort: pretxncommit hook exited with status 1
408 [40]
392 [40]
409
393
410 $ hg commit -m 'commit 1'
394 $ hg commit -m 'commit 1'
411 warn during pretxncommit
395 warn during pretxncommit
412 warn during pretxnclose
396 warn during pretxnclose
413 warn during txnclose
397 warn during txnclose
414
398
415 $ cd ..
399 $ cd ..
416
400
417 An I/O error writing "rollback completed" is handled
401 An I/O error writing "rollback completed" is handled
418
402
419 $ hg init ioerror-msgrollback
403 $ hg init ioerror-msgrollback
420 $ cd ioerror-msgrollback
404 $ cd ioerror-msgrollback
421
405
422 $ echo 0 > foo
406 $ echo 0 > foo
423 $ hg -q commit -A -m initial
407 $ hg -q commit -A -m initial
424 warn during pretxncommit
408 warn during pretxncommit
425 warn during pretxnclose
409 warn during pretxnclose
426 warn during txnclose
410 warn during txnclose
427
411
428 $ echo 1 > foo
412 $ echo 1 > foo
429
413
430 $ hg --config ui.ioerrors=msgrollback --config hooks.pretxncommit=false commit -m 'error during rollback message'
414 $ hg --config ui.ioerrors=msgrollback --config hooks.pretxncommit=false commit -m 'error during rollback message'
431 transaction abort!
415 transaction abort!
432 warn during abort
416 warn during abort
433 abort: pretxncommit hook exited with status 1
417 abort: pretxncommit hook exited with status 1
434 [40]
418 [40]
435
419
436 $ hg verify
420 $ hg verify -q
437 checking changesets
438 checking manifests
439 crosschecking files in changesets and manifests
440 checking files
441 checked 1 changesets with 1 changes to 1 files
442
421
443 $ cd ..
422 $ cd ..
444
423
445 Multiple I/O errors after transaction open are handled.
424 Multiple I/O errors after transaction open are handled.
446 This is effectively what happens if a peer disconnects in the middle
425 This is effectively what happens if a peer disconnects in the middle
447 of a transaction.
426 of a transaction.
448
427
449 $ hg init ioerror-multiple
428 $ hg init ioerror-multiple
450 $ cd ioerror-multiple
429 $ cd ioerror-multiple
451 $ echo 0 > foo
430 $ echo 0 > foo
452 $ hg -q commit -A -m initial
431 $ hg -q commit -A -m initial
453 warn during pretxncommit
432 warn during pretxncommit
454 warn during pretxnclose
433 warn during pretxnclose
455 warn during txnclose
434 warn during txnclose
456
435
457 $ echo 1 > foo
436 $ echo 1 > foo
458
437
459 $ hg --config ui.ioerrors=pretxncommit,pretxnclose,txnclose,txnabort,msgabort,msgrollback commit -m 'multiple errors'
438 $ hg --config ui.ioerrors=pretxncommit,pretxnclose,txnclose,txnabort,msgabort,msgrollback commit -m 'multiple errors'
460
439
461 $ hg verify
440 $ hg verify -q
462 checking changesets
463 checking manifests
464 crosschecking files in changesets and manifests
465 checking files
466 checked 2 changesets with 2 changes to 1 files
467
441
468 $ cd ..
442 $ cd ..
@@ -1,138 +1,128
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3 $ echo foo>foo
3 $ echo foo>foo
4 $ hg addremove
4 $ hg addremove
5 adding foo
5 adding foo
6 $ hg commit -m "1"
6 $ hg commit -m "1"
7
7
8 $ hg verify
8 $ hg verify -q
9 checking changesets
10 checking manifests
11 crosschecking files in changesets and manifests
12 checking files
13 checked 1 changesets with 1 changes to 1 files
14
9
15 $ hg clone . ../branch
10 $ hg clone . ../branch
16 updating to branch default
11 updating to branch default
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 $ cd ../branch
13 $ cd ../branch
19 $ hg co
14 $ hg co
20 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 $ echo bar>>foo
16 $ echo bar>>foo
22 $ hg commit -m "2" -d '1 0'
17 $ hg commit -m "2" -d '1 0'
23
18
24 $ cd ../test
19 $ cd ../test
25
20
26 $ hg pull ../branch
21 $ hg pull ../branch
27 pulling from ../branch
22 pulling from ../branch
28 searching for changes
23 searching for changes
29 adding changesets
24 adding changesets
30 adding manifests
25 adding manifests
31 adding file changes
26 adding file changes
32 added 1 changesets with 1 changes to 1 files
27 added 1 changesets with 1 changes to 1 files
33 new changesets 84b9316f7b31
28 new changesets 84b9316f7b31
34 1 local changesets published
29 1 local changesets published
35 (run 'hg update' to get a working copy)
30 (run 'hg update' to get a working copy)
36
31
37 $ hg verify
32 $ hg verify -q
38 checking changesets
39 checking manifests
40 crosschecking files in changesets and manifests
41 checking files
42 checked 2 changesets with 2 changes to 1 files
43
33
44 $ hg co
34 $ hg co
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46
36
47 $ cat foo
37 $ cat foo
48 foo
38 foo
49 bar
39 bar
50
40
51 $ hg manifest --debug
41 $ hg manifest --debug
52 6f4310b00b9a147241b071a60c28a650827fb03d 644 foo
42 6f4310b00b9a147241b071a60c28a650827fb03d 644 foo
53
43
54 update to rev 0 with a date
44 update to rev 0 with a date
55
45
56 $ hg upd -d foo 0
46 $ hg upd -d foo 0
57 abort: you can't specify a revision and a date
47 abort: you can't specify a revision and a date
58 [10]
48 [10]
59
49
60 update by date
50 update by date
61
51
62 $ hg update -d '<1970-01-01 00:00:02 +0000'
52 $ hg update -d '<1970-01-01 00:00:02 +0000'
63 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
53 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
64 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 $ hg update -d '<1970-01-01 00:00:01 +0000'
55 $ hg update -d '<1970-01-01 00:00:01 +0000'
66 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
56 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
67 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 $ hg update -d '<1970-01-01 00:00:00 +0000'
58 $ hg update -d '<1970-01-01 00:00:00 +0000'
69 found revision 0 from Thu Jan 01 00:00:00 1970 +0000
59 found revision 0 from Thu Jan 01 00:00:00 1970 +0000
70 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
60 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
71
61
72 $ hg update -d '>1970-01-01 00:00:02 +0000'
62 $ hg update -d '>1970-01-01 00:00:02 +0000'
73 abort: revision matching date not found
63 abort: revision matching date not found
74 [10]
64 [10]
75 $ hg update -d '>1970-01-01 00:00:01 +0000'
65 $ hg update -d '>1970-01-01 00:00:01 +0000'
76 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
66 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ hg update -d '>1970-01-01 00:00:00 +0000'
68 $ hg update -d '>1970-01-01 00:00:00 +0000'
79 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
69 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
80 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
81
71
82 update to default destination (with empty revspec)
72 update to default destination (with empty revspec)
83
73
84 $ hg update -q null
74 $ hg update -q null
85 $ hg update
75 $ hg update
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 $ hg id
77 $ hg id
88 84b9316f7b31 tip
78 84b9316f7b31 tip
89
79
90 $ hg update -q null
80 $ hg update -q null
91 $ hg update -r ''
81 $ hg update -r ''
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 $ hg id
83 $ hg id
94 84b9316f7b31 tip
84 84b9316f7b31 tip
95
85
96 $ hg update -q null
86 $ hg update -q null
97 $ hg update ''
87 $ hg update ''
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 $ hg id
89 $ hg id
100 84b9316f7b31 tip
90 84b9316f7b31 tip
101
91
102 $ cd ..
92 $ cd ..
103
93
104 update with worker processes
94 update with worker processes
105
95
106 #if no-windows
96 #if no-windows
107
97
108 $ cat <<EOF > forceworker.py
98 $ cat <<EOF > forceworker.py
109 > from mercurial import extensions, worker
99 > from mercurial import extensions, worker
110 > def nocost(orig, ui, costperop, nops, threadsafe=True):
100 > def nocost(orig, ui, costperop, nops, threadsafe=True):
111 > return worker._numworkers(ui) > 1
101 > return worker._numworkers(ui) > 1
112 > def uisetup(ui):
102 > def uisetup(ui):
113 > extensions.wrapfunction(worker, 'worthwhile', nocost)
103 > extensions.wrapfunction(worker, 'worthwhile', nocost)
114 > EOF
104 > EOF
115
105
116 $ hg init worker
106 $ hg init worker
117 $ cd worker
107 $ cd worker
118 $ cat <<EOF >> .hg/hgrc
108 $ cat <<EOF >> .hg/hgrc
119 > [extensions]
109 > [extensions]
120 > forceworker = $TESTTMP/forceworker.py
110 > forceworker = $TESTTMP/forceworker.py
121 > [worker]
111 > [worker]
122 > numcpus = 4
112 > numcpus = 4
123 > EOF
113 > EOF
124 $ for i in `"$PYTHON" $TESTDIR/seq.py 1 100`; do
114 $ for i in `"$PYTHON" $TESTDIR/seq.py 1 100`; do
125 > echo $i > $i
115 > echo $i > $i
126 > done
116 > done
127 $ hg ci -qAm 'add 100 files'
117 $ hg ci -qAm 'add 100 files'
128
118
129 $ hg update null
119 $ hg update null
130 0 files updated, 0 files merged, 100 files removed, 0 files unresolved
120 0 files updated, 0 files merged, 100 files removed, 0 files unresolved
131 $ hg update -v | grep 100
121 $ hg update -v | grep 100
132 getting 100
122 getting 100
133 100 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 100 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 $ hg status
124 $ hg status
135
125
136 $ cd ..
126 $ cd ..
137
127
138 #endif
128 #endif
@@ -1,596 +1,581
1 This test is a duplicate of 'test-http.t' feel free to factor out
1 This test is a duplicate of 'test-http.t' feel free to factor out
2 parts that are not bundle1/bundle2 specific.
2 parts that are not bundle1/bundle2 specific.
3
3
4 $ cat << EOF >> $HGRCPATH
4 $ cat << EOF >> $HGRCPATH
5 > [devel]
5 > [devel]
6 > # This test is dedicated to interaction through old bundle
6 > # This test is dedicated to interaction through old bundle
7 > legacy.exchange = bundle1
7 > legacy.exchange = bundle1
8 > EOF
8 > EOF
9
9
10
10
11 This test tries to exercise the ssh functionality with a dummy script
11 This test tries to exercise the ssh functionality with a dummy script
12
12
13 creating 'remote' repo
13 creating 'remote' repo
14
14
15 $ hg init remote
15 $ hg init remote
16 $ cd remote
16 $ cd remote
17 $ echo this > foo
17 $ echo this > foo
18 $ echo this > fooO
18 $ echo this > fooO
19 $ hg ci -A -m "init" foo fooO
19 $ hg ci -A -m "init" foo fooO
20
20
21 insert a closed branch (issue4428)
21 insert a closed branch (issue4428)
22
22
23 $ hg up null
23 $ hg up null
24 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
24 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
25 $ hg branch closed
25 $ hg branch closed
26 marked working directory as branch closed
26 marked working directory as branch closed
27 (branches are permanent and global, did you want a bookmark?)
27 (branches are permanent and global, did you want a bookmark?)
28 $ hg ci -mc0
28 $ hg ci -mc0
29 $ hg ci --close-branch -mc1
29 $ hg ci --close-branch -mc1
30 $ hg up -q default
30 $ hg up -q default
31
31
32 configure for serving
32 configure for serving
33
33
34 $ cat <<EOF > .hg/hgrc
34 $ cat <<EOF > .hg/hgrc
35 > [server]
35 > [server]
36 > uncompressed = True
36 > uncompressed = True
37 >
37 >
38 > [hooks]
38 > [hooks]
39 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
39 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
40 > EOF
40 > EOF
41 $ cd $TESTTMP
41 $ cd $TESTTMP
42
42
43 repo not found error
43 repo not found error
44
44
45 $ hg clone ssh://user@dummy/nonexistent local
45 $ hg clone ssh://user@dummy/nonexistent local
46 remote: abort: repository nonexistent not found
46 remote: abort: repository nonexistent not found
47 abort: no suitable response from remote hg
47 abort: no suitable response from remote hg
48 [255]
48 [255]
49
49
50 non-existent absolute path
50 non-existent absolute path
51
51
52 #if no-msys
52 #if no-msys
53 $ hg clone ssh://user@dummy//`pwd`/nonexistent local
53 $ hg clone ssh://user@dummy//`pwd`/nonexistent local
54 remote: abort: repository /$TESTTMP/nonexistent not found
54 remote: abort: repository /$TESTTMP/nonexistent not found
55 abort: no suitable response from remote hg
55 abort: no suitable response from remote hg
56 [255]
56 [255]
57 #endif
57 #endif
58
58
59 clone remote via stream
59 clone remote via stream
60
60
61 #if no-reposimplestore
61 #if no-reposimplestore
62
62
63 $ hg clone --stream ssh://user@dummy/remote local-stream
63 $ hg clone --stream ssh://user@dummy/remote local-stream
64 streaming all changes
64 streaming all changes
65 4 files to transfer, 602 bytes of data (no-zstd !)
65 4 files to transfer, 602 bytes of data (no-zstd !)
66 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
66 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
67 4 files to transfer, 621 bytes of data (zstd !)
67 4 files to transfer, 621 bytes of data (zstd !)
68 transferred 621 bytes in * seconds (* */sec) (glob) (zstd !)
68 transferred 621 bytes in * seconds (* */sec) (glob) (zstd !)
69 searching for changes
69 searching for changes
70 no changes found
70 no changes found
71 updating to branch default
71 updating to branch default
72 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 $ cd local-stream
73 $ cd local-stream
74 $ hg verify
74 $ hg verify -q
75 checking changesets
76 checking manifests
77 crosschecking files in changesets and manifests
78 checking files
79 checked 3 changesets with 2 changes to 2 files
80 $ hg branches
75 $ hg branches
81 default 0:1160648e36ce
76 default 0:1160648e36ce
82 $ cd $TESTTMP
77 $ cd $TESTTMP
83
78
84 clone bookmarks via stream
79 clone bookmarks via stream
85
80
86 $ hg -R local-stream book mybook
81 $ hg -R local-stream book mybook
87 $ hg clone --stream ssh://user@dummy/local-stream stream2
82 $ hg clone --stream ssh://user@dummy/local-stream stream2
88 streaming all changes
83 streaming all changes
89 4 files to transfer, 602 bytes of data (no-zstd !)
84 4 files to transfer, 602 bytes of data (no-zstd !)
90 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
85 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
91 4 files to transfer, 621 bytes of data (zstd !)
86 4 files to transfer, 621 bytes of data (zstd !)
92 transferred 621 bytes in * seconds (* */sec) (glob) (zstd !)
87 transferred 621 bytes in * seconds (* */sec) (glob) (zstd !)
93 searching for changes
88 searching for changes
94 no changes found
89 no changes found
95 updating to branch default
90 updating to branch default
96 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 $ cd stream2
92 $ cd stream2
98 $ hg book
93 $ hg book
99 mybook 0:1160648e36ce
94 mybook 0:1160648e36ce
100 $ cd $TESTTMP
95 $ cd $TESTTMP
101 $ rm -rf local-stream stream2
96 $ rm -rf local-stream stream2
102
97
103 #endif
98 #endif
104
99
105 clone remote via pull
100 clone remote via pull
106
101
107 $ hg clone ssh://user@dummy/remote local
102 $ hg clone ssh://user@dummy/remote local
108 requesting all changes
103 requesting all changes
109 adding changesets
104 adding changesets
110 adding manifests
105 adding manifests
111 adding file changes
106 adding file changes
112 added 3 changesets with 2 changes to 2 files
107 added 3 changesets with 2 changes to 2 files
113 new changesets 1160648e36ce:ad076bfb429d
108 new changesets 1160648e36ce:ad076bfb429d
114 updating to branch default
109 updating to branch default
115 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
116
111
117 verify
112 verify
118
113
119 $ cd local
114 $ cd local
120 $ hg verify
115 $ hg verify -q
121 checking changesets
122 checking manifests
123 crosschecking files in changesets and manifests
124 checking files
125 checked 3 changesets with 2 changes to 2 files
126 $ cat >> .hg/hgrc <<EOF
116 $ cat >> .hg/hgrc <<EOF
127 > [hooks]
117 > [hooks]
128 > changegroup = sh -c "printenv.py --line changegroup-in-local 0 ../dummylog"
118 > changegroup = sh -c "printenv.py --line changegroup-in-local 0 ../dummylog"
129 > EOF
119 > EOF
130
120
131 empty default pull
121 empty default pull
132
122
133 $ hg paths
123 $ hg paths
134 default = ssh://user@dummy/remote
124 default = ssh://user@dummy/remote
135 $ hg pull
125 $ hg pull
136 pulling from ssh://user@dummy/remote
126 pulling from ssh://user@dummy/remote
137 searching for changes
127 searching for changes
138 no changes found
128 no changes found
139
129
140 pull from wrong ssh URL
130 pull from wrong ssh URL
141
131
142 $ hg pull ssh://user@dummy/doesnotexist
132 $ hg pull ssh://user@dummy/doesnotexist
143 pulling from ssh://user@dummy/doesnotexist
133 pulling from ssh://user@dummy/doesnotexist
144 remote: abort: repository doesnotexist not found
134 remote: abort: repository doesnotexist not found
145 abort: no suitable response from remote hg
135 abort: no suitable response from remote hg
146 [255]
136 [255]
147
137
148 local change
138 local change
149
139
150 $ echo bleah > foo
140 $ echo bleah > foo
151 $ hg ci -m "add"
141 $ hg ci -m "add"
152
142
153 updating rc
143 updating rc
154
144
155 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
145 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
156
146
157 find outgoing
147 find outgoing
158
148
159 $ hg out ssh://user@dummy/remote
149 $ hg out ssh://user@dummy/remote
160 comparing with ssh://user@dummy/remote
150 comparing with ssh://user@dummy/remote
161 searching for changes
151 searching for changes
162 changeset: 3:a28a9d1a809c
152 changeset: 3:a28a9d1a809c
163 tag: tip
153 tag: tip
164 parent: 0:1160648e36ce
154 parent: 0:1160648e36ce
165 user: test
155 user: test
166 date: Thu Jan 01 00:00:00 1970 +0000
156 date: Thu Jan 01 00:00:00 1970 +0000
167 summary: add
157 summary: add
168
158
169
159
170 find incoming on the remote side
160 find incoming on the remote side
171
161
172 $ hg incoming -R ../remote ssh://user@dummy/local
162 $ hg incoming -R ../remote ssh://user@dummy/local
173 comparing with ssh://user@dummy/local
163 comparing with ssh://user@dummy/local
174 searching for changes
164 searching for changes
175 changeset: 3:a28a9d1a809c
165 changeset: 3:a28a9d1a809c
176 tag: tip
166 tag: tip
177 parent: 0:1160648e36ce
167 parent: 0:1160648e36ce
178 user: test
168 user: test
179 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
180 summary: add
170 summary: add
181
171
182
172
183 find incoming on the remote side (using absolute path)
173 find incoming on the remote side (using absolute path)
184
174
185 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
175 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
186 comparing with ssh://user@dummy/$TESTTMP/local
176 comparing with ssh://user@dummy/$TESTTMP/local
187 searching for changes
177 searching for changes
188 changeset: 3:a28a9d1a809c
178 changeset: 3:a28a9d1a809c
189 tag: tip
179 tag: tip
190 parent: 0:1160648e36ce
180 parent: 0:1160648e36ce
191 user: test
181 user: test
192 date: Thu Jan 01 00:00:00 1970 +0000
182 date: Thu Jan 01 00:00:00 1970 +0000
193 summary: add
183 summary: add
194
184
195
185
196 push
186 push
197
187
198 $ hg push
188 $ hg push
199 pushing to ssh://user@dummy/remote
189 pushing to ssh://user@dummy/remote
200 searching for changes
190 searching for changes
201 remote: adding changesets
191 remote: adding changesets
202 remote: adding manifests
192 remote: adding manifests
203 remote: adding file changes
193 remote: adding file changes
204 remote: added 1 changesets with 1 changes to 1 files
194 remote: added 1 changesets with 1 changes to 1 files
205 $ cd $TESTTMP/remote
195 $ cd $TESTTMP/remote
206
196
207 check remote tip
197 check remote tip
208
198
209 $ hg tip
199 $ hg tip
210 changeset: 3:a28a9d1a809c
200 changeset: 3:a28a9d1a809c
211 tag: tip
201 tag: tip
212 parent: 0:1160648e36ce
202 parent: 0:1160648e36ce
213 user: test
203 user: test
214 date: Thu Jan 01 00:00:00 1970 +0000
204 date: Thu Jan 01 00:00:00 1970 +0000
215 summary: add
205 summary: add
216
206
217 $ hg verify
207 $ hg verify -q
218 checking changesets
219 checking manifests
220 crosschecking files in changesets and manifests
221 checking files
222 checked 4 changesets with 3 changes to 2 files
223 $ hg cat -r tip foo
208 $ hg cat -r tip foo
224 bleah
209 bleah
225 $ echo z > z
210 $ echo z > z
226 $ hg ci -A -m z z
211 $ hg ci -A -m z z
227 created new head
212 created new head
228
213
229 test pushkeys and bookmarks
214 test pushkeys and bookmarks
230
215
231 $ cd $TESTTMP/local
216 $ cd $TESTTMP/local
232 $ hg debugpushkey ssh://user@dummy/remote namespaces
217 $ hg debugpushkey ssh://user@dummy/remote namespaces
233 bookmarks
218 bookmarks
234 namespaces
219 namespaces
235 phases
220 phases
236 $ hg book foo -r 0
221 $ hg book foo -r 0
237 $ hg out -B
222 $ hg out -B
238 comparing with ssh://user@dummy/remote
223 comparing with ssh://user@dummy/remote
239 searching for changed bookmarks
224 searching for changed bookmarks
240 foo 1160648e36ce
225 foo 1160648e36ce
241 $ hg push -B foo
226 $ hg push -B foo
242 pushing to ssh://user@dummy/remote
227 pushing to ssh://user@dummy/remote
243 searching for changes
228 searching for changes
244 no changes found
229 no changes found
245 exporting bookmark foo
230 exporting bookmark foo
246 [1]
231 [1]
247 $ hg debugpushkey ssh://user@dummy/remote bookmarks
232 $ hg debugpushkey ssh://user@dummy/remote bookmarks
248 foo 1160648e36cec0054048a7edc4110c6f84fde594
233 foo 1160648e36cec0054048a7edc4110c6f84fde594
249 $ hg book -f foo
234 $ hg book -f foo
250 $ hg push --traceback
235 $ hg push --traceback
251 pushing to ssh://user@dummy/remote
236 pushing to ssh://user@dummy/remote
252 searching for changes
237 searching for changes
253 no changes found
238 no changes found
254 updating bookmark foo
239 updating bookmark foo
255 [1]
240 [1]
256 $ hg book -d foo
241 $ hg book -d foo
257 $ hg in -B
242 $ hg in -B
258 comparing with ssh://user@dummy/remote
243 comparing with ssh://user@dummy/remote
259 searching for changed bookmarks
244 searching for changed bookmarks
260 foo a28a9d1a809c
245 foo a28a9d1a809c
261 $ hg book -f -r 0 foo
246 $ hg book -f -r 0 foo
262 $ hg pull -B foo
247 $ hg pull -B foo
263 pulling from ssh://user@dummy/remote
248 pulling from ssh://user@dummy/remote
264 no changes found
249 no changes found
265 updating bookmark foo
250 updating bookmark foo
266 $ hg book -d foo
251 $ hg book -d foo
267 $ hg push -B foo
252 $ hg push -B foo
268 pushing to ssh://user@dummy/remote
253 pushing to ssh://user@dummy/remote
269 searching for changes
254 searching for changes
270 no changes found
255 no changes found
271 deleting remote bookmark foo
256 deleting remote bookmark foo
272 [1]
257 [1]
273
258
274 a bad, evil hook that prints to stdout
259 a bad, evil hook that prints to stdout
275
260
276 $ cat <<EOF > $TESTTMP/badhook
261 $ cat <<EOF > $TESTTMP/badhook
277 > import sys
262 > import sys
278 > sys.stdout.write("KABOOM\n")
263 > sys.stdout.write("KABOOM\n")
279 > EOF
264 > EOF
280
265
281 $ echo '[hooks]' >> ../remote/.hg/hgrc
266 $ echo '[hooks]' >> ../remote/.hg/hgrc
282 $ echo "changegroup.stdout = \"$PYTHON\" $TESTTMP/badhook" >> ../remote/.hg/hgrc
267 $ echo "changegroup.stdout = \"$PYTHON\" $TESTTMP/badhook" >> ../remote/.hg/hgrc
283 $ echo r > r
268 $ echo r > r
284 $ hg ci -A -m z r
269 $ hg ci -A -m z r
285
270
286 push should succeed even though it has an unexpected response
271 push should succeed even though it has an unexpected response
287
272
288 $ hg push
273 $ hg push
289 pushing to ssh://user@dummy/remote
274 pushing to ssh://user@dummy/remote
290 searching for changes
275 searching for changes
291 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
276 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
292 remote: adding changesets
277 remote: adding changesets
293 remote: adding manifests
278 remote: adding manifests
294 remote: adding file changes
279 remote: adding file changes
295 remote: added 1 changesets with 1 changes to 1 files (py3 !)
280 remote: added 1 changesets with 1 changes to 1 files (py3 !)
296 remote: KABOOM
281 remote: KABOOM
297 $ hg -R ../remote heads
282 $ hg -R ../remote heads
298 changeset: 5:1383141674ec
283 changeset: 5:1383141674ec
299 tag: tip
284 tag: tip
300 parent: 3:a28a9d1a809c
285 parent: 3:a28a9d1a809c
301 user: test
286 user: test
302 date: Thu Jan 01 00:00:00 1970 +0000
287 date: Thu Jan 01 00:00:00 1970 +0000
303 summary: z
288 summary: z
304
289
305 changeset: 4:6c0482d977a3
290 changeset: 4:6c0482d977a3
306 parent: 0:1160648e36ce
291 parent: 0:1160648e36ce
307 user: test
292 user: test
308 date: Thu Jan 01 00:00:00 1970 +0000
293 date: Thu Jan 01 00:00:00 1970 +0000
309 summary: z
294 summary: z
310
295
311
296
312 clone bookmarks
297 clone bookmarks
313
298
314 $ hg -R ../remote bookmark test
299 $ hg -R ../remote bookmark test
315 $ hg -R ../remote bookmarks
300 $ hg -R ../remote bookmarks
316 * test 4:6c0482d977a3
301 * test 4:6c0482d977a3
317 $ hg clone ssh://user@dummy/remote local-bookmarks
302 $ hg clone ssh://user@dummy/remote local-bookmarks
318 requesting all changes
303 requesting all changes
319 adding changesets
304 adding changesets
320 adding manifests
305 adding manifests
321 adding file changes
306 adding file changes
322 added 6 changesets with 5 changes to 4 files (+1 heads)
307 added 6 changesets with 5 changes to 4 files (+1 heads)
323 new changesets 1160648e36ce:1383141674ec
308 new changesets 1160648e36ce:1383141674ec
324 updating to branch default
309 updating to branch default
325 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
310 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 $ hg -R local-bookmarks bookmarks
311 $ hg -R local-bookmarks bookmarks
327 test 4:6c0482d977a3
312 test 4:6c0482d977a3
328
313
329 passwords in ssh urls are not supported
314 passwords in ssh urls are not supported
330 (we use a glob here because different Python versions give different
315 (we use a glob here because different Python versions give different
331 results here)
316 results here)
332
317
333 $ hg push ssh://user:erroneouspwd@dummy/remote
318 $ hg push ssh://user:erroneouspwd@dummy/remote
334 pushing to ssh://user:*@dummy/remote (glob)
319 pushing to ssh://user:*@dummy/remote (glob)
335 abort: password in URL not supported
320 abort: password in URL not supported
336 [255]
321 [255]
337
322
338 $ cd $TESTTMP
323 $ cd $TESTTMP
339
324
340 hide outer repo
325 hide outer repo
341 $ hg init
326 $ hg init
342
327
343 Test remote paths with spaces (issue2983):
328 Test remote paths with spaces (issue2983):
344
329
345 $ hg init "ssh://user@dummy/a repo"
330 $ hg init "ssh://user@dummy/a repo"
346 $ touch "$TESTTMP/a repo/test"
331 $ touch "$TESTTMP/a repo/test"
347 $ hg -R 'a repo' commit -A -m "test"
332 $ hg -R 'a repo' commit -A -m "test"
348 adding test
333 adding test
349 $ hg -R 'a repo' tag tag
334 $ hg -R 'a repo' tag tag
350 $ hg id "ssh://user@dummy/a repo"
335 $ hg id "ssh://user@dummy/a repo"
351 73649e48688a
336 73649e48688a
352
337
353 $ hg id "ssh://user@dummy/a repo#noNoNO"
338 $ hg id "ssh://user@dummy/a repo#noNoNO"
354 abort: unknown revision 'noNoNO'
339 abort: unknown revision 'noNoNO'
355 [255]
340 [255]
356
341
357 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
342 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
358
343
359 $ hg clone "ssh://user@dummy/a repo"
344 $ hg clone "ssh://user@dummy/a repo"
360 destination directory: a repo
345 destination directory: a repo
361 abort: destination 'a repo' is not empty
346 abort: destination 'a repo' is not empty
362 [10]
347 [10]
363
348
364 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
349 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
365 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
350 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
366 parameters:
351 parameters:
367
352
368 $ cat > ssh.sh << EOF
353 $ cat > ssh.sh << EOF
369 > userhost="\$1"
354 > userhost="\$1"
370 > SSH_ORIGINAL_COMMAND="\$2"
355 > SSH_ORIGINAL_COMMAND="\$2"
371 > export SSH_ORIGINAL_COMMAND
356 > export SSH_ORIGINAL_COMMAND
372 > PYTHONPATH="$PYTHONPATH"
357 > PYTHONPATH="$PYTHONPATH"
373 > export PYTHONPATH
358 > export PYTHONPATH
374 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
359 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
375 > EOF
360 > EOF
376
361
377 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
362 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
378 73649e48688a
363 73649e48688a
379
364
380 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
365 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
381 remote: Illegal repository "$TESTTMP/a'repo"
366 remote: Illegal repository "$TESTTMP/a'repo"
382 abort: no suitable response from remote hg
367 abort: no suitable response from remote hg
383 [255]
368 [255]
384
369
385 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
370 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
386 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
371 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
387 abort: no suitable response from remote hg
372 abort: no suitable response from remote hg
388 [255]
373 [255]
389
374
390 $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
375 $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
391 Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation
376 Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation
392 [255]
377 [255]
393
378
394 Test hg-ssh in read-only mode:
379 Test hg-ssh in read-only mode:
395
380
396 $ cat > ssh.sh << EOF
381 $ cat > ssh.sh << EOF
397 > userhost="\$1"
382 > userhost="\$1"
398 > SSH_ORIGINAL_COMMAND="\$2"
383 > SSH_ORIGINAL_COMMAND="\$2"
399 > export SSH_ORIGINAL_COMMAND
384 > export SSH_ORIGINAL_COMMAND
400 > PYTHONPATH="$PYTHONPATH"
385 > PYTHONPATH="$PYTHONPATH"
401 > export PYTHONPATH
386 > export PYTHONPATH
402 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
387 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
403 > EOF
388 > EOF
404
389
405 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
390 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
406 requesting all changes
391 requesting all changes
407 adding changesets
392 adding changesets
408 adding manifests
393 adding manifests
409 adding file changes
394 adding file changes
410 added 6 changesets with 5 changes to 4 files (+1 heads)
395 added 6 changesets with 5 changes to 4 files (+1 heads)
411 new changesets 1160648e36ce:1383141674ec
396 new changesets 1160648e36ce:1383141674ec
412 updating to branch default
397 updating to branch default
413 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
398 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
414
399
415 $ cd read-only-local
400 $ cd read-only-local
416 $ echo "baz" > bar
401 $ echo "baz" > bar
417 $ hg ci -A -m "unpushable commit" bar
402 $ hg ci -A -m "unpushable commit" bar
418 $ hg push --ssh "sh ../ssh.sh"
403 $ hg push --ssh "sh ../ssh.sh"
419 pushing to ssh://user@dummy/*/remote (glob)
404 pushing to ssh://user@dummy/*/remote (glob)
420 searching for changes
405 searching for changes
421 remote: Permission denied
406 remote: Permission denied
422 remote: abort: pretxnopen.hg-ssh hook failed
407 remote: abort: pretxnopen.hg-ssh hook failed
423 remote: Permission denied
408 remote: Permission denied
424 remote: pushkey-abort: prepushkey.hg-ssh hook failed
409 remote: pushkey-abort: prepushkey.hg-ssh hook failed
425 updating 6c0482d977a3 to public failed!
410 updating 6c0482d977a3 to public failed!
426 [1]
411 [1]
427
412
428 $ cd $TESTTMP
413 $ cd $TESTTMP
429
414
430 stderr from remote commands should be printed before stdout from local code (issue4336)
415 stderr from remote commands should be printed before stdout from local code (issue4336)
431
416
432 $ hg clone remote stderr-ordering
417 $ hg clone remote stderr-ordering
433 updating to branch default
418 updating to branch default
434 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
419 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 $ cd stderr-ordering
420 $ cd stderr-ordering
436 $ cat >> localwrite.py << EOF
421 $ cat >> localwrite.py << EOF
437 > from mercurial import exchange, extensions
422 > from mercurial import exchange, extensions
438 >
423 >
439 > def wrappedpush(orig, repo, *args, **kwargs):
424 > def wrappedpush(orig, repo, *args, **kwargs):
440 > res = orig(repo, *args, **kwargs)
425 > res = orig(repo, *args, **kwargs)
441 > repo.ui.write(b'local stdout\n')
426 > repo.ui.write(b'local stdout\n')
442 > return res
427 > return res
443 >
428 >
444 > def extsetup(ui):
429 > def extsetup(ui):
445 > extensions.wrapfunction(exchange, b'push', wrappedpush)
430 > extensions.wrapfunction(exchange, b'push', wrappedpush)
446 > EOF
431 > EOF
447
432
448 $ cat >> .hg/hgrc << EOF
433 $ cat >> .hg/hgrc << EOF
449 > [paths]
434 > [paths]
450 > default-push = ssh://user@dummy/remote
435 > default-push = ssh://user@dummy/remote
451 > [extensions]
436 > [extensions]
452 > localwrite = localwrite.py
437 > localwrite = localwrite.py
453 > EOF
438 > EOF
454
439
455 $ echo localwrite > foo
440 $ echo localwrite > foo
456 $ hg commit -m 'testing localwrite'
441 $ hg commit -m 'testing localwrite'
457 $ hg push
442 $ hg push
458 pushing to ssh://user@dummy/remote
443 pushing to ssh://user@dummy/remote
459 searching for changes
444 searching for changes
460 remote: adding changesets
445 remote: adding changesets
461 remote: adding manifests
446 remote: adding manifests
462 remote: adding file changes
447 remote: adding file changes
463 remote: added 1 changesets with 1 changes to 1 files (py3 !)
448 remote: added 1 changesets with 1 changes to 1 files (py3 !)
464 remote: KABOOM
449 remote: KABOOM
465 local stdout
450 local stdout
466
451
467 debug output
452 debug output
468
453
469 $ hg pull --debug ssh://user@dummy/remote
454 $ hg pull --debug ssh://user@dummy/remote
470 pulling from ssh://user@dummy/remote
455 pulling from ssh://user@dummy/remote
471 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
456 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
472 sending hello command
457 sending hello command
473 sending between command
458 sending between command
474 remote: \d+ (re)
459 remote: \d+ (re)
475 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
460 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
476 remote: 1
461 remote: 1
477 sending protocaps command
462 sending protocaps command
478 preparing listkeys for "bookmarks"
463 preparing listkeys for "bookmarks"
479 sending listkeys command
464 sending listkeys command
480 received listkey for "bookmarks": 45 bytes
465 received listkey for "bookmarks": 45 bytes
481 query 1; heads
466 query 1; heads
482 sending batch command
467 sending batch command
483 searching for changes
468 searching for changes
484 all remote heads known locally
469 all remote heads known locally
485 no changes found
470 no changes found
486 preparing listkeys for "phases"
471 preparing listkeys for "phases"
487 sending listkeys command
472 sending listkeys command
488 received listkey for "phases": 15 bytes
473 received listkey for "phases": 15 bytes
489 checking for updated bookmarks
474 checking for updated bookmarks
490
475
491 $ cd $TESTTMP
476 $ cd $TESTTMP
492
477
493 $ cat dummylog
478 $ cat dummylog
494 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
479 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
495 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio (no-msys !)
480 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio (no-msys !)
496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
481 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
497 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
482 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
498 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
483 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
499 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
484 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
500 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
485 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
486 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
502 Got arguments 1:user@dummy 2:hg -R local serve --stdio
487 Got arguments 1:user@dummy 2:hg -R local serve --stdio
503 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
488 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
489 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
505 changegroup-in-remote hook: HG_HOOKNAME=changegroup
490 changegroup-in-remote hook: HG_HOOKNAME=changegroup
506 HG_HOOKTYPE=changegroup
491 HG_HOOKTYPE=changegroup
507 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
492 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
508 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
493 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
509 HG_SOURCE=serve
494 HG_SOURCE=serve
510 HG_TXNID=TXN:$ID$
495 HG_TXNID=TXN:$ID$
511 HG_TXNNAME=serve
496 HG_TXNNAME=serve
512 remote:ssh:$LOCALIP
497 remote:ssh:$LOCALIP
513 HG_URL=remote:ssh:$LOCALIP
498 HG_URL=remote:ssh:$LOCALIP
514
499
515 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
500 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
516 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
517 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
502 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
518 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
503 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
519 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
520 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
505 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
521 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
506 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
522 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
507 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
523 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
508 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
524 changegroup-in-remote hook: HG_HOOKNAME=changegroup
509 changegroup-in-remote hook: HG_HOOKNAME=changegroup
525 HG_HOOKTYPE=changegroup
510 HG_HOOKTYPE=changegroup
526 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
511 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
527 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
512 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
528 HG_SOURCE=serve
513 HG_SOURCE=serve
529 HG_TXNID=TXN:$ID$
514 HG_TXNID=TXN:$ID$
530 HG_TXNNAME=serve
515 HG_TXNNAME=serve
531 remote:ssh:$LOCALIP
516 remote:ssh:$LOCALIP
532 HG_URL=remote:ssh:$LOCALIP
517 HG_URL=remote:ssh:$LOCALIP
533
518
534 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
519 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
535 Got arguments 1:user@dummy 2:hg init 'a repo'
520 Got arguments 1:user@dummy 2:hg init 'a repo'
536 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
521 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
537 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
522 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
538 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
523 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
539 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
524 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
540 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
525 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
541 changegroup-in-remote hook: HG_HOOKNAME=changegroup
526 changegroup-in-remote hook: HG_HOOKNAME=changegroup
542 HG_HOOKTYPE=changegroup
527 HG_HOOKTYPE=changegroup
543 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
528 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
544 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
529 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
545 HG_SOURCE=serve
530 HG_SOURCE=serve
546 HG_TXNID=TXN:$ID$
531 HG_TXNID=TXN:$ID$
547 HG_TXNNAME=serve
532 HG_TXNNAME=serve
548 remote:ssh:$LOCALIP
533 remote:ssh:$LOCALIP
549 HG_URL=remote:ssh:$LOCALIP
534 HG_URL=remote:ssh:$LOCALIP
550
535
551 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
536 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
552
537
553 remote hook failure is attributed to remote
538 remote hook failure is attributed to remote
554
539
555 $ cat > $TESTTMP/failhook << EOF
540 $ cat > $TESTTMP/failhook << EOF
556 > def hook(ui, repo, **kwargs):
541 > def hook(ui, repo, **kwargs):
557 > ui.write(b'hook failure!\n')
542 > ui.write(b'hook failure!\n')
558 > ui.flush()
543 > ui.flush()
559 > return 1
544 > return 1
560 > EOF
545 > EOF
561
546
562 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
547 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
563
548
564 $ hg -q clone ssh://user@dummy/remote hookout
549 $ hg -q clone ssh://user@dummy/remote hookout
565 $ cd hookout
550 $ cd hookout
566 $ touch hookfailure
551 $ touch hookfailure
567 $ hg -q commit -A -m 'remote hook failure'
552 $ hg -q commit -A -m 'remote hook failure'
568 $ hg push
553 $ hg push
569 pushing to ssh://user@dummy/remote
554 pushing to ssh://user@dummy/remote
570 searching for changes
555 searching for changes
571 remote: adding changesets
556 remote: adding changesets
572 remote: adding manifests
557 remote: adding manifests
573 remote: adding file changes
558 remote: adding file changes
574 remote: hook failure!
559 remote: hook failure!
575 remote: transaction abort!
560 remote: transaction abort!
576 remote: rollback completed
561 remote: rollback completed
577 remote: abort: pretxnchangegroup.fail hook failed
562 remote: abort: pretxnchangegroup.fail hook failed
578 [1]
563 [1]
579
564
580 abort during pull is properly reported as such
565 abort during pull is properly reported as such
581
566
582 $ echo morefoo >> ../remote/foo
567 $ echo morefoo >> ../remote/foo
583 $ hg -R ../remote commit --message "more foo to be pulled"
568 $ hg -R ../remote commit --message "more foo to be pulled"
584 $ cat >> ../remote/.hg/hgrc << EOF
569 $ cat >> ../remote/.hg/hgrc << EOF
585 > [extensions]
570 > [extensions]
586 > crash = ${TESTDIR}/crashgetbundler.py
571 > crash = ${TESTDIR}/crashgetbundler.py
587 > EOF
572 > EOF
588 $ hg pull
573 $ hg pull
589 pulling from ssh://user@dummy/remote
574 pulling from ssh://user@dummy/remote
590 searching for changes
575 searching for changes
591 adding changesets
576 adding changesets
592 remote: abort: this is an exercise
577 remote: abort: this is an exercise
593 transaction abort!
578 transaction abort!
594 rollback completed
579 rollback completed
595 abort: stream ended unexpectedly (got 0 bytes, expected 4)
580 abort: stream ended unexpectedly (got 0 bytes, expected 4)
596 [255]
581 [255]
@@ -1,210 +1,145
1 This test tries to exercise the ssh functionality with a dummy script
1 This test tries to exercise the ssh functionality with a dummy script
2
2
3 creating 'remote' repo
3 creating 'remote' repo
4
4
5 $ hg init remote
5 $ hg init remote
6 $ cd remote
6 $ cd remote
7 $ hg unbundle "$TESTDIR/bundles/remote.hg"
7 $ hg unbundle "$TESTDIR/bundles/remote.hg"
8 adding changesets
8 adding changesets
9 adding manifests
9 adding manifests
10 adding file changes
10 adding file changes
11 added 9 changesets with 7 changes to 4 files (+1 heads)
11 added 9 changesets with 7 changes to 4 files (+1 heads)
12 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
12 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
13 (run 'hg heads' to see heads, 'hg merge' to merge)
13 (run 'hg heads' to see heads, 'hg merge' to merge)
14 $ hg up tip
14 $ hg up tip
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ cd ..
16 $ cd ..
17
17
18 clone remote via stream
18 clone remote via stream
19
19
20 $ for i in 0 1 2 3 4 5 6 7 8; do
20 $ for i in 0 1 2 3 4 5 6 7 8; do
21 > hg clone --stream -r "$i" ssh://user@dummy/remote test-"$i"
21 > hg clone --stream -r "$i" ssh://user@dummy/remote test-"$i"
22 > if cd test-"$i"; then
22 > if cd test-"$i"; then
23 > hg verify
23 > hg verify -q
24 > cd ..
24 > cd ..
25 > fi
25 > fi
26 > done
26 > done
27 adding changesets
27 adding changesets
28 adding manifests
28 adding manifests
29 adding file changes
29 adding file changes
30 added 1 changesets with 1 changes to 1 files
30 added 1 changesets with 1 changes to 1 files
31 new changesets bfaf4b5cbf01
31 new changesets bfaf4b5cbf01
32 updating to branch default
32 updating to branch default
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 checking changesets
35 checking manifests
36 crosschecking files in changesets and manifests
37 checking files
38 checked 1 changesets with 1 changes to 1 files
39 adding changesets
34 adding changesets
40 adding manifests
35 adding manifests
41 adding file changes
36 adding file changes
42 added 2 changesets with 2 changes to 1 files
37 added 2 changesets with 2 changes to 1 files
43 new changesets bfaf4b5cbf01:21f32785131f
38 new changesets bfaf4b5cbf01:21f32785131f
44 updating to branch default
39 updating to branch default
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 checking changesets
47 checking manifests
48 crosschecking files in changesets and manifests
49 checking files
50 checked 2 changesets with 2 changes to 1 files
51 adding changesets
41 adding changesets
52 adding manifests
42 adding manifests
53 adding file changes
43 adding file changes
54 added 3 changesets with 3 changes to 1 files
44 added 3 changesets with 3 changes to 1 files
55 new changesets bfaf4b5cbf01:4ce51a113780
45 new changesets bfaf4b5cbf01:4ce51a113780
56 updating to branch default
46 updating to branch default
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 checking changesets
59 checking manifests
60 crosschecking files in changesets and manifests
61 checking files
62 checked 3 changesets with 3 changes to 1 files
63 adding changesets
48 adding changesets
64 adding manifests
49 adding manifests
65 adding file changes
50 adding file changes
66 added 4 changesets with 4 changes to 1 files
51 added 4 changesets with 4 changes to 1 files
67 new changesets bfaf4b5cbf01:93ee6ab32777
52 new changesets bfaf4b5cbf01:93ee6ab32777
68 updating to branch default
53 updating to branch default
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 checking changesets
71 checking manifests
72 crosschecking files in changesets and manifests
73 checking files
74 checked 4 changesets with 4 changes to 1 files
75 adding changesets
55 adding changesets
76 adding manifests
56 adding manifests
77 adding file changes
57 adding file changes
78 added 2 changesets with 2 changes to 1 files
58 added 2 changesets with 2 changes to 1 files
79 new changesets bfaf4b5cbf01:c70afb1ee985
59 new changesets bfaf4b5cbf01:c70afb1ee985
80 updating to branch default
60 updating to branch default
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 checking changesets
83 checking manifests
84 crosschecking files in changesets and manifests
85 checking files
86 checked 2 changesets with 2 changes to 1 files
87 adding changesets
62 adding changesets
88 adding manifests
63 adding manifests
89 adding file changes
64 adding file changes
90 added 3 changesets with 3 changes to 1 files
65 added 3 changesets with 3 changes to 1 files
91 new changesets bfaf4b5cbf01:f03ae5a9b979
66 new changesets bfaf4b5cbf01:f03ae5a9b979
92 updating to branch default
67 updating to branch default
93 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 checking changesets
95 checking manifests
96 crosschecking files in changesets and manifests
97 checking files
98 checked 3 changesets with 3 changes to 1 files
99 adding changesets
69 adding changesets
100 adding manifests
70 adding manifests
101 adding file changes
71 adding file changes
102 added 4 changesets with 5 changes to 2 files
72 added 4 changesets with 5 changes to 2 files
103 new changesets bfaf4b5cbf01:095cb14b1b4d
73 new changesets bfaf4b5cbf01:095cb14b1b4d
104 updating to branch default
74 updating to branch default
105 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 checking changesets
107 checking manifests
108 crosschecking files in changesets and manifests
109 checking files
110 checked 4 changesets with 5 changes to 2 files
111 adding changesets
76 adding changesets
112 adding manifests
77 adding manifests
113 adding file changes
78 adding file changes
114 added 5 changesets with 6 changes to 3 files
79 added 5 changesets with 6 changes to 3 files
115 new changesets bfaf4b5cbf01:faa2e4234c7a
80 new changesets bfaf4b5cbf01:faa2e4234c7a
116 updating to branch default
81 updating to branch default
117 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 checking changesets
119 checking manifests
120 crosschecking files in changesets and manifests
121 checking files
122 checked 5 changesets with 6 changes to 3 files
123 adding changesets
83 adding changesets
124 adding manifests
84 adding manifests
125 adding file changes
85 adding file changes
126 added 5 changesets with 5 changes to 2 files
86 added 5 changesets with 5 changes to 2 files
127 new changesets bfaf4b5cbf01:916f1afdef90
87 new changesets bfaf4b5cbf01:916f1afdef90
128 updating to branch default
88 updating to branch default
129 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 checking changesets
131 checking manifests
132 crosschecking files in changesets and manifests
133 checking files
134 checked 5 changesets with 5 changes to 2 files
135 $ cd test-8
90 $ cd test-8
136 $ hg pull ../test-7
91 $ hg pull ../test-7
137 pulling from ../test-7
92 pulling from ../test-7
138 searching for changes
93 searching for changes
139 adding changesets
94 adding changesets
140 adding manifests
95 adding manifests
141 adding file changes
96 adding file changes
142 added 4 changesets with 2 changes to 3 files (+1 heads)
97 added 4 changesets with 2 changes to 3 files (+1 heads)
143 new changesets c70afb1ee985:faa2e4234c7a
98 new changesets c70afb1ee985:faa2e4234c7a
144 (run 'hg heads' to see heads, 'hg merge' to merge)
99 (run 'hg heads' to see heads, 'hg merge' to merge)
145 $ hg verify
100 $ hg verify -q
146 checking changesets
147 checking manifests
148 crosschecking files in changesets and manifests
149 checking files
150 checked 9 changesets with 7 changes to 4 files
151 $ cd ..
101 $ cd ..
152 $ cd test-1
102 $ cd test-1
153 $ hg pull -r 4 ssh://user@dummy/remote
103 $ hg pull -r 4 ssh://user@dummy/remote
154 pulling from ssh://user@dummy/remote
104 pulling from ssh://user@dummy/remote
155 searching for changes
105 searching for changes
156 adding changesets
106 adding changesets
157 adding manifests
107 adding manifests
158 adding file changes
108 adding file changes
159 added 1 changesets with 0 changes to 0 files (+1 heads)
109 added 1 changesets with 0 changes to 0 files (+1 heads)
160 new changesets c70afb1ee985
110 new changesets c70afb1ee985
161 (run 'hg heads' to see heads, 'hg merge' to merge)
111 (run 'hg heads' to see heads, 'hg merge' to merge)
162 $ hg verify
112 $ hg verify -q
163 checking changesets
164 checking manifests
165 crosschecking files in changesets and manifests
166 checking files
167 checked 3 changesets with 2 changes to 1 files
168 $ hg pull ssh://user@dummy/remote
113 $ hg pull ssh://user@dummy/remote
169 pulling from ssh://user@dummy/remote
114 pulling from ssh://user@dummy/remote
170 searching for changes
115 searching for changes
171 adding changesets
116 adding changesets
172 adding manifests
117 adding manifests
173 adding file changes
118 adding file changes
174 added 6 changesets with 5 changes to 4 files
119 added 6 changesets with 5 changes to 4 files
175 new changesets 4ce51a113780:916f1afdef90
120 new changesets 4ce51a113780:916f1afdef90
176 (run 'hg update' to get a working copy)
121 (run 'hg update' to get a working copy)
177 $ cd ..
122 $ cd ..
178 $ cd test-2
123 $ cd test-2
179 $ hg pull -r 5 ssh://user@dummy/remote
124 $ hg pull -r 5 ssh://user@dummy/remote
180 pulling from ssh://user@dummy/remote
125 pulling from ssh://user@dummy/remote
181 searching for changes
126 searching for changes
182 adding changesets
127 adding changesets
183 adding manifests
128 adding manifests
184 adding file changes
129 adding file changes
185 added 2 changesets with 0 changes to 0 files (+1 heads)
130 added 2 changesets with 0 changes to 0 files (+1 heads)
186 new changesets c70afb1ee985:f03ae5a9b979
131 new changesets c70afb1ee985:f03ae5a9b979
187 (run 'hg heads' to see heads, 'hg merge' to merge)
132 (run 'hg heads' to see heads, 'hg merge' to merge)
188 $ hg verify
133 $ hg verify -q
189 checking changesets
190 checking manifests
191 crosschecking files in changesets and manifests
192 checking files
193 checked 5 changesets with 3 changes to 1 files
194 $ hg pull ssh://user@dummy/remote
134 $ hg pull ssh://user@dummy/remote
195 pulling from ssh://user@dummy/remote
135 pulling from ssh://user@dummy/remote
196 searching for changes
136 searching for changes
197 adding changesets
137 adding changesets
198 adding manifests
138 adding manifests
199 adding file changes
139 adding file changes
200 added 4 changesets with 4 changes to 4 files
140 added 4 changesets with 4 changes to 4 files
201 new changesets 93ee6ab32777:916f1afdef90
141 new changesets 93ee6ab32777:916f1afdef90
202 (run 'hg update' to get a working copy)
142 (run 'hg update' to get a working copy)
203 $ hg verify
143 $ hg verify -q
204 checking changesets
205 checking manifests
206 crosschecking files in changesets and manifests
207 checking files
208 checked 9 changesets with 7 changes to 4 files
209
144
210 $ cd ..
145 $ cd ..
@@ -1,714 +1,699
1 This test tries to exercise the ssh functionality with a dummy script
1 This test tries to exercise the ssh functionality with a dummy script
2
2
3 creating 'remote' repo
3 creating 'remote' repo
4
4
5 $ hg init remote
5 $ hg init remote
6 $ cd remote
6 $ cd remote
7 $ echo this > foo
7 $ echo this > foo
8 $ echo this > fooO
8 $ echo this > fooO
9 $ hg ci -A -m "init" foo fooO
9 $ hg ci -A -m "init" foo fooO
10
10
11 insert a closed branch (issue4428)
11 insert a closed branch (issue4428)
12
12
13 $ hg up null
13 $ hg up null
14 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
14 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
15 $ hg branch closed
15 $ hg branch closed
16 marked working directory as branch closed
16 marked working directory as branch closed
17 (branches are permanent and global, did you want a bookmark?)
17 (branches are permanent and global, did you want a bookmark?)
18 $ hg ci -mc0
18 $ hg ci -mc0
19 $ hg ci --close-branch -mc1
19 $ hg ci --close-branch -mc1
20 $ hg up -q default
20 $ hg up -q default
21
21
22 configure for serving
22 configure for serving
23
23
24 $ cat <<EOF > .hg/hgrc
24 $ cat <<EOF > .hg/hgrc
25 > [server]
25 > [server]
26 > uncompressed = True
26 > uncompressed = True
27 >
27 >
28 > [hooks]
28 > [hooks]
29 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
29 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
30 > EOF
30 > EOF
31 $ cd $TESTTMP
31 $ cd $TESTTMP
32
32
33 repo not found error
33 repo not found error
34
34
35 $ hg clone ssh://user@dummy/nonexistent local
35 $ hg clone ssh://user@dummy/nonexistent local
36 remote: abort: repository nonexistent not found
36 remote: abort: repository nonexistent not found
37 abort: no suitable response from remote hg
37 abort: no suitable response from remote hg
38 [255]
38 [255]
39 $ hg clone -q ssh://user@dummy/nonexistent local
39 $ hg clone -q ssh://user@dummy/nonexistent local
40 remote: abort: repository nonexistent not found
40 remote: abort: repository nonexistent not found
41 abort: no suitable response from remote hg
41 abort: no suitable response from remote hg
42 [255]
42 [255]
43
43
44 non-existent absolute path
44 non-existent absolute path
45
45
46 $ hg clone ssh://user@dummy/`pwd`/nonexistent local
46 $ hg clone ssh://user@dummy/`pwd`/nonexistent local
47 remote: abort: repository $TESTTMP/nonexistent not found
47 remote: abort: repository $TESTTMP/nonexistent not found
48 abort: no suitable response from remote hg
48 abort: no suitable response from remote hg
49 [255]
49 [255]
50
50
51 clone remote via stream
51 clone remote via stream
52
52
53 #if no-reposimplestore
53 #if no-reposimplestore
54
54
55 $ hg clone --stream ssh://user@dummy/remote local-stream
55 $ hg clone --stream ssh://user@dummy/remote local-stream
56 streaming all changes
56 streaming all changes
57 8 files to transfer, 827 bytes of data (no-zstd !)
57 8 files to transfer, 827 bytes of data (no-zstd !)
58 transferred 827 bytes in * seconds (*) (glob) (no-zstd !)
58 transferred 827 bytes in * seconds (*) (glob) (no-zstd !)
59 8 files to transfer, 846 bytes of data (zstd !)
59 8 files to transfer, 846 bytes of data (zstd !)
60 transferred * bytes in * seconds (* */sec) (glob) (zstd !)
60 transferred * bytes in * seconds (* */sec) (glob) (zstd !)
61 updating to branch default
61 updating to branch default
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 $ cd local-stream
63 $ cd local-stream
64 $ hg verify
64 $ hg verify -q
65 checking changesets
66 checking manifests
67 crosschecking files in changesets and manifests
68 checking files
69 checked 3 changesets with 2 changes to 2 files
70 $ hg branches
65 $ hg branches
71 default 0:1160648e36ce
66 default 0:1160648e36ce
72 $ cd $TESTTMP
67 $ cd $TESTTMP
73
68
74 clone bookmarks via stream
69 clone bookmarks via stream
75
70
76 $ hg -R local-stream book mybook
71 $ hg -R local-stream book mybook
77 $ hg clone --stream ssh://user@dummy/local-stream stream2
72 $ hg clone --stream ssh://user@dummy/local-stream stream2
78 streaming all changes
73 streaming all changes
79 15 files to transfer, * of data (glob)
74 15 files to transfer, * of data (glob)
80 transferred * in * seconds (*) (glob)
75 transferred * in * seconds (*) (glob)
81 updating to branch default
76 updating to branch default
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 $ cd stream2
78 $ cd stream2
84 $ hg book
79 $ hg book
85 mybook 0:1160648e36ce
80 mybook 0:1160648e36ce
86 $ cd $TESTTMP
81 $ cd $TESTTMP
87 $ rm -rf local-stream stream2
82 $ rm -rf local-stream stream2
88
83
89 #endif
84 #endif
90
85
91 clone remote via pull
86 clone remote via pull
92
87
93 $ hg clone ssh://user@dummy/remote local
88 $ hg clone ssh://user@dummy/remote local
94 requesting all changes
89 requesting all changes
95 adding changesets
90 adding changesets
96 adding manifests
91 adding manifests
97 adding file changes
92 adding file changes
98 added 3 changesets with 2 changes to 2 files
93 added 3 changesets with 2 changes to 2 files
99 new changesets 1160648e36ce:ad076bfb429d
94 new changesets 1160648e36ce:ad076bfb429d
100 updating to branch default
95 updating to branch default
101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
102
97
103 verify
98 verify
104
99
105 $ cd local
100 $ cd local
106 $ hg verify
101 $ hg verify -q
107 checking changesets
108 checking manifests
109 crosschecking files in changesets and manifests
110 checking files
111 checked 3 changesets with 2 changes to 2 files
112 $ cat >> .hg/hgrc <<EOF
102 $ cat >> .hg/hgrc <<EOF
113 > [hooks]
103 > [hooks]
114 > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
104 > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
115 > EOF
105 > EOF
116
106
117 empty default pull
107 empty default pull
118
108
119 $ hg paths
109 $ hg paths
120 default = ssh://user@dummy/remote
110 default = ssh://user@dummy/remote
121 $ hg pull
111 $ hg pull
122 pulling from ssh://user@dummy/remote
112 pulling from ssh://user@dummy/remote
123 searching for changes
113 searching for changes
124 no changes found
114 no changes found
125
115
126 pull from wrong ssh URL
116 pull from wrong ssh URL
127
117
128 $ hg pull ssh://user@dummy/doesnotexist
118 $ hg pull ssh://user@dummy/doesnotexist
129 pulling from ssh://user@dummy/doesnotexist
119 pulling from ssh://user@dummy/doesnotexist
130 remote: abort: repository doesnotexist not found
120 remote: abort: repository doesnotexist not found
131 abort: no suitable response from remote hg
121 abort: no suitable response from remote hg
132 [255]
122 [255]
133
123
134 local change
124 local change
135
125
136 $ echo bleah > foo
126 $ echo bleah > foo
137 $ hg ci -m "add"
127 $ hg ci -m "add"
138
128
139 updating rc
129 updating rc
140
130
141 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
131 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
142
132
143 find outgoing
133 find outgoing
144
134
145 $ hg out ssh://user@dummy/remote
135 $ hg out ssh://user@dummy/remote
146 comparing with ssh://user@dummy/remote
136 comparing with ssh://user@dummy/remote
147 searching for changes
137 searching for changes
148 changeset: 3:a28a9d1a809c
138 changeset: 3:a28a9d1a809c
149 tag: tip
139 tag: tip
150 parent: 0:1160648e36ce
140 parent: 0:1160648e36ce
151 user: test
141 user: test
152 date: Thu Jan 01 00:00:00 1970 +0000
142 date: Thu Jan 01 00:00:00 1970 +0000
153 summary: add
143 summary: add
154
144
155
145
156 find incoming on the remote side
146 find incoming on the remote side
157
147
158 $ hg incoming -R ../remote ssh://user@dummy/local
148 $ hg incoming -R ../remote ssh://user@dummy/local
159 comparing with ssh://user@dummy/local
149 comparing with ssh://user@dummy/local
160 searching for changes
150 searching for changes
161 changeset: 3:a28a9d1a809c
151 changeset: 3:a28a9d1a809c
162 tag: tip
152 tag: tip
163 parent: 0:1160648e36ce
153 parent: 0:1160648e36ce
164 user: test
154 user: test
165 date: Thu Jan 01 00:00:00 1970 +0000
155 date: Thu Jan 01 00:00:00 1970 +0000
166 summary: add
156 summary: add
167
157
168
158
169 find incoming on the remote side (using absolute path)
159 find incoming on the remote side (using absolute path)
170
160
171 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
161 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
172 comparing with ssh://user@dummy/$TESTTMP/local
162 comparing with ssh://user@dummy/$TESTTMP/local
173 searching for changes
163 searching for changes
174 changeset: 3:a28a9d1a809c
164 changeset: 3:a28a9d1a809c
175 tag: tip
165 tag: tip
176 parent: 0:1160648e36ce
166 parent: 0:1160648e36ce
177 user: test
167 user: test
178 date: Thu Jan 01 00:00:00 1970 +0000
168 date: Thu Jan 01 00:00:00 1970 +0000
179 summary: add
169 summary: add
180
170
181
171
182 push
172 push
183
173
184 $ hg push
174 $ hg push
185 pushing to ssh://user@dummy/remote
175 pushing to ssh://user@dummy/remote
186 searching for changes
176 searching for changes
187 remote: adding changesets
177 remote: adding changesets
188 remote: adding manifests
178 remote: adding manifests
189 remote: adding file changes
179 remote: adding file changes
190 remote: added 1 changesets with 1 changes to 1 files
180 remote: added 1 changesets with 1 changes to 1 files
191 $ cd $TESTTMP/remote
181 $ cd $TESTTMP/remote
192
182
193 check remote tip
183 check remote tip
194
184
195 $ hg tip
185 $ hg tip
196 changeset: 3:a28a9d1a809c
186 changeset: 3:a28a9d1a809c
197 tag: tip
187 tag: tip
198 parent: 0:1160648e36ce
188 parent: 0:1160648e36ce
199 user: test
189 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
190 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: add
191 summary: add
202
192
203 $ hg verify
193 $ hg verify -q
204 checking changesets
205 checking manifests
206 crosschecking files in changesets and manifests
207 checking files
208 checked 4 changesets with 3 changes to 2 files
209 $ hg cat -r tip foo
194 $ hg cat -r tip foo
210 bleah
195 bleah
211 $ echo z > z
196 $ echo z > z
212 $ hg ci -A -m z z
197 $ hg ci -A -m z z
213 created new head
198 created new head
214
199
215 test pushkeys and bookmarks
200 test pushkeys and bookmarks
216
201
217 $ cd $TESTTMP/local
202 $ cd $TESTTMP/local
218 $ hg debugpushkey ssh://user@dummy/remote namespaces
203 $ hg debugpushkey ssh://user@dummy/remote namespaces
219 bookmarks
204 bookmarks
220 namespaces
205 namespaces
221 phases
206 phases
222 $ hg book foo -r 0
207 $ hg book foo -r 0
223 $ hg out -B --config paths.default=bogus://invalid --config paths.default:pushurl=`hg paths default`
208 $ hg out -B --config paths.default=bogus://invalid --config paths.default:pushurl=`hg paths default`
224 comparing with ssh://user@dummy/remote
209 comparing with ssh://user@dummy/remote
225 searching for changed bookmarks
210 searching for changed bookmarks
226 foo 1160648e36ce
211 foo 1160648e36ce
227 $ hg push -B foo
212 $ hg push -B foo
228 pushing to ssh://user@dummy/remote
213 pushing to ssh://user@dummy/remote
229 searching for changes
214 searching for changes
230 no changes found
215 no changes found
231 exporting bookmark foo
216 exporting bookmark foo
232 [1]
217 [1]
233 $ hg debugpushkey ssh://user@dummy/remote bookmarks
218 $ hg debugpushkey ssh://user@dummy/remote bookmarks
234 foo 1160648e36cec0054048a7edc4110c6f84fde594
219 foo 1160648e36cec0054048a7edc4110c6f84fde594
235 $ hg book -f foo
220 $ hg book -f foo
236 $ hg push --traceback
221 $ hg push --traceback
237 pushing to ssh://user@dummy/remote
222 pushing to ssh://user@dummy/remote
238 searching for changes
223 searching for changes
239 no changes found
224 no changes found
240 updating bookmark foo
225 updating bookmark foo
241 [1]
226 [1]
242 $ hg book -d foo
227 $ hg book -d foo
243 $ hg in -B
228 $ hg in -B
244 comparing with ssh://user@dummy/remote
229 comparing with ssh://user@dummy/remote
245 searching for changed bookmarks
230 searching for changed bookmarks
246 foo a28a9d1a809c
231 foo a28a9d1a809c
247 $ hg book -f -r 0 foo
232 $ hg book -f -r 0 foo
248 $ hg pull -B foo
233 $ hg pull -B foo
249 pulling from ssh://user@dummy/remote
234 pulling from ssh://user@dummy/remote
250 no changes found
235 no changes found
251 updating bookmark foo
236 updating bookmark foo
252 $ hg book -d foo
237 $ hg book -d foo
253 $ hg push -B foo
238 $ hg push -B foo
254 pushing to ssh://user@dummy/remote
239 pushing to ssh://user@dummy/remote
255 searching for changes
240 searching for changes
256 no changes found
241 no changes found
257 deleting remote bookmark foo
242 deleting remote bookmark foo
258 [1]
243 [1]
259
244
260 a bad, evil hook that prints to stdout
245 a bad, evil hook that prints to stdout
261
246
262 $ cat <<EOF > $TESTTMP/badhook
247 $ cat <<EOF > $TESTTMP/badhook
263 > import sys
248 > import sys
264 > sys.stdout.write("KABOOM\n")
249 > sys.stdout.write("KABOOM\n")
265 > sys.stdout.flush()
250 > sys.stdout.flush()
266 > EOF
251 > EOF
267
252
268 $ cat <<EOF > $TESTTMP/badpyhook.py
253 $ cat <<EOF > $TESTTMP/badpyhook.py
269 > import sys
254 > import sys
270 > def hook(ui, repo, hooktype, **kwargs):
255 > def hook(ui, repo, hooktype, **kwargs):
271 > sys.stdout.write("KABOOM IN PROCESS\n")
256 > sys.stdout.write("KABOOM IN PROCESS\n")
272 > sys.stdout.flush()
257 > sys.stdout.flush()
273 > EOF
258 > EOF
274
259
275 $ cat <<EOF >> ../remote/.hg/hgrc
260 $ cat <<EOF >> ../remote/.hg/hgrc
276 > [hooks]
261 > [hooks]
277 > changegroup.stdout = "$PYTHON" $TESTTMP/badhook
262 > changegroup.stdout = "$PYTHON" $TESTTMP/badhook
278 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook
263 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook
279 > EOF
264 > EOF
280 $ echo r > r
265 $ echo r > r
281 $ hg ci -A -m z r
266 $ hg ci -A -m z r
282
267
283 push should succeed even though it has an unexpected response
268 push should succeed even though it has an unexpected response
284
269
285 $ hg push
270 $ hg push
286 pushing to ssh://user@dummy/remote
271 pushing to ssh://user@dummy/remote
287 searching for changes
272 searching for changes
288 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
273 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
289 remote: adding changesets
274 remote: adding changesets
290 remote: adding manifests
275 remote: adding manifests
291 remote: adding file changes
276 remote: adding file changes
292 remote: added 1 changesets with 1 changes to 1 files (py3 !)
277 remote: added 1 changesets with 1 changes to 1 files (py3 !)
293 remote: KABOOM
278 remote: KABOOM
294 remote: KABOOM IN PROCESS
279 remote: KABOOM IN PROCESS
295 $ hg -R ../remote heads
280 $ hg -R ../remote heads
296 changeset: 5:1383141674ec
281 changeset: 5:1383141674ec
297 tag: tip
282 tag: tip
298 parent: 3:a28a9d1a809c
283 parent: 3:a28a9d1a809c
299 user: test
284 user: test
300 date: Thu Jan 01 00:00:00 1970 +0000
285 date: Thu Jan 01 00:00:00 1970 +0000
301 summary: z
286 summary: z
302
287
303 changeset: 4:6c0482d977a3
288 changeset: 4:6c0482d977a3
304 parent: 0:1160648e36ce
289 parent: 0:1160648e36ce
305 user: test
290 user: test
306 date: Thu Jan 01 00:00:00 1970 +0000
291 date: Thu Jan 01 00:00:00 1970 +0000
307 summary: z
292 summary: z
308
293
309
294
310 #if chg
295 #if chg
311
296
312 try again with remote chg, which should succeed as well
297 try again with remote chg, which should succeed as well
313
298
314 $ hg rollback -R ../remote
299 $ hg rollback -R ../remote
315 repository tip rolled back to revision 4 (undo serve)
300 repository tip rolled back to revision 4 (undo serve)
316
301
317 $ hg push --config ui.remotecmd=chg
302 $ hg push --config ui.remotecmd=chg
318 pushing to ssh://user@dummy/remote
303 pushing to ssh://user@dummy/remote
319 searching for changes
304 searching for changes
320 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
305 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
321 remote: adding changesets
306 remote: adding changesets
322 remote: adding manifests
307 remote: adding manifests
323 remote: adding file changes
308 remote: adding file changes
324 remote: added 1 changesets with 1 changes to 1 files (py3 !)
309 remote: added 1 changesets with 1 changes to 1 files (py3 !)
325 remote: KABOOM
310 remote: KABOOM
326 remote: KABOOM IN PROCESS
311 remote: KABOOM IN PROCESS
327
312
328 #endif
313 #endif
329
314
330 clone bookmarks
315 clone bookmarks
331
316
332 $ hg -R ../remote bookmark test
317 $ hg -R ../remote bookmark test
333 $ hg -R ../remote bookmarks
318 $ hg -R ../remote bookmarks
334 * test 4:6c0482d977a3
319 * test 4:6c0482d977a3
335 $ hg clone ssh://user@dummy/remote local-bookmarks
320 $ hg clone ssh://user@dummy/remote local-bookmarks
336 requesting all changes
321 requesting all changes
337 adding changesets
322 adding changesets
338 adding manifests
323 adding manifests
339 adding file changes
324 adding file changes
340 added 6 changesets with 5 changes to 4 files (+1 heads)
325 added 6 changesets with 5 changes to 4 files (+1 heads)
341 new changesets 1160648e36ce:1383141674ec
326 new changesets 1160648e36ce:1383141674ec
342 updating to branch default
327 updating to branch default
343 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
328 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
344 $ hg -R local-bookmarks bookmarks
329 $ hg -R local-bookmarks bookmarks
345 test 4:6c0482d977a3
330 test 4:6c0482d977a3
346
331
347 passwords in ssh urls are not supported
332 passwords in ssh urls are not supported
348 (we use a glob here because different Python versions give different
333 (we use a glob here because different Python versions give different
349 results here)
334 results here)
350
335
351 $ hg push ssh://user:erroneouspwd@dummy/remote
336 $ hg push ssh://user:erroneouspwd@dummy/remote
352 pushing to ssh://user:*@dummy/remote (glob)
337 pushing to ssh://user:*@dummy/remote (glob)
353 abort: password in URL not supported
338 abort: password in URL not supported
354 [255]
339 [255]
355
340
356 $ cd $TESTTMP
341 $ cd $TESTTMP
357
342
358 hide outer repo
343 hide outer repo
359 $ hg init
344 $ hg init
360
345
361 Test remote paths with spaces (issue2983):
346 Test remote paths with spaces (issue2983):
362
347
363 $ hg init "ssh://user@dummy/a repo"
348 $ hg init "ssh://user@dummy/a repo"
364 $ touch "$TESTTMP/a repo/test"
349 $ touch "$TESTTMP/a repo/test"
365 $ hg -R 'a repo' commit -A -m "test"
350 $ hg -R 'a repo' commit -A -m "test"
366 adding test
351 adding test
367 $ hg -R 'a repo' tag tag
352 $ hg -R 'a repo' tag tag
368 $ hg id "ssh://user@dummy/a repo"
353 $ hg id "ssh://user@dummy/a repo"
369 73649e48688a
354 73649e48688a
370
355
371 $ hg id "ssh://user@dummy/a repo#noNoNO"
356 $ hg id "ssh://user@dummy/a repo#noNoNO"
372 abort: unknown revision 'noNoNO'
357 abort: unknown revision 'noNoNO'
373 [255]
358 [255]
374
359
375 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
360 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
376
361
377 $ hg clone "ssh://user@dummy/a repo"
362 $ hg clone "ssh://user@dummy/a repo"
378 destination directory: a repo
363 destination directory: a repo
379 abort: destination 'a repo' is not empty
364 abort: destination 'a repo' is not empty
380 [10]
365 [10]
381
366
382 #if no-rhg
367 #if no-rhg
383 Make sure hg is really paranoid in serve --stdio mode. It used to be
368 Make sure hg is really paranoid in serve --stdio mode. It used to be
384 possible to get a debugger REPL by specifying a repo named --debugger.
369 possible to get a debugger REPL by specifying a repo named --debugger.
385 $ hg -R --debugger serve --stdio
370 $ hg -R --debugger serve --stdio
386 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio']
371 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio']
387 [255]
372 [255]
388 $ hg -R --config=ui.debugger=yes serve --stdio
373 $ hg -R --config=ui.debugger=yes serve --stdio
389 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio']
374 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio']
390 [255]
375 [255]
391 Abbreviations of 'serve' also don't work, to avoid shenanigans.
376 Abbreviations of 'serve' also don't work, to avoid shenanigans.
392 $ hg -R narf serv --stdio
377 $ hg -R narf serv --stdio
393 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
378 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
394 [255]
379 [255]
395 #else
380 #else
396 rhg aborts early on -R without a repository at that path
381 rhg aborts early on -R without a repository at that path
397 $ hg -R --debugger serve --stdio
382 $ hg -R --debugger serve --stdio
398 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio'] (missing-correct-output !)
383 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio'] (missing-correct-output !)
399 abort: repository --debugger not found (known-bad-output !)
384 abort: repository --debugger not found (known-bad-output !)
400 [255]
385 [255]
401 $ hg -R --config=ui.debugger=yes serve --stdio
386 $ hg -R --config=ui.debugger=yes serve --stdio
402 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio'] (missing-correct-output !)
387 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio'] (missing-correct-output !)
403 abort: repository --config=ui.debugger=yes not found (known-bad-output !)
388 abort: repository --config=ui.debugger=yes not found (known-bad-output !)
404 [255]
389 [255]
405 $ hg -R narf serv --stdio
390 $ hg -R narf serv --stdio
406 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio'] (missing-correct-output !)
391 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio'] (missing-correct-output !)
407 abort: repository narf not found (known-bad-output !)
392 abort: repository narf not found (known-bad-output !)
408 [255]
393 [255]
409 If the repo does exist, rhg finds an unsupported command and falls back to Python
394 If the repo does exist, rhg finds an unsupported command and falls back to Python
410 which still does the right thing
395 which still does the right thing
411 $ hg init narf
396 $ hg init narf
412 $ hg -R narf serv --stdio
397 $ hg -R narf serv --stdio
413 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
398 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
414 [255]
399 [255]
415 #endif
400 #endif
416
401
417 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
402 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
418 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
403 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
419 parameters:
404 parameters:
420
405
421 $ cat > ssh.sh << EOF
406 $ cat > ssh.sh << EOF
422 > userhost="\$1"
407 > userhost="\$1"
423 > SSH_ORIGINAL_COMMAND="\$2"
408 > SSH_ORIGINAL_COMMAND="\$2"
424 > export SSH_ORIGINAL_COMMAND
409 > export SSH_ORIGINAL_COMMAND
425 > PYTHONPATH="$PYTHONPATH"
410 > PYTHONPATH="$PYTHONPATH"
426 > export PYTHONPATH
411 > export PYTHONPATH
427 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
412 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
428 > EOF
413 > EOF
429
414
430 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
415 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
431 73649e48688a
416 73649e48688a
432
417
433 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
418 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
434 remote: Illegal repository "$TESTTMP/a'repo"
419 remote: Illegal repository "$TESTTMP/a'repo"
435 abort: no suitable response from remote hg
420 abort: no suitable response from remote hg
436 [255]
421 [255]
437
422
438 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
423 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
439 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
424 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
440 abort: no suitable response from remote hg
425 abort: no suitable response from remote hg
441 [255]
426 [255]
442
427
443 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
428 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
444 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
429 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
445 [255]
430 [255]
446
431
447 Test hg-ssh in read-only mode:
432 Test hg-ssh in read-only mode:
448
433
449 $ cat > ssh.sh << EOF
434 $ cat > ssh.sh << EOF
450 > userhost="\$1"
435 > userhost="\$1"
451 > SSH_ORIGINAL_COMMAND="\$2"
436 > SSH_ORIGINAL_COMMAND="\$2"
452 > export SSH_ORIGINAL_COMMAND
437 > export SSH_ORIGINAL_COMMAND
453 > PYTHONPATH="$PYTHONPATH"
438 > PYTHONPATH="$PYTHONPATH"
454 > export PYTHONPATH
439 > export PYTHONPATH
455 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
440 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
456 > EOF
441 > EOF
457
442
458 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
443 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
459 requesting all changes
444 requesting all changes
460 adding changesets
445 adding changesets
461 adding manifests
446 adding manifests
462 adding file changes
447 adding file changes
463 added 6 changesets with 5 changes to 4 files (+1 heads)
448 added 6 changesets with 5 changes to 4 files (+1 heads)
464 new changesets 1160648e36ce:1383141674ec
449 new changesets 1160648e36ce:1383141674ec
465 updating to branch default
450 updating to branch default
466 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
451 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
467
452
468 $ cd read-only-local
453 $ cd read-only-local
469 $ echo "baz" > bar
454 $ echo "baz" > bar
470 $ hg ci -A -m "unpushable commit" bar
455 $ hg ci -A -m "unpushable commit" bar
471 $ hg push --ssh "sh ../ssh.sh"
456 $ hg push --ssh "sh ../ssh.sh"
472 pushing to ssh://user@dummy/*/remote (glob)
457 pushing to ssh://user@dummy/*/remote (glob)
473 searching for changes
458 searching for changes
474 remote: Permission denied
459 remote: Permission denied
475 remote: pretxnopen.hg-ssh hook failed
460 remote: pretxnopen.hg-ssh hook failed
476 abort: push failed on remote
461 abort: push failed on remote
477 [100]
462 [100]
478
463
479 $ cd $TESTTMP
464 $ cd $TESTTMP
480
465
481 stderr from remote commands should be printed before stdout from local code (issue4336)
466 stderr from remote commands should be printed before stdout from local code (issue4336)
482
467
483 $ hg clone remote stderr-ordering
468 $ hg clone remote stderr-ordering
484 updating to branch default
469 updating to branch default
485 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
470 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 $ cd stderr-ordering
471 $ cd stderr-ordering
487 $ cat >> localwrite.py << EOF
472 $ cat >> localwrite.py << EOF
488 > from mercurial import exchange, extensions
473 > from mercurial import exchange, extensions
489 >
474 >
490 > def wrappedpush(orig, repo, *args, **kwargs):
475 > def wrappedpush(orig, repo, *args, **kwargs):
491 > res = orig(repo, *args, **kwargs)
476 > res = orig(repo, *args, **kwargs)
492 > repo.ui.write(b'local stdout\n')
477 > repo.ui.write(b'local stdout\n')
493 > repo.ui.flush()
478 > repo.ui.flush()
494 > return res
479 > return res
495 >
480 >
496 > def extsetup(ui):
481 > def extsetup(ui):
497 > extensions.wrapfunction(exchange, b'push', wrappedpush)
482 > extensions.wrapfunction(exchange, b'push', wrappedpush)
498 > EOF
483 > EOF
499
484
500 $ cat >> .hg/hgrc << EOF
485 $ cat >> .hg/hgrc << EOF
501 > [paths]
486 > [paths]
502 > default-push = ssh://user@dummy/remote
487 > default-push = ssh://user@dummy/remote
503 > [extensions]
488 > [extensions]
504 > localwrite = localwrite.py
489 > localwrite = localwrite.py
505 > EOF
490 > EOF
506
491
507 $ echo localwrite > foo
492 $ echo localwrite > foo
508 $ hg commit -m 'testing localwrite'
493 $ hg commit -m 'testing localwrite'
509 $ hg push
494 $ hg push
510 pushing to ssh://user@dummy/remote
495 pushing to ssh://user@dummy/remote
511 searching for changes
496 searching for changes
512 remote: adding changesets
497 remote: adding changesets
513 remote: adding manifests
498 remote: adding manifests
514 remote: adding file changes
499 remote: adding file changes
515 remote: added 1 changesets with 1 changes to 1 files (py3 !)
500 remote: added 1 changesets with 1 changes to 1 files (py3 !)
516 remote: KABOOM
501 remote: KABOOM
517 remote: KABOOM IN PROCESS
502 remote: KABOOM IN PROCESS
518 local stdout
503 local stdout
519
504
520 debug output
505 debug output
521
506
522 $ hg pull --debug ssh://user@dummy/remote --config devel.debug.peer-request=yes
507 $ hg pull --debug ssh://user@dummy/remote --config devel.debug.peer-request=yes
523 pulling from ssh://user@dummy/remote
508 pulling from ssh://user@dummy/remote
524 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
509 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
525 devel-peer-request: hello+between
510 devel-peer-request: hello+between
526 devel-peer-request: pairs: 81 bytes
511 devel-peer-request: pairs: 81 bytes
527 sending hello command
512 sending hello command
528 sending between command
513 sending between command
529 remote: \d+ (re)
514 remote: \d+ (re)
530 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
515 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
531 remote: 1
516 remote: 1
532 devel-peer-request: protocaps
517 devel-peer-request: protocaps
533 devel-peer-request: caps: * bytes (glob)
518 devel-peer-request: caps: * bytes (glob)
534 sending protocaps command
519 sending protocaps command
535 query 1; heads
520 query 1; heads
536 devel-peer-request: batched-content
521 devel-peer-request: batched-content
537 devel-peer-request: - heads (0 arguments)
522 devel-peer-request: - heads (0 arguments)
538 devel-peer-request: - known (1 arguments)
523 devel-peer-request: - known (1 arguments)
539 devel-peer-request: batch
524 devel-peer-request: batch
540 devel-peer-request: cmds: 141 bytes
525 devel-peer-request: cmds: 141 bytes
541 sending batch command
526 sending batch command
542 searching for changes
527 searching for changes
543 all remote heads known locally
528 all remote heads known locally
544 no changes found
529 no changes found
545 devel-peer-request: getbundle
530 devel-peer-request: getbundle
546 devel-peer-request: bookmarks: 1 bytes
531 devel-peer-request: bookmarks: 1 bytes
547 devel-peer-request: bundlecaps: 270 bytes
532 devel-peer-request: bundlecaps: 270 bytes
548 devel-peer-request: cg: 1 bytes
533 devel-peer-request: cg: 1 bytes
549 devel-peer-request: common: 122 bytes
534 devel-peer-request: common: 122 bytes
550 devel-peer-request: heads: 122 bytes
535 devel-peer-request: heads: 122 bytes
551 devel-peer-request: listkeys: 9 bytes
536 devel-peer-request: listkeys: 9 bytes
552 devel-peer-request: phases: 1 bytes
537 devel-peer-request: phases: 1 bytes
553 sending getbundle command
538 sending getbundle command
554 bundle2-input-bundle: with-transaction
539 bundle2-input-bundle: with-transaction
555 bundle2-input-part: "bookmarks" supported
540 bundle2-input-part: "bookmarks" supported
556 bundle2-input-part: total payload size 26
541 bundle2-input-part: total payload size 26
557 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
542 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
558 bundle2-input-part: total payload size 45
543 bundle2-input-part: total payload size 45
559 bundle2-input-part: "phase-heads" supported
544 bundle2-input-part: "phase-heads" supported
560 bundle2-input-part: total payload size 72
545 bundle2-input-part: total payload size 72
561 bundle2-input-bundle: 3 parts total
546 bundle2-input-bundle: 3 parts total
562 checking for updated bookmarks
547 checking for updated bookmarks
563
548
564 $ cd $TESTTMP
549 $ cd $TESTTMP
565
550
566 $ cat dummylog
551 $ cat dummylog
567 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
552 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
568 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
553 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
569 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
554 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
570 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
555 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
571 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
556 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
572 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
557 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
573 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
558 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
574 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
559 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
575 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
560 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
576 Got arguments 1:user@dummy 2:hg -R local serve --stdio
561 Got arguments 1:user@dummy 2:hg -R local serve --stdio
577 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
562 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
578 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
563 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
579 changegroup-in-remote hook: HG_BUNDLE2=1
564 changegroup-in-remote hook: HG_BUNDLE2=1
580 HG_HOOKNAME=changegroup
565 HG_HOOKNAME=changegroup
581 HG_HOOKTYPE=changegroup
566 HG_HOOKTYPE=changegroup
582 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
567 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
583 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
568 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
584 HG_SOURCE=serve
569 HG_SOURCE=serve
585 HG_TXNID=TXN:$ID$
570 HG_TXNID=TXN:$ID$
586 HG_TXNNAME=serve
571 HG_TXNNAME=serve
587 HG_URL=remote:ssh:$LOCALIP
572 HG_URL=remote:ssh:$LOCALIP
588
573
589 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
574 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
590 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
575 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
591 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
576 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
592 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
577 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
593 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
578 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
594 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
579 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
595 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
580 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
596 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
581 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
597 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
582 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
598 changegroup-in-remote hook: HG_BUNDLE2=1
583 changegroup-in-remote hook: HG_BUNDLE2=1
599 HG_HOOKNAME=changegroup
584 HG_HOOKNAME=changegroup
600 HG_HOOKTYPE=changegroup
585 HG_HOOKTYPE=changegroup
601 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
586 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
602 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
587 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
603 HG_SOURCE=serve
588 HG_SOURCE=serve
604 HG_TXNID=TXN:$ID$
589 HG_TXNID=TXN:$ID$
605 HG_TXNNAME=serve
590 HG_TXNNAME=serve
606 HG_URL=remote:ssh:$LOCALIP
591 HG_URL=remote:ssh:$LOCALIP
607
592
608 Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
593 Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
609 changegroup-in-remote hook: HG_BUNDLE2=1 (chg !)
594 changegroup-in-remote hook: HG_BUNDLE2=1 (chg !)
610 HG_HOOKNAME=changegroup (chg !)
595 HG_HOOKNAME=changegroup (chg !)
611 HG_HOOKTYPE=changegroup (chg !)
596 HG_HOOKTYPE=changegroup (chg !)
612 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
597 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
613 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
598 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
614 HG_SOURCE=serve (chg !)
599 HG_SOURCE=serve (chg !)
615 HG_TXNID=TXN:$ID$ (chg !)
600 HG_TXNID=TXN:$ID$ (chg !)
616 HG_TXNNAME=serve (chg !)
601 HG_TXNNAME=serve (chg !)
617 HG_URL=remote:ssh:$LOCALIP (chg !)
602 HG_URL=remote:ssh:$LOCALIP (chg !)
618 (chg !)
603 (chg !)
619 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
604 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
620 Got arguments 1:user@dummy 2:hg init 'a repo'
605 Got arguments 1:user@dummy 2:hg init 'a repo'
621 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
606 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
622 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
607 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
623 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
608 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
624 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
609 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
625 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
610 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
626 changegroup-in-remote hook: HG_BUNDLE2=1
611 changegroup-in-remote hook: HG_BUNDLE2=1
627 HG_HOOKNAME=changegroup
612 HG_HOOKNAME=changegroup
628 HG_HOOKTYPE=changegroup
613 HG_HOOKTYPE=changegroup
629 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
614 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
630 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
615 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
631 HG_SOURCE=serve
616 HG_SOURCE=serve
632 HG_TXNID=TXN:$ID$
617 HG_TXNID=TXN:$ID$
633 HG_TXNNAME=serve
618 HG_TXNNAME=serve
634 HG_URL=remote:ssh:$LOCALIP
619 HG_URL=remote:ssh:$LOCALIP
635
620
636 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
621 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
637
622
638
623
639 remote hook failure is attributed to remote
624 remote hook failure is attributed to remote
640
625
641 $ cat > $TESTTMP/failhook << EOF
626 $ cat > $TESTTMP/failhook << EOF
642 > def hook(ui, repo, **kwargs):
627 > def hook(ui, repo, **kwargs):
643 > ui.write(b'hook failure!\n')
628 > ui.write(b'hook failure!\n')
644 > ui.flush()
629 > ui.flush()
645 > return 1
630 > return 1
646 > EOF
631 > EOF
647
632
648 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
633 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
649
634
650 $ hg -q clone ssh://user@dummy/remote hookout
635 $ hg -q clone ssh://user@dummy/remote hookout
651 $ cd hookout
636 $ cd hookout
652 $ touch hookfailure
637 $ touch hookfailure
653 $ hg -q commit -A -m 'remote hook failure'
638 $ hg -q commit -A -m 'remote hook failure'
654 $ hg push
639 $ hg push
655 pushing to ssh://user@dummy/remote
640 pushing to ssh://user@dummy/remote
656 searching for changes
641 searching for changes
657 remote: adding changesets
642 remote: adding changesets
658 remote: adding manifests
643 remote: adding manifests
659 remote: adding file changes
644 remote: adding file changes
660 remote: hook failure!
645 remote: hook failure!
661 remote: transaction abort!
646 remote: transaction abort!
662 remote: rollback completed
647 remote: rollback completed
663 remote: pretxnchangegroup.fail hook failed
648 remote: pretxnchangegroup.fail hook failed
664 abort: push failed on remote
649 abort: push failed on remote
665 [100]
650 [100]
666
651
667 abort during pull is properly reported as such
652 abort during pull is properly reported as such
668
653
669 $ echo morefoo >> ../remote/foo
654 $ echo morefoo >> ../remote/foo
670 $ hg -R ../remote commit --message "more foo to be pulled"
655 $ hg -R ../remote commit --message "more foo to be pulled"
671 $ cat >> ../remote/.hg/hgrc << EOF
656 $ cat >> ../remote/.hg/hgrc << EOF
672 > [extensions]
657 > [extensions]
673 > crash = ${TESTDIR}/crashgetbundler.py
658 > crash = ${TESTDIR}/crashgetbundler.py
674 > EOF
659 > EOF
675 $ hg pull
660 $ hg pull
676 pulling from ssh://user@dummy/remote
661 pulling from ssh://user@dummy/remote
677 searching for changes
662 searching for changes
678 remote: abort: this is an exercise
663 remote: abort: this is an exercise
679 abort: pull failed on remote
664 abort: pull failed on remote
680 [100]
665 [100]
681
666
682 abort with no error hint when there is a ssh problem when pulling
667 abort with no error hint when there is a ssh problem when pulling
683
668
684 $ hg pull ssh://brokenrepository
669 $ hg pull ssh://brokenrepository
685 pulling from ssh://brokenrepository/
670 pulling from ssh://brokenrepository/
686 abort: no suitable response from remote hg
671 abort: no suitable response from remote hg
687 [255]
672 [255]
688
673
689 abort with configured error hint when there is a ssh problem when pulling
674 abort with configured error hint when there is a ssh problem when pulling
690
675
691 $ hg pull ssh://brokenrepository \
676 $ hg pull ssh://brokenrepository \
692 > --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html"
677 > --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html"
693 pulling from ssh://brokenrepository/
678 pulling from ssh://brokenrepository/
694 abort: no suitable response from remote hg
679 abort: no suitable response from remote hg
695 (Please see http://company/internalwiki/ssh.html)
680 (Please see http://company/internalwiki/ssh.html)
696 [255]
681 [255]
697
682
698 test that custom environment is passed down to ssh executable
683 test that custom environment is passed down to ssh executable
699 $ cat >>dumpenv <<EOF
684 $ cat >>dumpenv <<EOF
700 > #! /bin/sh
685 > #! /bin/sh
701 > echo \$VAR >&2
686 > echo \$VAR >&2
702 > EOF
687 > EOF
703 $ chmod +x dumpenv
688 $ chmod +x dumpenv
704 $ hg pull ssh://something --config ui.ssh="sh dumpenv"
689 $ hg pull ssh://something --config ui.ssh="sh dumpenv"
705 pulling from ssh://something/
690 pulling from ssh://something/
706 remote:
691 remote:
707 abort: no suitable response from remote hg
692 abort: no suitable response from remote hg
708 [255]
693 [255]
709 $ hg pull ssh://something --config ui.ssh="sh dumpenv" --config sshenv.VAR=17
694 $ hg pull ssh://something --config ui.ssh="sh dumpenv" --config sshenv.VAR=17
710 pulling from ssh://something/
695 pulling from ssh://something/
711 remote: 17
696 remote: 17
712 abort: no suitable response from remote hg
697 abort: no suitable response from remote hg
713 [255]
698 [255]
714
699
@@ -1,299 +1,283
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ hg clone http://localhost:$HGPORT/ copy
3 $ hg clone http://localhost:$HGPORT/ copy
4 abort: * (glob)
4 abort: * (glob)
5 [100]
5 [100]
6 $ test -d copy
6 $ test -d copy
7 [1]
7 [1]
8
8
9 This server doesn't do range requests so it's basically only good for
9 This server doesn't do range requests so it's basically only good for
10 one pull
10 one pull
11
11
12 $ "$PYTHON" "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid \
12 $ "$PYTHON" "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid \
13 > --logfile server.log
13 > --logfile server.log
14 $ cat dumb.pid >> $DAEMON_PIDS
14 $ cat dumb.pid >> $DAEMON_PIDS
15 $ hg init remote
15 $ hg init remote
16 $ cd remote
16 $ cd remote
17 $ echo foo > bar
17 $ echo foo > bar
18 $ echo c2 > '.dotfile with spaces'
18 $ echo c2 > '.dotfile with spaces'
19 $ hg add
19 $ hg add
20 adding .dotfile with spaces
20 adding .dotfile with spaces
21 adding bar
21 adding bar
22 $ hg commit -m"test"
22 $ hg commit -m"test"
23 $ hg tip
23 $ hg tip
24 changeset: 0:02770d679fb8
24 changeset: 0:02770d679fb8
25 tag: tip
25 tag: tip
26 user: test
26 user: test
27 date: Thu Jan 01 00:00:00 1970 +0000
27 date: Thu Jan 01 00:00:00 1970 +0000
28 summary: test
28 summary: test
29
29
30 $ cd ..
30 $ cd ..
31 $ hg clone static-http://localhost:$HGPORT/remote local
31 $ hg clone static-http://localhost:$HGPORT/remote local
32 requesting all changes
32 requesting all changes
33 adding changesets
33 adding changesets
34 adding manifests
34 adding manifests
35 adding file changes
35 adding file changes
36 added 1 changesets with 2 changes to 2 files
36 added 1 changesets with 2 changes to 2 files
37 new changesets 02770d679fb8
37 new changesets 02770d679fb8
38 updating to branch default
38 updating to branch default
39 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 $ cd local
40 $ cd local
41 $ hg verify
41 $ hg verify -q
42 checking changesets
43 checking manifests
44 crosschecking files in changesets and manifests
45 checking files
46 checked 1 changesets with 2 changes to 2 files
47 $ cat bar
42 $ cat bar
48 foo
43 foo
49 $ cd ../remote
44 $ cd ../remote
50 $ echo baz > quux
45 $ echo baz > quux
51 $ hg commit -A -mtest2
46 $ hg commit -A -mtest2
52 adding quux
47 adding quux
53
48
54 check for HTTP opener failures when cachefile does not exist
49 check for HTTP opener failures when cachefile does not exist
55
50
56 $ rm .hg/cache/*
51 $ rm .hg/cache/*
57 $ cd ../local
52 $ cd ../local
58 $ cat >> .hg/hgrc <<EOF
53 $ cat >> .hg/hgrc <<EOF
59 > [hooks]
54 > [hooks]
60 > changegroup = sh -c "printenv.py --line changegroup"
55 > changegroup = sh -c "printenv.py --line changegroup"
61 > EOF
56 > EOF
62 $ hg pull
57 $ hg pull
63 pulling from static-http://localhost:$HGPORT/remote
58 pulling from static-http://localhost:$HGPORT/remote
64 searching for changes
59 searching for changes
65 adding changesets
60 adding changesets
66 adding manifests
61 adding manifests
67 adding file changes
62 adding file changes
68 added 1 changesets with 1 changes to 1 files
63 added 1 changesets with 1 changes to 1 files
69 new changesets 4ac2e3648604
64 new changesets 4ac2e3648604
70 changegroup hook: HG_HOOKNAME=changegroup
65 changegroup hook: HG_HOOKNAME=changegroup
71 HG_HOOKTYPE=changegroup
66 HG_HOOKTYPE=changegroup
72 HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432
67 HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432
73 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
68 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
74 HG_SOURCE=pull
69 HG_SOURCE=pull
75 HG_TXNID=TXN:$ID$
70 HG_TXNID=TXN:$ID$
76 HG_TXNNAME=pull
71 HG_TXNNAME=pull
77 http://localhost:$HGPORT/remote
72 http://localhost:$HGPORT/remote
78 HG_URL=http://localhost:$HGPORT/remote
73 HG_URL=http://localhost:$HGPORT/remote
79
74
80 (run 'hg update' to get a working copy)
75 (run 'hg update' to get a working copy)
81
76
82 trying to push
77 trying to push
83
78
84 $ hg update
79 $ hg update
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 $ echo more foo >> bar
81 $ echo more foo >> bar
87 $ hg commit -m"test"
82 $ hg commit -m"test"
88 $ hg push
83 $ hg push
89 pushing to static-http://localhost:$HGPORT/remote
84 pushing to static-http://localhost:$HGPORT/remote
90 abort: destination does not support push
85 abort: destination does not support push
91 [255]
86 [255]
92
87
93 trying clone -r
88 trying clone -r
94
89
95 $ cd ..
90 $ cd ..
96 $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0
91 $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0
97 abort: unknown revision 'doesnotexist'
92 abort: unknown revision 'doesnotexist'
98 [10]
93 [10]
99 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
94 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
100 adding changesets
95 adding changesets
101 adding manifests
96 adding manifests
102 adding file changes
97 adding file changes
103 added 1 changesets with 2 changes to 2 files
98 added 1 changesets with 2 changes to 2 files
104 new changesets 02770d679fb8
99 new changesets 02770d679fb8
105 updating to branch default
100 updating to branch default
106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
107
102
108 test with "/" URI (issue747) and subrepo
103 test with "/" URI (issue747) and subrepo
109
104
110 $ hg init
105 $ hg init
111 $ hg init sub
106 $ hg init sub
112 $ touch sub/test
107 $ touch sub/test
113 $ hg -R sub commit -A -m "test"
108 $ hg -R sub commit -A -m "test"
114 adding test
109 adding test
115 $ hg -R sub tag not-empty
110 $ hg -R sub tag not-empty
116 $ echo sub=sub > .hgsub
111 $ echo sub=sub > .hgsub
117 $ echo a > a
112 $ echo a > a
118 $ hg add a .hgsub
113 $ hg add a .hgsub
119 $ hg -q ci -ma
114 $ hg -q ci -ma
120 $ hg clone static-http://localhost:$HGPORT/ local2
115 $ hg clone static-http://localhost:$HGPORT/ local2
121 requesting all changes
116 requesting all changes
122 adding changesets
117 adding changesets
123 adding manifests
118 adding manifests
124 adding file changes
119 adding file changes
125 added 1 changesets with 3 changes to 3 files
120 added 1 changesets with 3 changes to 3 files
126 new changesets a9ebfbe8e587
121 new changesets a9ebfbe8e587
127 updating to branch default
122 updating to branch default
128 cloning subrepo sub from static-http://localhost:$HGPORT/sub
123 cloning subrepo sub from static-http://localhost:$HGPORT/sub
129 requesting all changes
124 requesting all changes
130 adding changesets
125 adding changesets
131 adding manifests
126 adding manifests
132 adding file changes
127 adding file changes
133 added 2 changesets with 2 changes to 2 files
128 added 2 changesets with 2 changes to 2 files
134 new changesets be090ea66256:322ea90975df
129 new changesets be090ea66256:322ea90975df
135 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 $ cd local2
131 $ cd local2
137 $ hg verify
132 $ hg verify -q
138 checking changesets
139 checking manifests
140 crosschecking files in changesets and manifests
141 checking files
142 checked 1 changesets with 3 changes to 3 files
143 checking subrepo links
144 $ cat a
133 $ cat a
145 a
134 a
146 $ hg paths
135 $ hg paths
147 default = static-http://localhost:$HGPORT/
136 default = static-http://localhost:$HGPORT/
148
137
149 test with empty repo (issue965)
138 test with empty repo (issue965)
150
139
151 $ cd ..
140 $ cd ..
152 $ hg init remotempty
141 $ hg init remotempty
153 $ hg clone static-http://localhost:$HGPORT/remotempty local3
142 $ hg clone static-http://localhost:$HGPORT/remotempty local3
154 no changes found
143 no changes found
155 updating to branch default
144 updating to branch default
156 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 $ cd local3
146 $ cd local3
158 $ hg verify
147 $ hg verify -q
159 checking changesets
160 checking manifests
161 crosschecking files in changesets and manifests
162 checking files
163 checked 0 changesets with 0 changes to 0 files
164 $ hg paths
148 $ hg paths
165 default = static-http://localhost:$HGPORT/remotempty
149 default = static-http://localhost:$HGPORT/remotempty
166
150
167 test with non-repo
151 test with non-repo
168
152
169 $ cd ..
153 $ cd ..
170 $ mkdir notarepo
154 $ mkdir notarepo
171 $ hg clone static-http://localhost:$HGPORT/notarepo local3
155 $ hg clone static-http://localhost:$HGPORT/notarepo local3
172 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository
156 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository
173 [255]
157 [255]
174
158
175 Clone with tags and branches works
159 Clone with tags and branches works
176
160
177 $ hg init remote-with-names
161 $ hg init remote-with-names
178 $ cd remote-with-names
162 $ cd remote-with-names
179 $ echo 0 > foo
163 $ echo 0 > foo
180 $ hg -q commit -A -m initial
164 $ hg -q commit -A -m initial
181 $ echo 1 > foo
165 $ echo 1 > foo
182 $ hg commit -m 'commit 1'
166 $ hg commit -m 'commit 1'
183 $ hg -q up 0
167 $ hg -q up 0
184 $ hg branch mybranch
168 $ hg branch mybranch
185 marked working directory as branch mybranch
169 marked working directory as branch mybranch
186 (branches are permanent and global, did you want a bookmark?)
170 (branches are permanent and global, did you want a bookmark?)
187 $ echo 2 > foo
171 $ echo 2 > foo
188 $ hg commit -m 'commit 2 (mybranch)'
172 $ hg commit -m 'commit 2 (mybranch)'
189 $ hg tag -r 1 'default-tag'
173 $ hg tag -r 1 'default-tag'
190 $ hg tag -r 2 'branch-tag'
174 $ hg tag -r 2 'branch-tag'
191
175
192 $ cd ..
176 $ cd ..
193
177
194 $ hg clone static-http://localhost:$HGPORT/remote-with-names local-with-names
178 $ hg clone static-http://localhost:$HGPORT/remote-with-names local-with-names
195 requesting all changes
179 requesting all changes
196 adding changesets
180 adding changesets
197 adding manifests
181 adding manifests
198 adding file changes
182 adding file changes
199 added 5 changesets with 5 changes to 2 files (+1 heads)
183 added 5 changesets with 5 changes to 2 files (+1 heads)
200 new changesets 68986213bd44:0c325bd2b5a7
184 new changesets 68986213bd44:0c325bd2b5a7
201 updating to branch default
185 updating to branch default
202 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
186 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203
187
204 Clone a specific branch works
188 Clone a specific branch works
205
189
206 $ hg clone -r mybranch static-http://localhost:$HGPORT/remote-with-names local-with-names-branch
190 $ hg clone -r mybranch static-http://localhost:$HGPORT/remote-with-names local-with-names-branch
207 adding changesets
191 adding changesets
208 adding manifests
192 adding manifests
209 adding file changes
193 adding file changes
210 added 4 changesets with 4 changes to 2 files
194 added 4 changesets with 4 changes to 2 files
211 new changesets 68986213bd44:0c325bd2b5a7
195 new changesets 68986213bd44:0c325bd2b5a7
212 updating to branch mybranch
196 updating to branch mybranch
213 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
214
198
215 Clone a specific tag works
199 Clone a specific tag works
216
200
217 $ hg clone -r default-tag static-http://localhost:$HGPORT/remote-with-names local-with-names-tag
201 $ hg clone -r default-tag static-http://localhost:$HGPORT/remote-with-names local-with-names-tag
218 adding changesets
202 adding changesets
219 adding manifests
203 adding manifests
220 adding file changes
204 adding file changes
221 added 2 changesets with 2 changes to 1 files
205 added 2 changesets with 2 changes to 1 files
222 new changesets 68986213bd44:4ee3fcef1c80
206 new changesets 68986213bd44:4ee3fcef1c80
223 updating to branch default
207 updating to branch default
224 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
225
209
226 $ killdaemons.py
210 $ killdaemons.py
227
211
228 List of files accessed over HTTP:
212 List of files accessed over HTTP:
229
213
230 $ cat server.log | sed -n -e 's|.*GET \(/[^ ]*\).*|\1|p' | sort -u
214 $ cat server.log | sed -n -e 's|.*GET \(/[^ ]*\).*|\1|p' | sort -u
231 /.hg/bookmarks
215 /.hg/bookmarks
232 /.hg/bookmarks.current
216 /.hg/bookmarks.current
233 /.hg/cache/hgtagsfnodes1
217 /.hg/cache/hgtagsfnodes1
234 /.hg/dirstate
218 /.hg/dirstate
235 /.hg/requires
219 /.hg/requires
236 /.hg/store/00changelog.i
220 /.hg/store/00changelog.i
237 /.hg/store/00manifest.i
221 /.hg/store/00manifest.i
238 /.hg/store/data/%7E2ehgsub.i (no-py37 !)
222 /.hg/store/data/%7E2ehgsub.i (no-py37 !)
239 /.hg/store/data/%7E2ehgsubstate.i (no-py37 !)
223 /.hg/store/data/%7E2ehgsubstate.i (no-py37 !)
240 /.hg/store/data/a.i
224 /.hg/store/data/a.i
241 /.hg/store/data/~2ehgsub.i (py37 !)
225 /.hg/store/data/~2ehgsub.i (py37 !)
242 /.hg/store/data/~2ehgsubstate.i (py37 !)
226 /.hg/store/data/~2ehgsubstate.i (py37 !)
243 /.hg/store/requires
227 /.hg/store/requires
244 /notarepo/.hg/00changelog.i
228 /notarepo/.hg/00changelog.i
245 /notarepo/.hg/requires
229 /notarepo/.hg/requires
246 /remote-with-names/.hg/bookmarks
230 /remote-with-names/.hg/bookmarks
247 /remote-with-names/.hg/bookmarks.current
231 /remote-with-names/.hg/bookmarks.current
248 /remote-with-names/.hg/cache/branch2-served
232 /remote-with-names/.hg/cache/branch2-served
249 /remote-with-names/.hg/cache/hgtagsfnodes1
233 /remote-with-names/.hg/cache/hgtagsfnodes1
250 /remote-with-names/.hg/cache/tags2-served
234 /remote-with-names/.hg/cache/tags2-served
251 /remote-with-names/.hg/dirstate
235 /remote-with-names/.hg/dirstate
252 /remote-with-names/.hg/localtags
236 /remote-with-names/.hg/localtags
253 /remote-with-names/.hg/requires
237 /remote-with-names/.hg/requires
254 /remote-with-names/.hg/store/00changelog.i
238 /remote-with-names/.hg/store/00changelog.i
255 /remote-with-names/.hg/store/00manifest.i
239 /remote-with-names/.hg/store/00manifest.i
256 /remote-with-names/.hg/store/data/%7E2ehgtags.i (no-py37 !)
240 /remote-with-names/.hg/store/data/%7E2ehgtags.i (no-py37 !)
257 /remote-with-names/.hg/store/data/foo.i
241 /remote-with-names/.hg/store/data/foo.i
258 /remote-with-names/.hg/store/data/~2ehgtags.i (py37 !)
242 /remote-with-names/.hg/store/data/~2ehgtags.i (py37 !)
259 /remote-with-names/.hg/store/obsstore
243 /remote-with-names/.hg/store/obsstore
260 /remote-with-names/.hg/store/requires
244 /remote-with-names/.hg/store/requires
261 /remote/.hg/bookmarks
245 /remote/.hg/bookmarks
262 /remote/.hg/bookmarks.current
246 /remote/.hg/bookmarks.current
263 /remote/.hg/cache/branch2-base
247 /remote/.hg/cache/branch2-base
264 /remote/.hg/cache/branch2-immutable
248 /remote/.hg/cache/branch2-immutable
265 /remote/.hg/cache/branch2-served
249 /remote/.hg/cache/branch2-served
266 /remote/.hg/cache/hgtagsfnodes1
250 /remote/.hg/cache/hgtagsfnodes1
267 /remote/.hg/cache/rbc-names-v1
251 /remote/.hg/cache/rbc-names-v1
268 /remote/.hg/cache/tags2-served
252 /remote/.hg/cache/tags2-served
269 /remote/.hg/dirstate
253 /remote/.hg/dirstate
270 /remote/.hg/localtags
254 /remote/.hg/localtags
271 /remote/.hg/requires
255 /remote/.hg/requires
272 /remote/.hg/store/00changelog.i
256 /remote/.hg/store/00changelog.i
273 /remote/.hg/store/00manifest.i
257 /remote/.hg/store/00manifest.i
274 /remote/.hg/store/data/%7E2edotfile%20with%20spaces.i (no-py37 !)
258 /remote/.hg/store/data/%7E2edotfile%20with%20spaces.i (no-py37 !)
275 /remote/.hg/store/data/%7E2ehgtags.i (no-py37 !)
259 /remote/.hg/store/data/%7E2ehgtags.i (no-py37 !)
276 /remote/.hg/store/data/bar.i
260 /remote/.hg/store/data/bar.i
277 /remote/.hg/store/data/quux.i
261 /remote/.hg/store/data/quux.i
278 /remote/.hg/store/data/~2edotfile%20with%20spaces.i (py37 !)
262 /remote/.hg/store/data/~2edotfile%20with%20spaces.i (py37 !)
279 /remote/.hg/store/data/~2ehgtags.i (py37 !)
263 /remote/.hg/store/data/~2ehgtags.i (py37 !)
280 /remote/.hg/store/obsstore
264 /remote/.hg/store/obsstore
281 /remote/.hg/store/requires
265 /remote/.hg/store/requires
282 /remotempty/.hg/bookmarks
266 /remotempty/.hg/bookmarks
283 /remotempty/.hg/bookmarks.current
267 /remotempty/.hg/bookmarks.current
284 /remotempty/.hg/dirstate
268 /remotempty/.hg/dirstate
285 /remotempty/.hg/requires
269 /remotempty/.hg/requires
286 /remotempty/.hg/store/00changelog.i
270 /remotempty/.hg/store/00changelog.i
287 /remotempty/.hg/store/00manifest.i
271 /remotempty/.hg/store/00manifest.i
288 /remotempty/.hg/store/requires
272 /remotempty/.hg/store/requires
289 /sub/.hg/bookmarks
273 /sub/.hg/bookmarks
290 /sub/.hg/bookmarks.current
274 /sub/.hg/bookmarks.current
291 /sub/.hg/cache/hgtagsfnodes1
275 /sub/.hg/cache/hgtagsfnodes1
292 /sub/.hg/dirstate
276 /sub/.hg/dirstate
293 /sub/.hg/requires
277 /sub/.hg/requires
294 /sub/.hg/store/00changelog.i
278 /sub/.hg/store/00changelog.i
295 /sub/.hg/store/00manifest.i
279 /sub/.hg/store/00manifest.i
296 /sub/.hg/store/data/%7E2ehgtags.i (no-py37 !)
280 /sub/.hg/store/data/%7E2ehgtags.i (no-py37 !)
297 /sub/.hg/store/data/test.i
281 /sub/.hg/store/data/test.i
298 /sub/.hg/store/data/~2ehgtags.i (py37 !)
282 /sub/.hg/store/data/~2ehgtags.i (py37 !)
299 /sub/.hg/store/requires
283 /sub/.hg/store/requires
@@ -1,220 +1,184
1 test stripping of filelogs where the linkrev doesn't always increase
1 test stripping of filelogs where the linkrev doesn't always increase
2
2
3 $ echo '[extensions]' >> $HGRCPATH
3 $ echo '[extensions]' >> $HGRCPATH
4 $ echo 'strip =' >> $HGRCPATH
4 $ echo 'strip =' >> $HGRCPATH
5 $ commit()
5 $ commit()
6 > {
6 > {
7 > hg up -qC null
7 > hg up -qC null
8 > count=1
8 > count=1
9 > for i in "$@"; do
9 > for i in "$@"; do
10 > for f in $i; do
10 > for f in $i; do
11 > mkdir -p `dirname $f`
11 > mkdir -p `dirname $f`
12 > echo $count > $f
12 > echo $count > $f
13 > done
13 > done
14 > count=`expr $count + 1`
14 > count=`expr $count + 1`
15 > done
15 > done
16 > hg commit -qAm "$*"
16 > hg commit -qAm "$*"
17 > }
17 > }
18
18
19 2 1 0 2 0 1 2
19 2 1 0 2 0 1 2
20
20
21 $ mkdir files
21 $ mkdir files
22 $ cd files
22 $ cd files
23 $ hg init orig
23 $ hg init orig
24 $ cd orig
24 $ cd orig
25 $ commit '201 210'
25 $ commit '201 210'
26 $ commit '102 120' '210'
26 $ commit '102 120' '210'
27 $ commit '021'
27 $ commit '021'
28 $ commit '201' '021 120'
28 $ commit '201' '021 120'
29 $ commit '012 021' '102 201' '120 210'
29 $ commit '012 021' '102 201' '120 210'
30 $ commit '102 120' '012 210' '021 201'
30 $ commit '102 120' '012 210' '021 201'
31 $ commit '201 210' '021 120' '012 102'
31 $ commit '201 210' '021 120' '012 102'
32 $ cd ..
32 $ cd ..
33 $ hg clone -q -U -r 4 -r 5 -r 6 orig crossed
33 $ hg clone -q -U -r 4 -r 5 -r 6 orig crossed
34 $ cd crossed
34 $ cd crossed
35
35
36 $ for i in 012 021 102 120 201 210; do
36 $ for i in 012 021 102 120 201 210; do
37 > echo $i
37 > echo $i
38 > hg debugindex $i
38 > hg debugindex $i
39 > echo
39 > echo
40 > done
40 > done
41 012
41 012
42 rev linkrev nodeid p1-nodeid p2-nodeid
42 rev linkrev nodeid p1-nodeid p2-nodeid
43 0 0 b8e02f643373 000000000000 000000000000
43 0 0 b8e02f643373 000000000000 000000000000
44 1 1 5d9299349fc0 000000000000 000000000000
44 1 1 5d9299349fc0 000000000000 000000000000
45 2 2 2661d26c6496 000000000000 000000000000
45 2 2 2661d26c6496 000000000000 000000000000
46
46
47 021
47 021
48 rev linkrev nodeid p1-nodeid p2-nodeid
48 rev linkrev nodeid p1-nodeid p2-nodeid
49 0 0 b8e02f643373 000000000000 000000000000
49 0 0 b8e02f643373 000000000000 000000000000
50 1 2 5d9299349fc0 000000000000 000000000000
50 1 2 5d9299349fc0 000000000000 000000000000
51 2 1 2661d26c6496 000000000000 000000000000
51 2 1 2661d26c6496 000000000000 000000000000
52
52
53 102
53 102
54 rev linkrev nodeid p1-nodeid p2-nodeid
54 rev linkrev nodeid p1-nodeid p2-nodeid
55 0 1 b8e02f643373 000000000000 000000000000
55 0 1 b8e02f643373 000000000000 000000000000
56 1 0 5d9299349fc0 000000000000 000000000000
56 1 0 5d9299349fc0 000000000000 000000000000
57 2 2 2661d26c6496 000000000000 000000000000
57 2 2 2661d26c6496 000000000000 000000000000
58
58
59 120
59 120
60 rev linkrev nodeid p1-nodeid p2-nodeid
60 rev linkrev nodeid p1-nodeid p2-nodeid
61 0 1 b8e02f643373 000000000000 000000000000
61 0 1 b8e02f643373 000000000000 000000000000
62 1 2 5d9299349fc0 000000000000 000000000000
62 1 2 5d9299349fc0 000000000000 000000000000
63 2 0 2661d26c6496 000000000000 000000000000
63 2 0 2661d26c6496 000000000000 000000000000
64
64
65 201
65 201
66 rev linkrev nodeid p1-nodeid p2-nodeid
66 rev linkrev nodeid p1-nodeid p2-nodeid
67 0 2 b8e02f643373 000000000000 000000000000
67 0 2 b8e02f643373 000000000000 000000000000
68 1 0 5d9299349fc0 000000000000 000000000000
68 1 0 5d9299349fc0 000000000000 000000000000
69 2 1 2661d26c6496 000000000000 000000000000
69 2 1 2661d26c6496 000000000000 000000000000
70
70
71 210
71 210
72 rev linkrev nodeid p1-nodeid p2-nodeid
72 rev linkrev nodeid p1-nodeid p2-nodeid
73 0 2 b8e02f643373 000000000000 000000000000
73 0 2 b8e02f643373 000000000000 000000000000
74 1 1 5d9299349fc0 000000000000 000000000000
74 1 1 5d9299349fc0 000000000000 000000000000
75 2 0 2661d26c6496 000000000000 000000000000
75 2 0 2661d26c6496 000000000000 000000000000
76
76
77 $ cd ..
77 $ cd ..
78 $ for i in 0 1 2; do
78 $ for i in 0 1 2; do
79 > hg clone -q -U --pull crossed $i
79 > hg clone -q -U --pull crossed $i
80 > echo "% Trying to strip revision $i"
80 > echo "% Trying to strip revision $i"
81 > hg --cwd $i strip $i
81 > hg --cwd $i strip $i
82 > echo "% Verifying"
82 > echo "% Verifying"
83 > hg --cwd $i verify
83 > hg --cwd $i verify -q
84 > echo
84 > echo
85 > done
85 > done
86 % Trying to strip revision 0
86 % Trying to strip revision 0
87 saved backup bundle to $TESTTMP/files/0/.hg/strip-backup/cbb8c2f0a2e3-239800b9-backup.hg
87 saved backup bundle to $TESTTMP/files/0/.hg/strip-backup/cbb8c2f0a2e3-239800b9-backup.hg
88 % Verifying
88 % Verifying
89 checking changesets
90 checking manifests
91 crosschecking files in changesets and manifests
92 checking files
93 checked 2 changesets with 12 changes to 6 files
94
89
95 % Trying to strip revision 1
90 % Trying to strip revision 1
96 saved backup bundle to $TESTTMP/files/1/.hg/strip-backup/124ecc0cbec9-6104543f-backup.hg
91 saved backup bundle to $TESTTMP/files/1/.hg/strip-backup/124ecc0cbec9-6104543f-backup.hg
97 % Verifying
92 % Verifying
98 checking changesets
99 checking manifests
100 crosschecking files in changesets and manifests
101 checking files
102 checked 2 changesets with 12 changes to 6 files
103
93
104 % Trying to strip revision 2
94 % Trying to strip revision 2
105 saved backup bundle to $TESTTMP/files/2/.hg/strip-backup/f6439b304a1a-c6505a5f-backup.hg
95 saved backup bundle to $TESTTMP/files/2/.hg/strip-backup/f6439b304a1a-c6505a5f-backup.hg
106 % Verifying
96 % Verifying
107 checking changesets
108 checking manifests
109 crosschecking files in changesets and manifests
110 checking files
111 checked 2 changesets with 12 changes to 6 files
112
97
113 $ cd ..
98 $ cd ..
114
99
115 Do a similar test where the manifest revlog has unordered linkrevs
100 Do a similar test where the manifest revlog has unordered linkrevs
116 $ mkdir manifests
101 $ mkdir manifests
117 $ cd manifests
102 $ cd manifests
118 $ hg init orig
103 $ hg init orig
119 $ cd orig
104 $ cd orig
120 $ commit 'file'
105 $ commit 'file'
121 $ commit 'other'
106 $ commit 'other'
122 $ commit '' 'other'
107 $ commit '' 'other'
123 $ HGUSER=another-user; export HGUSER
108 $ HGUSER=another-user; export HGUSER
124 $ commit 'file'
109 $ commit 'file'
125 $ commit 'other' 'file'
110 $ commit 'other' 'file'
126 $ cd ..
111 $ cd ..
127 $ hg clone -q -U -r 1 -r 2 -r 3 -r 4 orig crossed
112 $ hg clone -q -U -r 1 -r 2 -r 3 -r 4 orig crossed
128 $ cd crossed
113 $ cd crossed
129 $ hg debugindex --manifest
114 $ hg debugindex --manifest
130 rev linkrev nodeid p1-nodeid p2-nodeid
115 rev linkrev nodeid p1-nodeid p2-nodeid
131 0 2 6bbc6fee55c2 000000000000 000000000000
116 0 2 6bbc6fee55c2 000000000000 000000000000
132 1 0 1c556153fe54 000000000000 000000000000
117 1 0 1c556153fe54 000000000000 000000000000
133 2 1 1f76dba919fd 000000000000 000000000000
118 2 1 1f76dba919fd 000000000000 000000000000
134 3 3 bbee06ad59d5 000000000000 000000000000
119 3 3 bbee06ad59d5 000000000000 000000000000
135
120
136 $ cd ..
121 $ cd ..
137 $ for i in 2 3; do
122 $ for i in 2 3; do
138 > hg clone -q -U --pull crossed $i
123 > hg clone -q -U --pull crossed $i
139 > echo "% Trying to strip revision $i"
124 > echo "% Trying to strip revision $i"
140 > hg --cwd $i strip $i
125 > hg --cwd $i strip $i
141 > echo "% Verifying"
126 > echo "% Verifying"
142 > hg --cwd $i verify
127 > hg --cwd $i verify -q
143 > echo
128 > echo
144 > done
129 > done
145 % Trying to strip revision 2
130 % Trying to strip revision 2
146 saved backup bundle to $TESTTMP/manifests/2/.hg/strip-backup/f3015ad03c03-4d98bdc2-backup.hg
131 saved backup bundle to $TESTTMP/manifests/2/.hg/strip-backup/f3015ad03c03-4d98bdc2-backup.hg
147 % Verifying
132 % Verifying
148 checking changesets
149 checking manifests
150 crosschecking files in changesets and manifests
151 checking files
152 checked 3 changesets with 3 changes to 2 files
153
133
154 % Trying to strip revision 3
134 % Trying to strip revision 3
155 saved backup bundle to $TESTTMP/manifests/3/.hg/strip-backup/9632aa303aa4-69192e3f-backup.hg
135 saved backup bundle to $TESTTMP/manifests/3/.hg/strip-backup/9632aa303aa4-69192e3f-backup.hg
156 % Verifying
136 % Verifying
157 checking changesets
158 checking manifests
159 crosschecking files in changesets and manifests
160 checking files
161 checked 3 changesets with 3 changes to 2 files
162
137
163 $ cd ..
138 $ cd ..
164
139
165 Now a similar test for a non-root manifest revlog
140 Now a similar test for a non-root manifest revlog
166 $ cat >> $HGRCPATH <<EOF
141 $ cat >> $HGRCPATH <<EOF
167 > [experimental]
142 > [experimental]
168 > treemanifests = yes
143 > treemanifests = yes
169 > EOF
144 > EOF
170 $ mkdir treemanifests
145 $ mkdir treemanifests
171 $ cd treemanifests
146 $ cd treemanifests
172 $
147 $
173 $ hg --config experimental.treemanifest=True init orig
148 $ hg --config experimental.treemanifest=True init orig
174 $ cd orig
149 $ cd orig
175 $ commit 'dir/file'
150 $ commit 'dir/file'
176 $ commit 'dir/other'
151 $ commit 'dir/other'
177 $ commit '' 'dir/other'
152 $ commit '' 'dir/other'
178 $ HGUSER=yet-another-user; export HGUSER
153 $ HGUSER=yet-another-user; export HGUSER
179 $ commit 'otherdir dir/file'
154 $ commit 'otherdir dir/file'
180 $ commit 'otherdir dir/other' 'otherdir dir/file'
155 $ commit 'otherdir dir/other' 'otherdir dir/file'
181 $ cd ..
156 $ cd ..
182 $ hg --config experimental.treemanifest=True clone -q -U -r 1 -r 2 -r 3 -r 4 orig crossed
157 $ hg --config experimental.treemanifest=True clone -q -U -r 1 -r 2 -r 3 -r 4 orig crossed
183 $ cd crossed
158 $ cd crossed
184 $ hg debugindex --dir dir
159 $ hg debugindex --dir dir
185 rev linkrev nodeid p1-nodeid p2-nodeid
160 rev linkrev nodeid p1-nodeid p2-nodeid
186 0 2 6bbc6fee55c2 000000000000 000000000000
161 0 2 6bbc6fee55c2 000000000000 000000000000
187 1 0 1c556153fe54 000000000000 000000000000
162 1 0 1c556153fe54 000000000000 000000000000
188 2 1 1f76dba919fd 000000000000 000000000000
163 2 1 1f76dba919fd 000000000000 000000000000
189 3 3 bbee06ad59d5 000000000000 000000000000
164 3 3 bbee06ad59d5 000000000000 000000000000
190
165
191 $ cd ..
166 $ cd ..
192 $ for i in 2 3; do
167 $ for i in 2 3; do
193 > hg --config experimental.treemanifest=True clone -q -U --pull crossed $i
168 > hg --config experimental.treemanifest=True clone -q -U --pull crossed $i
194 > echo "% Trying to strip revision $i"
169 > echo "% Trying to strip revision $i"
195 > hg --cwd $i strip $i
170 > hg --cwd $i strip $i
196 > echo "% Verifying"
171 > echo "% Verifying"
197 > hg --cwd $i verify
172 > hg --cwd $i verify -q
198 > echo
173 > echo
199 > done
174 > done
200 % Trying to strip revision 2
175 % Trying to strip revision 2
201 saved backup bundle to $TESTTMP/treemanifests/2/.hg/strip-backup/145f5c75f9ac-a105cfbe-backup.hg
176 saved backup bundle to $TESTTMP/treemanifests/2/.hg/strip-backup/145f5c75f9ac-a105cfbe-backup.hg
202 % Verifying
177 % Verifying
203 checking changesets
204 checking manifests
205 checking directory manifests
206 crosschecking files in changesets and manifests
207 checking files
208 checked 3 changesets with 4 changes to 3 files
209
178
210 % Trying to strip revision 3
179 % Trying to strip revision 3
211 saved backup bundle to $TESTTMP/treemanifests/3/.hg/strip-backup/e4e3de5c3cb2-f4c70376-backup.hg
180 saved backup bundle to $TESTTMP/treemanifests/3/.hg/strip-backup/e4e3de5c3cb2-f4c70376-backup.hg
212 % Verifying
181 % Verifying
213 checking changesets
214 checking manifests
215 checking directory manifests
216 crosschecking files in changesets and manifests
217 checking files
218 checked 3 changesets with 4 changes to 3 files
219
182
183
220 $ cd ..
184 $ cd ..
@@ -1,146 +1,134
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ hg init subrepo
3 $ hg init subrepo
4 $ echo a > subrepo/a
4 $ echo a > subrepo/a
5 $ hg -R subrepo ci -Am adda
5 $ hg -R subrepo ci -Am adda
6 adding a
6 adding a
7 $ echo 'subrepo = subrepo' > .hgsub
7 $ echo 'subrepo = subrepo' > .hgsub
8 $ hg ci -Am addsubrepo
8 $ hg ci -Am addsubrepo
9 adding .hgsub
9 adding .hgsub
10 $ echo b > subrepo/b
10 $ echo b > subrepo/b
11 $ hg -R subrepo ci -Am addb
11 $ hg -R subrepo ci -Am addb
12 adding b
12 adding b
13 $ hg ci -m updatedsub
13 $ hg ci -m updatedsub
14
14
15 ignore blanklines in .hgsubstate
15 ignore blanklines in .hgsubstate
16
16
17 >>> open('.hgsubstate', 'wb').write(b'\n\n \t \n \n') and None
17 >>> open('.hgsubstate', 'wb').write(b'\n\n \t \n \n') and None
18 $ hg st --subrepos
18 $ hg st --subrepos
19 M .hgsubstate
19 M .hgsubstate
20 $ hg revert -qC .hgsubstate
20 $ hg revert -qC .hgsubstate
21
21
22 abort more gracefully on .hgsubstate parsing error
22 abort more gracefully on .hgsubstate parsing error
23
23
24 $ cp .hgsubstate .hgsubstate.old
24 $ cp .hgsubstate .hgsubstate.old
25 >>> open('.hgsubstate', 'wb').write(b'\ninvalid') and None
25 >>> open('.hgsubstate', 'wb').write(b'\ninvalid') and None
26 $ hg st --subrepos --cwd $TESTTMP -R $TESTTMP/repo
26 $ hg st --subrepos --cwd $TESTTMP -R $TESTTMP/repo
27 abort: invalid subrepository revision specifier in 'repo/.hgsubstate' line 2
27 abort: invalid subrepository revision specifier in 'repo/.hgsubstate' line 2
28 [255]
28 [255]
29 $ mv .hgsubstate.old .hgsubstate
29 $ mv .hgsubstate.old .hgsubstate
30
30
31 delete .hgsub and revert it
31 delete .hgsub and revert it
32
32
33 $ rm .hgsub
33 $ rm .hgsub
34 $ hg revert .hgsub
34 $ hg revert .hgsub
35 warning: subrepo spec file '.hgsub' not found
35 warning: subrepo spec file '.hgsub' not found
36 warning: subrepo spec file '.hgsub' not found
36 warning: subrepo spec file '.hgsub' not found
37
37
38 delete .hgsubstate and revert it
38 delete .hgsubstate and revert it
39
39
40 $ rm .hgsubstate
40 $ rm .hgsubstate
41 $ hg revert .hgsubstate
41 $ hg revert .hgsubstate
42
42
43 delete .hgsub and update
43 delete .hgsub and update
44
44
45 $ rm .hgsub
45 $ rm .hgsub
46 $ hg up 0 --cwd $TESTTMP -R $TESTTMP/repo
46 $ hg up 0 --cwd $TESTTMP -R $TESTTMP/repo
47 warning: subrepo spec file 'repo/.hgsub' not found
47 warning: subrepo spec file 'repo/.hgsub' not found
48 warning: subrepo spec file 'repo/.hgsub' not found
48 warning: subrepo spec file 'repo/.hgsub' not found
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 $ hg st
50 $ hg st
51 warning: subrepo spec file '.hgsub' not found
51 warning: subrepo spec file '.hgsub' not found
52 ! .hgsub
52 ! .hgsub
53 $ ls -A subrepo
53 $ ls -A subrepo
54 .hg
54 .hg
55 a
55 a
56
56
57 delete .hgsubstate and update
57 delete .hgsubstate and update
58
58
59 $ hg up -C
59 $ hg up -C
60 warning: subrepo spec file '.hgsub' not found
60 warning: subrepo spec file '.hgsub' not found
61 warning: subrepo spec file '.hgsub' not found
61 warning: subrepo spec file '.hgsub' not found
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 $ rm .hgsubstate
63 $ rm .hgsubstate
64 $ hg up 0
64 $ hg up 0
65 other [destination] changed .hgsubstate which local [working copy] deleted
65 other [destination] changed .hgsubstate which local [working copy] deleted
66 use (c)hanged version or leave (d)eleted? c
66 use (c)hanged version or leave (d)eleted? c
67 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 $ hg st
68 $ hg st
69 $ ls -A subrepo
69 $ ls -A subrepo
70 .hg
70 .hg
71 a
71 a
72
72
73 Enable obsolete
73 Enable obsolete
74
74
75 $ cat >> $HGRCPATH << EOF
75 $ cat >> $HGRCPATH << EOF
76 > [ui]
76 > [ui]
77 > logtemplate= {rev}:{node|short} {desc|firstline}
77 > logtemplate= {rev}:{node|short} {desc|firstline}
78 > [phases]
78 > [phases]
79 > publish=False
79 > publish=False
80 > [experimental]
80 > [experimental]
81 > evolution.createmarkers=True
81 > evolution.createmarkers=True
82 > EOF
82 > EOF
83
83
84 check that we can update parent repo with missing (amended) subrepo revision
84 check that we can update parent repo with missing (amended) subrepo revision
85
85
86 $ hg up --repository subrepo -r tip
86 $ hg up --repository subrepo -r tip
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 $ hg ci -m "updated subrepo to tip"
88 $ hg ci -m "updated subrepo to tip"
89 created new head
89 created new head
90 $ cd subrepo
90 $ cd subrepo
91 $ hg update -r tip
91 $ hg update -r tip
92 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 $ echo foo > a
93 $ echo foo > a
94 $ hg commit --amend -m "addb (amended)"
94 $ hg commit --amend -m "addb (amended)"
95 $ cd ..
95 $ cd ..
96 $ hg update --clean .
96 $ hg update --clean .
97 revision 102a90ea7b4a in subrepository "subrepo" is hidden
97 revision 102a90ea7b4a in subrepository "subrepo" is hidden
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99
99
100 check that --hidden is propagated to the subrepo
100 check that --hidden is propagated to the subrepo
101
101
102 $ hg -R subrepo up tip
102 $ hg -R subrepo up tip
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 $ hg ci -m 'commit with amended subrepo'
104 $ hg ci -m 'commit with amended subrepo'
105 $ echo bar > subrepo/a
105 $ echo bar > subrepo/a
106 $ hg -R subrepo ci --amend -m "amend a (again)"
106 $ hg -R subrepo ci --amend -m "amend a (again)"
107 $ hg --hidden cat subrepo/a
107 $ hg --hidden cat subrepo/a
108 foo
108 foo
109
109
110 verify will warn if locked-in subrepo revisions are hidden or missing
110 verify will warn if locked-in subrepo revisions are hidden or missing
111
111
112 $ hg ci -m "amended subrepo (again)"
112 $ hg ci -m "amended subrepo (again)"
113 $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip' --config devel.strip-obsmarkers=no
113 $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip' --config devel.strip-obsmarkers=no
114 $ hg verify
114 $ hg verify -q
115 checking changesets
116 checking manifests
117 crosschecking files in changesets and manifests
118 checking files
119 checked 5 changesets with 5 changes to 2 files
120 checking subrepo links
121 subrepo 'subrepo' is hidden in revision a66de08943b6
115 subrepo 'subrepo' is hidden in revision a66de08943b6
122 subrepo 'subrepo' is hidden in revision 674d05939c1e
116 subrepo 'subrepo' is hidden in revision 674d05939c1e
123 subrepo 'subrepo' not found in revision a7d05d9055a4
117 subrepo 'subrepo' not found in revision a7d05d9055a4
124
118
125 verifying shouldn't init a new subrepo if the reference doesn't exist
119 verifying shouldn't init a new subrepo if the reference doesn't exist
126
120
127 $ mv subrepo b
121 $ mv subrepo b
128 $ hg verify
122 $ hg verify -q
129 checking changesets
130 checking manifests
131 crosschecking files in changesets and manifests
132 checking files
133 checked 5 changesets with 5 changes to 2 files
134 checking subrepo links
135 0: repository $TESTTMP/repo/subrepo not found
123 0: repository $TESTTMP/repo/subrepo not found
136 1: repository $TESTTMP/repo/subrepo not found
124 1: repository $TESTTMP/repo/subrepo not found
137 3: repository $TESTTMP/repo/subrepo not found
125 3: repository $TESTTMP/repo/subrepo not found
138 4: repository $TESTTMP/repo/subrepo not found
126 4: repository $TESTTMP/repo/subrepo not found
139 $ ls -A
127 $ ls -A
140 .hg
128 .hg
141 .hgsub
129 .hgsub
142 .hgsubstate
130 .hgsubstate
143 b
131 b
144 $ mv b subrepo
132 $ mv b subrepo
145
133
146 $ cd ..
134 $ cd ..
@@ -1,896 +1,842
1 Set up repo
1 Set up repo
2
2
3 $ hg --config experimental.treemanifest=True init repo
3 $ hg --config experimental.treemanifest=True init repo
4 $ cd repo
4 $ cd repo
5
5
6 Requirements get set on init
6 Requirements get set on init
7
7
8 $ hg debugrequires | grep treemanifest
8 $ hg debugrequires | grep treemanifest
9 treemanifest
9 treemanifest
10
10
11 Without directories, looks like any other repo
11 Without directories, looks like any other repo
12
12
13 $ echo 0 > a
13 $ echo 0 > a
14 $ echo 0 > b
14 $ echo 0 > b
15 $ hg ci -Aqm initial
15 $ hg ci -Aqm initial
16 $ hg debugdata -m 0
16 $ hg debugdata -m 0
17 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
17 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
18 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
18 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
19
19
20 Submanifest is stored in separate revlog
20 Submanifest is stored in separate revlog
21
21
22 $ mkdir dir1
22 $ mkdir dir1
23 $ echo 1 > dir1/a
23 $ echo 1 > dir1/a
24 $ echo 1 > dir1/b
24 $ echo 1 > dir1/b
25 $ echo 1 > e
25 $ echo 1 > e
26 $ hg ci -Aqm 'add dir1'
26 $ hg ci -Aqm 'add dir1'
27 $ hg debugdata -m 1
27 $ hg debugdata -m 1
28 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
28 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
29 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
29 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
30 dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc)
30 dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc)
31 e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
31 e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
32 $ hg debugdata --dir dir1 0
32 $ hg debugdata --dir dir1 0
33 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
33 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
34 b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
34 b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
35
35
36 Can add nested directories
36 Can add nested directories
37
37
38 $ mkdir dir1/dir1
38 $ mkdir dir1/dir1
39 $ echo 2 > dir1/dir1/a
39 $ echo 2 > dir1/dir1/a
40 $ echo 2 > dir1/dir1/b
40 $ echo 2 > dir1/dir1/b
41 $ mkdir dir1/dir2
41 $ mkdir dir1/dir2
42 $ echo 2 > dir1/dir2/a
42 $ echo 2 > dir1/dir2/a
43 $ echo 2 > dir1/dir2/b
43 $ echo 2 > dir1/dir2/b
44 $ hg ci -Aqm 'add dir1/dir1'
44 $ hg ci -Aqm 'add dir1/dir1'
45 $ hg files -r .
45 $ hg files -r .
46 a
46 a
47 b
47 b
48 dir1/a
48 dir1/a
49 dir1/b
49 dir1/b
50 dir1/dir1/a
50 dir1/dir1/a
51 dir1/dir1/b
51 dir1/dir1/b
52 dir1/dir2/a
52 dir1/dir2/a
53 dir1/dir2/b
53 dir1/dir2/b
54 e
54 e
55
55
56 The manifest command works
56 The manifest command works
57
57
58 $ hg manifest
58 $ hg manifest
59 a
59 a
60 b
60 b
61 dir1/a
61 dir1/a
62 dir1/b
62 dir1/b
63 dir1/dir1/a
63 dir1/dir1/a
64 dir1/dir1/b
64 dir1/dir1/b
65 dir1/dir2/a
65 dir1/dir2/a
66 dir1/dir2/b
66 dir1/dir2/b
67 e
67 e
68
68
69 Revision is not created for unchanged directory
69 Revision is not created for unchanged directory
70
70
71 $ mkdir dir2
71 $ mkdir dir2
72 $ echo 3 > dir2/a
72 $ echo 3 > dir2/a
73 $ hg add dir2
73 $ hg add dir2
74 adding dir2/a
74 adding dir2/a
75 $ hg debugindex --dir dir1 > before
75 $ hg debugindex --dir dir1 > before
76 $ hg ci -qm 'add dir2'
76 $ hg ci -qm 'add dir2'
77 $ hg debugindex --dir dir1 > after
77 $ hg debugindex --dir dir1 > after
78 $ diff before after
78 $ diff before after
79 $ rm before after
79 $ rm before after
80
80
81 Removing directory does not create an revlog entry
81 Removing directory does not create an revlog entry
82
82
83 $ hg rm dir1/dir1
83 $ hg rm dir1/dir1
84 removing dir1/dir1/a
84 removing dir1/dir1/a
85 removing dir1/dir1/b
85 removing dir1/dir1/b
86 $ hg debugindex --dir dir1/dir1 > before
86 $ hg debugindex --dir dir1/dir1 > before
87 $ hg ci -qm 'remove dir1/dir1'
87 $ hg ci -qm 'remove dir1/dir1'
88 $ hg debugindex --dir dir1/dir1 > after
88 $ hg debugindex --dir dir1/dir1 > after
89 $ diff before after
89 $ diff before after
90 $ rm before after
90 $ rm before after
91
91
92 Check that hg files (calls treemanifest.walk()) works
92 Check that hg files (calls treemanifest.walk()) works
93 without loading all directory revlogs
93 without loading all directory revlogs
94
94
95 $ hg co 'desc("add dir2")'
95 $ hg co 'desc("add dir2")'
96 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup
97 $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup
98 $ hg files -r . dir1
98 $ hg files -r . dir1
99 dir1/a
99 dir1/a
100 dir1/b
100 dir1/b
101 dir1/dir1/a
101 dir1/dir1/a
102 dir1/dir1/b
102 dir1/dir1/b
103 dir1/dir2/a
103 dir1/dir2/a
104 dir1/dir2/b
104 dir1/dir2/b
105
105
106 Check that status between revisions works (calls treemanifest.matches())
106 Check that status between revisions works (calls treemanifest.matches())
107 without loading all directory revlogs
107 without loading all directory revlogs
108
108
109 $ hg status --rev 'desc("add dir1")' --rev . dir1
109 $ hg status --rev 'desc("add dir1")' --rev . dir1
110 A dir1/dir1/a
110 A dir1/dir1/a
111 A dir1/dir1/b
111 A dir1/dir1/b
112 A dir1/dir2/a
112 A dir1/dir2/a
113 A dir1/dir2/b
113 A dir1/dir2/b
114 $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2
114 $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2
115
115
116 Merge creates 2-parent revision of directory revlog
116 Merge creates 2-parent revision of directory revlog
117
117
118 $ echo 5 > dir1/a
118 $ echo 5 > dir1/a
119 $ hg ci -Aqm 'modify dir1/a'
119 $ hg ci -Aqm 'modify dir1/a'
120 $ hg co '.^'
120 $ hg co '.^'
121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 $ echo 6 > dir1/b
122 $ echo 6 > dir1/b
123 $ hg ci -Aqm 'modify dir1/b'
123 $ hg ci -Aqm 'modify dir1/b'
124 $ hg merge 'desc("modify dir1/a")'
124 $ hg merge 'desc("modify dir1/a")'
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 (branch merge, don't forget to commit)
126 (branch merge, don't forget to commit)
127 $ hg ci -m 'conflict-free merge involving dir1/'
127 $ hg ci -m 'conflict-free merge involving dir1/'
128 $ cat dir1/a
128 $ cat dir1/a
129 5
129 5
130 $ cat dir1/b
130 $ cat dir1/b
131 6
131 6
132 $ hg debugindex --dir dir1
132 $ hg debugindex --dir dir1
133 rev linkrev nodeid p1-nodeid p2-nodeid
133 rev linkrev nodeid p1-nodeid p2-nodeid
134 0 1 8b3ffd73f901 000000000000 000000000000
134 0 1 8b3ffd73f901 000000000000 000000000000
135 1 2 68e9d057c5a8 8b3ffd73f901 000000000000
135 1 2 68e9d057c5a8 8b3ffd73f901 000000000000
136 2 4 4698198d2624 68e9d057c5a8 000000000000
136 2 4 4698198d2624 68e9d057c5a8 000000000000
137 3 5 44844058ccce 68e9d057c5a8 000000000000
137 3 5 44844058ccce 68e9d057c5a8 000000000000
138 4 6 bf3d9b744927 68e9d057c5a8 000000000000
138 4 6 bf3d9b744927 68e9d057c5a8 000000000000
139 5 7 dde7c0af2a03 bf3d9b744927 44844058ccce
139 5 7 dde7c0af2a03 bf3d9b744927 44844058ccce
140
140
141 Merge keeping directory from parent 1 does not create revlog entry. (Note that
141 Merge keeping directory from parent 1 does not create revlog entry. (Note that
142 dir1's manifest does change, but only because dir1/a's filelog changes.)
142 dir1's manifest does change, but only because dir1/a's filelog changes.)
143
143
144 $ hg co 'desc("add dir2")'
144 $ hg co 'desc("add dir2")'
145 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 $ echo 8 > dir2/a
146 $ echo 8 > dir2/a
147 $ hg ci -m 'modify dir2/a'
147 $ hg ci -m 'modify dir2/a'
148 created new head
148 created new head
149
149
150 $ hg debugindex --dir dir2 > before
150 $ hg debugindex --dir dir2 > before
151 $ hg merge 'desc("modify dir1/a")'
151 $ hg merge 'desc("modify dir1/a")'
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 (branch merge, don't forget to commit)
153 (branch merge, don't forget to commit)
154 $ hg revert -r 'desc("modify dir2/a")' .
154 $ hg revert -r 'desc("modify dir2/a")' .
155 reverting dir1/a
155 reverting dir1/a
156 $ hg ci -m 'merge, keeping parent 1'
156 $ hg ci -m 'merge, keeping parent 1'
157 $ hg debugindex --dir dir2 > after
157 $ hg debugindex --dir dir2 > after
158 $ diff before after
158 $ diff before after
159 $ rm before after
159 $ rm before after
160
160
161 Merge keeping directory from parent 2 does not create revlog entry. (Note that
161 Merge keeping directory from parent 2 does not create revlog entry. (Note that
162 dir2's manifest does change, but only because dir2/a's filelog changes.)
162 dir2's manifest does change, but only because dir2/a's filelog changes.)
163
163
164 $ hg co 'desc("modify dir2/a")'
164 $ hg co 'desc("modify dir2/a")'
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 $ hg debugindex --dir dir1 > before
166 $ hg debugindex --dir dir1 > before
167 $ hg merge 'desc("modify dir1/a")'
167 $ hg merge 'desc("modify dir1/a")'
168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 (branch merge, don't forget to commit)
169 (branch merge, don't forget to commit)
170 $ hg revert -r 'desc("modify dir1/a")' .
170 $ hg revert -r 'desc("modify dir1/a")' .
171 reverting dir2/a
171 reverting dir2/a
172 $ hg ci -m 'merge, keeping parent 2'
172 $ hg ci -m 'merge, keeping parent 2'
173 created new head
173 created new head
174 $ hg debugindex --dir dir1 > after
174 $ hg debugindex --dir dir1 > after
175 $ diff before after
175 $ diff before after
176 $ rm before after
176 $ rm before after
177
177
178 Create flat source repo for tests with mixed flat/tree manifests
178 Create flat source repo for tests with mixed flat/tree manifests
179
179
180 $ cd ..
180 $ cd ..
181 $ hg init repo-flat
181 $ hg init repo-flat
182 $ cd repo-flat
182 $ cd repo-flat
183
183
184 Create a few commits with flat manifest
184 Create a few commits with flat manifest
185
185
186 $ echo 0 > a
186 $ echo 0 > a
187 $ echo 0 > b
187 $ echo 0 > b
188 $ echo 0 > e
188 $ echo 0 > e
189 $ for d in dir1 dir1/dir1 dir1/dir2 dir2
189 $ for d in dir1 dir1/dir1 dir1/dir2 dir2
190 > do
190 > do
191 > mkdir $d
191 > mkdir $d
192 > echo 0 > $d/a
192 > echo 0 > $d/a
193 > echo 0 > $d/b
193 > echo 0 > $d/b
194 > done
194 > done
195 $ hg ci -Aqm initial
195 $ hg ci -Aqm initial
196
196
197 $ echo 1 > a
197 $ echo 1 > a
198 $ echo 1 > dir1/a
198 $ echo 1 > dir1/a
199 $ echo 1 > dir1/dir1/a
199 $ echo 1 > dir1/dir1/a
200 $ hg ci -Aqm 'modify on branch 1'
200 $ hg ci -Aqm 'modify on branch 1'
201
201
202 $ hg co 0
202 $ hg co 0
203 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 $ echo 2 > b
204 $ echo 2 > b
205 $ echo 2 > dir1/b
205 $ echo 2 > dir1/b
206 $ echo 2 > dir1/dir1/b
206 $ echo 2 > dir1/dir1/b
207 $ hg ci -Aqm 'modify on branch 2'
207 $ hg ci -Aqm 'modify on branch 2'
208
208
209 $ hg merge 1
209 $ hg merge 1
210 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 (branch merge, don't forget to commit)
211 (branch merge, don't forget to commit)
212 $ hg ci -m 'merge of flat manifests to new flat manifest'
212 $ hg ci -m 'merge of flat manifests to new flat manifest'
213
213
214 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
214 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
215 $ cat hg.pid >> $DAEMON_PIDS
215 $ cat hg.pid >> $DAEMON_PIDS
216
216
217 Create clone with tree manifests enabled
217 Create clone with tree manifests enabled
218
218
219 $ cd ..
219 $ cd ..
220 $ hg clone --config experimental.treemanifest=1 \
220 $ hg clone --config experimental.treemanifest=1 \
221 > http://localhost:$HGPORT repo-mixed -r 1
221 > http://localhost:$HGPORT repo-mixed -r 1
222 adding changesets
222 adding changesets
223 adding manifests
223 adding manifests
224 adding file changes
224 adding file changes
225 added 2 changesets with 14 changes to 11 files
225 added 2 changesets with 14 changes to 11 files
226 new changesets 5b02a3e8db7e:581ef6037d8b
226 new changesets 5b02a3e8db7e:581ef6037d8b
227 updating to branch default
227 updating to branch default
228 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
229 $ cd repo-mixed
229 $ cd repo-mixed
230 $ test -d .hg/store/meta
230 $ test -d .hg/store/meta
231 [1]
231 [1]
232 $ hg debugrequires | grep treemanifest
232 $ hg debugrequires | grep treemanifest
233 treemanifest
233 treemanifest
234
234
235 Should be possible to push updates from flat to tree manifest repo
235 Should be possible to push updates from flat to tree manifest repo
236
236
237 $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed
237 $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed
238 pushing to ssh://user@dummy/repo-mixed
238 pushing to ssh://user@dummy/repo-mixed
239 searching for changes
239 searching for changes
240 remote: adding changesets
240 remote: adding changesets
241 remote: adding manifests
241 remote: adding manifests
242 remote: adding file changes
242 remote: adding file changes
243 remote: added 2 changesets with 3 changes to 3 files
243 remote: added 2 changesets with 3 changes to 3 files
244
244
245 Commit should store revlog per directory
245 Commit should store revlog per directory
246
246
247 $ hg co 1
247 $ hg co 1
248 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
249 $ echo 3 > a
249 $ echo 3 > a
250 $ echo 3 > dir1/a
250 $ echo 3 > dir1/a
251 $ echo 3 > dir1/dir1/a
251 $ echo 3 > dir1/dir1/a
252 $ hg ci -m 'first tree'
252 $ hg ci -m 'first tree'
253 created new head
253 created new head
254 $ find .hg/store/meta | sort
254 $ find .hg/store/meta | sort
255 .hg/store/meta
255 .hg/store/meta
256 .hg/store/meta/dir1
256 .hg/store/meta/dir1
257 .hg/store/meta/dir1/00manifest.i
257 .hg/store/meta/dir1/00manifest.i
258 .hg/store/meta/dir1/dir1
258 .hg/store/meta/dir1/dir1
259 .hg/store/meta/dir1/dir1/00manifest.i
259 .hg/store/meta/dir1/dir1/00manifest.i
260 .hg/store/meta/dir1/dir2
260 .hg/store/meta/dir1/dir2
261 .hg/store/meta/dir1/dir2/00manifest.i
261 .hg/store/meta/dir1/dir2/00manifest.i
262 .hg/store/meta/dir2
262 .hg/store/meta/dir2
263 .hg/store/meta/dir2/00manifest.i
263 .hg/store/meta/dir2/00manifest.i
264
264
265 Merge of two trees
265 Merge of two trees
266
266
267 $ hg co 2
267 $ hg co 2
268 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 $ hg merge 1
269 $ hg merge 1
270 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 (branch merge, don't forget to commit)
271 (branch merge, don't forget to commit)
272 $ hg ci -m 'merge of flat manifests to new tree manifest'
272 $ hg ci -m 'merge of flat manifests to new tree manifest'
273 created new head
273 created new head
274 $ hg diff -r 3
274 $ hg diff -r 3
275
275
276 Parent of tree root manifest should be flat manifest, and two for merge
276 Parent of tree root manifest should be flat manifest, and two for merge
277
277
278 $ hg debugindex -m
278 $ hg debugindex -m
279 rev linkrev nodeid p1-nodeid p2-nodeid
279 rev linkrev nodeid p1-nodeid p2-nodeid
280 0 0 40536115ed9e 000000000000 000000000000
280 0 0 40536115ed9e 000000000000 000000000000
281 1 1 f3376063c255 40536115ed9e 000000000000
281 1 1 f3376063c255 40536115ed9e 000000000000
282 2 2 5d9b9da231a2 40536115ed9e 000000000000
282 2 2 5d9b9da231a2 40536115ed9e 000000000000
283 3 3 d17d663cbd8a 5d9b9da231a2 f3376063c255
283 3 3 d17d663cbd8a 5d9b9da231a2 f3376063c255
284 4 4 51e32a8c60ee f3376063c255 000000000000
284 4 4 51e32a8c60ee f3376063c255 000000000000
285 5 5 cc5baa78b230 5d9b9da231a2 f3376063c255
285 5 5 cc5baa78b230 5d9b9da231a2 f3376063c255
286
286
287
287
288 Status across flat/tree boundary should work
288 Status across flat/tree boundary should work
289
289
290 $ hg status --rev '.^' --rev .
290 $ hg status --rev '.^' --rev .
291 M a
291 M a
292 M dir1/a
292 M dir1/a
293 M dir1/dir1/a
293 M dir1/dir1/a
294
294
295
295
296 Turning off treemanifest config has no effect
296 Turning off treemanifest config has no effect
297
297
298 $ hg debugindex --dir dir1
298 $ hg debugindex --dir dir1
299 rev linkrev nodeid p1-nodeid p2-nodeid
299 rev linkrev nodeid p1-nodeid p2-nodeid
300 0 4 064927a0648a 000000000000 000000000000
300 0 4 064927a0648a 000000000000 000000000000
301 1 5 25ecb8cb8618 000000000000 000000000000
301 1 5 25ecb8cb8618 000000000000 000000000000
302 $ echo 2 > dir1/a
302 $ echo 2 > dir1/a
303 $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a'
303 $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a'
304 $ hg debugindex --dir dir1
304 $ hg debugindex --dir dir1
305 rev linkrev nodeid p1-nodeid p2-nodeid
305 rev linkrev nodeid p1-nodeid p2-nodeid
306 0 4 064927a0648a 000000000000 000000000000
306 0 4 064927a0648a 000000000000 000000000000
307 1 5 25ecb8cb8618 000000000000 000000000000
307 1 5 25ecb8cb8618 000000000000 000000000000
308 2 6 5b16163a30c6 25ecb8cb8618 000000000000
308 2 6 5b16163a30c6 25ecb8cb8618 000000000000
309
309
310 Stripping and recovering changes should work
310 Stripping and recovering changes should work
311
311
312 $ hg st --change tip
312 $ hg st --change tip
313 M dir1/a
313 M dir1/a
314 $ hg --config extensions.strip= strip tip
314 $ hg --config extensions.strip= strip tip
315 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
315 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
316 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg
316 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg
317 $ hg debugindex --dir dir1
317 $ hg debugindex --dir dir1
318 rev linkrev nodeid p1-nodeid p2-nodeid
318 rev linkrev nodeid p1-nodeid p2-nodeid
319 0 4 064927a0648a 000000000000 000000000000
319 0 4 064927a0648a 000000000000 000000000000
320 1 5 25ecb8cb8618 000000000000 000000000000
320 1 5 25ecb8cb8618 000000000000 000000000000
321
321
322 #if repobundlerepo
322 #if repobundlerepo
323 $ hg incoming .hg/strip-backup/*
323 $ hg incoming .hg/strip-backup/*
324 comparing with .hg/strip-backup/*-backup.hg (glob)
324 comparing with .hg/strip-backup/*-backup.hg (glob)
325 searching for changes
325 searching for changes
326 changeset: 6:51cfd7b1e13b
326 changeset: 6:51cfd7b1e13b
327 tag: tip
327 tag: tip
328 user: test
328 user: test
329 date: Thu Jan 01 00:00:00 1970 +0000
329 date: Thu Jan 01 00:00:00 1970 +0000
330 summary: modify dir1/a
330 summary: modify dir1/a
331
331
332 #endif
332 #endif
333
333
334 $ hg unbundle .hg/strip-backup/*
334 $ hg unbundle .hg/strip-backup/*
335 adding changesets
335 adding changesets
336 adding manifests
336 adding manifests
337 adding file changes
337 adding file changes
338 added 1 changesets with 1 changes to 1 files
338 added 1 changesets with 1 changes to 1 files
339 new changesets 51cfd7b1e13b (1 drafts)
339 new changesets 51cfd7b1e13b (1 drafts)
340 (run 'hg update' to get a working copy)
340 (run 'hg update' to get a working copy)
341 $ hg --config extensions.strip= strip tip
341 $ hg --config extensions.strip= strip tip
342 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob)
342 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob)
343 $ hg unbundle -q .hg/strip-backup/*
343 $ hg unbundle -q .hg/strip-backup/*
344 $ hg debugindex --dir dir1
344 $ hg debugindex --dir dir1
345 rev linkrev nodeid p1-nodeid p2-nodeid
345 rev linkrev nodeid p1-nodeid p2-nodeid
346 0 4 064927a0648a 000000000000 000000000000
346 0 4 064927a0648a 000000000000 000000000000
347 1 5 25ecb8cb8618 000000000000 000000000000
347 1 5 25ecb8cb8618 000000000000 000000000000
348 2 6 5b16163a30c6 25ecb8cb8618 000000000000
348 2 6 5b16163a30c6 25ecb8cb8618 000000000000
349 $ hg st --change tip
349 $ hg st --change tip
350 M dir1/a
350 M dir1/a
351
351
352 Shelving and unshelving should work
352 Shelving and unshelving should work
353
353
354 $ echo foo >> dir1/a
354 $ echo foo >> dir1/a
355 $ hg shelve
355 $ hg shelve
356 shelved as default
356 shelved as default
357 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
357 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
358 $ hg unshelve
358 $ hg unshelve
359 unshelving change 'default'
359 unshelving change 'default'
360 $ hg diff --nodates
360 $ hg diff --nodates
361 diff -r 708a273da119 dir1/a
361 diff -r 708a273da119 dir1/a
362 --- a/dir1/a
362 --- a/dir1/a
363 +++ b/dir1/a
363 +++ b/dir1/a
364 @@ -1,1 +1,2 @@
364 @@ -1,1 +1,2 @@
365 1
365 1
366 +foo
366 +foo
367
367
368 Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
368 Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
369
369
370 $ cd ..
370 $ cd ..
371 $ hg init empty-repo
371 $ hg init empty-repo
372 $ cat << EOF >> empty-repo/.hg/hgrc
372 $ cat << EOF >> empty-repo/.hg/hgrc
373 > [experimental]
373 > [experimental]
374 > changegroup3=yes
374 > changegroup3=yes
375 > EOF
375 > EOF
376 $ hg debugrequires -R empty-repo | grep treemanifest
376 $ hg debugrequires -R empty-repo | grep treemanifest
377 [1]
377 [1]
378 $ hg push -R repo -r 0 empty-repo
378 $ hg push -R repo -r 0 empty-repo
379 pushing to empty-repo
379 pushing to empty-repo
380 searching for changes
380 searching for changes
381 adding changesets
381 adding changesets
382 adding manifests
382 adding manifests
383 adding file changes
383 adding file changes
384 added 1 changesets with 2 changes to 2 files
384 added 1 changesets with 2 changes to 2 files
385 $ hg debugrequires -R empty-repo | grep treemanifest
385 $ hg debugrequires -R empty-repo | grep treemanifest
386 treemanifest
386 treemanifest
387
387
388 Pushing to an empty repo works
388 Pushing to an empty repo works
389
389
390 $ hg --config experimental.treemanifest=1 init clone
390 $ hg --config experimental.treemanifest=1 init clone
391 $ hg debugrequires -R clone | grep treemanifest
391 $ hg debugrequires -R clone | grep treemanifest
392 treemanifest
392 treemanifest
393 $ hg push -R repo clone
393 $ hg push -R repo clone
394 pushing to clone
394 pushing to clone
395 searching for changes
395 searching for changes
396 adding changesets
396 adding changesets
397 adding manifests
397 adding manifests
398 adding file changes
398 adding file changes
399 added 11 changesets with 15 changes to 10 files (+3 heads)
399 added 11 changesets with 15 changes to 10 files (+3 heads)
400 $ hg debugrequires -R clone | grep treemanifest
400 $ hg debugrequires -R clone | grep treemanifest
401 treemanifest
401 treemanifest
402 $ hg -R clone verify
402 $ hg -R clone verify -q
403 checking changesets
404 checking manifests
405 checking directory manifests
406 crosschecking files in changesets and manifests
407 checking files
408 checked 11 changesets with 15 changes to 10 files
409
403
410 Create deeper repo with tree manifests.
404 Create deeper repo with tree manifests.
411
405
412 $ hg --config experimental.treemanifest=True init deeprepo
406 $ hg --config experimental.treemanifest=True init deeprepo
413 $ cd deeprepo
407 $ cd deeprepo
414
408
415 $ mkdir .A
409 $ mkdir .A
416 $ mkdir b
410 $ mkdir b
417 $ mkdir b/bar
411 $ mkdir b/bar
418 $ mkdir b/bar/orange
412 $ mkdir b/bar/orange
419 $ mkdir b/bar/orange/fly
413 $ mkdir b/bar/orange/fly
420 $ mkdir b/foo
414 $ mkdir b/foo
421 $ mkdir b/foo/apple
415 $ mkdir b/foo/apple
422 $ mkdir b/foo/apple/bees
416 $ mkdir b/foo/apple/bees
423
417
424 $ touch .A/one.txt
418 $ touch .A/one.txt
425 $ touch .A/two.txt
419 $ touch .A/two.txt
426 $ touch b/bar/fruits.txt
420 $ touch b/bar/fruits.txt
427 $ touch b/bar/orange/fly/gnat.py
421 $ touch b/bar/orange/fly/gnat.py
428 $ touch b/bar/orange/fly/housefly.txt
422 $ touch b/bar/orange/fly/housefly.txt
429 $ touch b/foo/apple/bees/flower.py
423 $ touch b/foo/apple/bees/flower.py
430 $ touch c.txt
424 $ touch c.txt
431 $ touch d.py
425 $ touch d.py
432
426
433 $ hg ci -Aqm 'initial'
427 $ hg ci -Aqm 'initial'
434
428
435 $ echo >> .A/one.txt
429 $ echo >> .A/one.txt
436 $ echo >> .A/two.txt
430 $ echo >> .A/two.txt
437 $ echo >> b/bar/fruits.txt
431 $ echo >> b/bar/fruits.txt
438 $ echo >> b/bar/orange/fly/gnat.py
432 $ echo >> b/bar/orange/fly/gnat.py
439 $ echo >> b/bar/orange/fly/housefly.txt
433 $ echo >> b/bar/orange/fly/housefly.txt
440 $ echo >> b/foo/apple/bees/flower.py
434 $ echo >> b/foo/apple/bees/flower.py
441 $ echo >> c.txt
435 $ echo >> c.txt
442 $ echo >> d.py
436 $ echo >> d.py
443 $ hg ci -Aqm 'second'
437 $ hg ci -Aqm 'second'
444
438
445 We'll see that visitdir works by removing some treemanifest revlogs and running
439 We'll see that visitdir works by removing some treemanifest revlogs and running
446 the files command with various parameters.
440 the files command with various parameters.
447
441
448 Test files from the root.
442 Test files from the root.
449
443
450 $ hg files -r .
444 $ hg files -r .
451 .A/one.txt
445 .A/one.txt
452 .A/two.txt
446 .A/two.txt
453 b/bar/fruits.txt
447 b/bar/fruits.txt
454 b/bar/orange/fly/gnat.py
448 b/bar/orange/fly/gnat.py
455 b/bar/orange/fly/housefly.txt
449 b/bar/orange/fly/housefly.txt
456 b/foo/apple/bees/flower.py
450 b/foo/apple/bees/flower.py
457 c.txt
451 c.txt
458 d.py
452 d.py
459
453
460 Excludes with a glob should not exclude everything from the glob's root
454 Excludes with a glob should not exclude everything from the glob's root
461
455
462 $ hg files -r . -X 'b/fo?' b
456 $ hg files -r . -X 'b/fo?' b
463 b/bar/fruits.txt
457 b/bar/fruits.txt
464 b/bar/orange/fly/gnat.py
458 b/bar/orange/fly/gnat.py
465 b/bar/orange/fly/housefly.txt
459 b/bar/orange/fly/housefly.txt
466 $ cp -R .hg/store .hg/store-copy
460 $ cp -R .hg/store .hg/store-copy
467
461
468 Test files for a subdirectory.
462 Test files for a subdirectory.
469
463
470 #if reporevlogstore
464 #if reporevlogstore
471 $ rm -r .hg/store/meta/~2e_a
465 $ rm -r .hg/store/meta/~2e_a
472 #endif
466 #endif
473 #if reposimplestore
467 #if reposimplestore
474 $ rm -r .hg/store/meta/._a
468 $ rm -r .hg/store/meta/._a
475 #endif
469 #endif
476 $ hg files -r . b
470 $ hg files -r . b
477 b/bar/fruits.txt
471 b/bar/fruits.txt
478 b/bar/orange/fly/gnat.py
472 b/bar/orange/fly/gnat.py
479 b/bar/orange/fly/housefly.txt
473 b/bar/orange/fly/housefly.txt
480 b/foo/apple/bees/flower.py
474 b/foo/apple/bees/flower.py
481 $ hg diff -r '.^' -r . --stat b
475 $ hg diff -r '.^' -r . --stat b
482 b/bar/fruits.txt | 1 +
476 b/bar/fruits.txt | 1 +
483 b/bar/orange/fly/gnat.py | 1 +
477 b/bar/orange/fly/gnat.py | 1 +
484 b/bar/orange/fly/housefly.txt | 1 +
478 b/bar/orange/fly/housefly.txt | 1 +
485 b/foo/apple/bees/flower.py | 1 +
479 b/foo/apple/bees/flower.py | 1 +
486 4 files changed, 4 insertions(+), 0 deletions(-)
480 4 files changed, 4 insertions(+), 0 deletions(-)
487 $ cp -R .hg/store-copy/. .hg/store
481 $ cp -R .hg/store-copy/. .hg/store
488
482
489 Test files with just includes and excludes.
483 Test files with just includes and excludes.
490
484
491 #if reporevlogstore
485 #if reporevlogstore
492 $ rm -r .hg/store/meta/~2e_a
486 $ rm -r .hg/store/meta/~2e_a
493 #endif
487 #endif
494 #if reposimplestore
488 #if reposimplestore
495 $ rm -r .hg/store/meta/._a
489 $ rm -r .hg/store/meta/._a
496 #endif
490 #endif
497 $ rm -r .hg/store/meta/b/bar/orange/fly
491 $ rm -r .hg/store/meta/b/bar/orange/fly
498 $ rm -r .hg/store/meta/b/foo/apple/bees
492 $ rm -r .hg/store/meta/b/foo/apple/bees
499 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
493 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
500 b/bar/fruits.txt
494 b/bar/fruits.txt
501 $ hg diff -r '.^' -r . --stat -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
495 $ hg diff -r '.^' -r . --stat -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
502 b/bar/fruits.txt | 1 +
496 b/bar/fruits.txt | 1 +
503 1 files changed, 1 insertions(+), 0 deletions(-)
497 1 files changed, 1 insertions(+), 0 deletions(-)
504 $ cp -R .hg/store-copy/. .hg/store
498 $ cp -R .hg/store-copy/. .hg/store
505
499
506 Test files for a subdirectory, excluding a directory within it.
500 Test files for a subdirectory, excluding a directory within it.
507
501
508 #if reporevlogstore
502 #if reporevlogstore
509 $ rm -r .hg/store/meta/~2e_a
503 $ rm -r .hg/store/meta/~2e_a
510 #endif
504 #endif
511 #if reposimplestore
505 #if reposimplestore
512 $ rm -r .hg/store/meta/._a
506 $ rm -r .hg/store/meta/._a
513 #endif
507 #endif
514 $ rm -r .hg/store/meta/b/foo
508 $ rm -r .hg/store/meta/b/foo
515 $ hg files -r . -X path:b/foo b
509 $ hg files -r . -X path:b/foo b
516 b/bar/fruits.txt
510 b/bar/fruits.txt
517 b/bar/orange/fly/gnat.py
511 b/bar/orange/fly/gnat.py
518 b/bar/orange/fly/housefly.txt
512 b/bar/orange/fly/housefly.txt
519 $ hg diff -r '.^' -r . --stat -X path:b/foo b
513 $ hg diff -r '.^' -r . --stat -X path:b/foo b
520 b/bar/fruits.txt | 1 +
514 b/bar/fruits.txt | 1 +
521 b/bar/orange/fly/gnat.py | 1 +
515 b/bar/orange/fly/gnat.py | 1 +
522 b/bar/orange/fly/housefly.txt | 1 +
516 b/bar/orange/fly/housefly.txt | 1 +
523 3 files changed, 3 insertions(+), 0 deletions(-)
517 3 files changed, 3 insertions(+), 0 deletions(-)
524 $ cp -R .hg/store-copy/. .hg/store
518 $ cp -R .hg/store-copy/. .hg/store
525
519
526 Test files for a sub directory, including only a directory within it, and
520 Test files for a sub directory, including only a directory within it, and
527 including an unrelated directory.
521 including an unrelated directory.
528
522
529 #if reporevlogstore
523 #if reporevlogstore
530 $ rm -r .hg/store/meta/~2e_a
524 $ rm -r .hg/store/meta/~2e_a
531 #endif
525 #endif
532 #if reposimplestore
526 #if reposimplestore
533 $ rm -r .hg/store/meta/._a
527 $ rm -r .hg/store/meta/._a
534 #endif
528 #endif
535 $ rm -r .hg/store/meta/b/foo
529 $ rm -r .hg/store/meta/b/foo
536 $ hg files -r . -I path:b/bar/orange -I path:a b
530 $ hg files -r . -I path:b/bar/orange -I path:a b
537 b/bar/orange/fly/gnat.py
531 b/bar/orange/fly/gnat.py
538 b/bar/orange/fly/housefly.txt
532 b/bar/orange/fly/housefly.txt
539 $ hg diff -r '.^' -r . --stat -I path:b/bar/orange -I path:a b
533 $ hg diff -r '.^' -r . --stat -I path:b/bar/orange -I path:a b
540 b/bar/orange/fly/gnat.py | 1 +
534 b/bar/orange/fly/gnat.py | 1 +
541 b/bar/orange/fly/housefly.txt | 1 +
535 b/bar/orange/fly/housefly.txt | 1 +
542 2 files changed, 2 insertions(+), 0 deletions(-)
536 2 files changed, 2 insertions(+), 0 deletions(-)
543 $ cp -R .hg/store-copy/. .hg/store
537 $ cp -R .hg/store-copy/. .hg/store
544
538
545 Test files for a pattern, including a directory, and excluding a directory
539 Test files for a pattern, including a directory, and excluding a directory
546 within that.
540 within that.
547
541
548 #if reporevlogstore
542 #if reporevlogstore
549 $ rm -r .hg/store/meta/~2e_a
543 $ rm -r .hg/store/meta/~2e_a
550 #endif
544 #endif
551 #if reposimplestore
545 #if reposimplestore
552 $ rm -r .hg/store/meta/._a
546 $ rm -r .hg/store/meta/._a
553 #endif
547 #endif
554 $ rm -r .hg/store/meta/b/foo
548 $ rm -r .hg/store/meta/b/foo
555 $ rm -r .hg/store/meta/b/bar/orange
549 $ rm -r .hg/store/meta/b/bar/orange
556 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
550 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
557 b/bar/fruits.txt
551 b/bar/fruits.txt
558 $ hg diff -r '.^' -r . --stat glob:**.txt -I path:b/bar -X path:b/bar/orange
552 $ hg diff -r '.^' -r . --stat glob:**.txt -I path:b/bar -X path:b/bar/orange
559 b/bar/fruits.txt | 1 +
553 b/bar/fruits.txt | 1 +
560 1 files changed, 1 insertions(+), 0 deletions(-)
554 1 files changed, 1 insertions(+), 0 deletions(-)
561 $ cp -R .hg/store-copy/. .hg/store
555 $ cp -R .hg/store-copy/. .hg/store
562
556
563 Add some more changes to the deep repo
557 Add some more changes to the deep repo
564 $ echo narf >> b/bar/fruits.txt
558 $ echo narf >> b/bar/fruits.txt
565 $ hg ci -m narf
559 $ hg ci -m narf
566 $ echo troz >> b/bar/orange/fly/gnat.py
560 $ echo troz >> b/bar/orange/fly/gnat.py
567 $ hg ci -m troz
561 $ hg ci -m troz
568
562
569 Verify works
563 Verify works
570 $ hg verify
564 $ hg verify -q
571 checking changesets
572 checking manifests
573 checking directory manifests
574 crosschecking files in changesets and manifests
575 checking files
576 checked 4 changesets with 18 changes to 8 files
577
565
578 #if repofncache
566 #if repofncache
579 Dirlogs are included in fncache
567 Dirlogs are included in fncache
580 $ grep meta/.A/00manifest.i .hg/store/fncache
568 $ grep meta/.A/00manifest.i .hg/store/fncache
581 meta/.A/00manifest.i
569 meta/.A/00manifest.i
582
570
583 Rebuilt fncache includes dirlogs
571 Rebuilt fncache includes dirlogs
584 $ rm .hg/store/fncache
572 $ rm .hg/store/fncache
585 $ hg debugrebuildfncache
573 $ hg debugrebuildfncache
586 adding data/.A/one.txt.i
574 adding data/.A/one.txt.i
587 adding data/.A/two.txt.i
575 adding data/.A/two.txt.i
588 adding data/b/bar/fruits.txt.i
576 adding data/b/bar/fruits.txt.i
589 adding data/b/bar/orange/fly/gnat.py.i
577 adding data/b/bar/orange/fly/gnat.py.i
590 adding data/b/bar/orange/fly/housefly.txt.i
578 adding data/b/bar/orange/fly/housefly.txt.i
591 adding data/b/foo/apple/bees/flower.py.i
579 adding data/b/foo/apple/bees/flower.py.i
592 adding data/c.txt.i
580 adding data/c.txt.i
593 adding data/d.py.i
581 adding data/d.py.i
594 adding meta/.A/00manifest.i
582 adding meta/.A/00manifest.i
595 adding meta/b/00manifest.i
583 adding meta/b/00manifest.i
596 adding meta/b/bar/00manifest.i
584 adding meta/b/bar/00manifest.i
597 adding meta/b/bar/orange/00manifest.i
585 adding meta/b/bar/orange/00manifest.i
598 adding meta/b/bar/orange/fly/00manifest.i
586 adding meta/b/bar/orange/fly/00manifest.i
599 adding meta/b/foo/00manifest.i
587 adding meta/b/foo/00manifest.i
600 adding meta/b/foo/apple/00manifest.i
588 adding meta/b/foo/apple/00manifest.i
601 adding meta/b/foo/apple/bees/00manifest.i
589 adding meta/b/foo/apple/bees/00manifest.i
602 16 items added, 0 removed from fncache
590 16 items added, 0 removed from fncache
603 #endif
591 #endif
604
592
605 Finish first server
593 Finish first server
606 $ killdaemons.py
594 $ killdaemons.py
607
595
608 Back up the recently added revlogs
596 Back up the recently added revlogs
609 $ cp -R .hg/store .hg/store-newcopy
597 $ cp -R .hg/store .hg/store-newcopy
610
598
611 Verify reports missing dirlog
599 Verify reports missing dirlog
612 $ rm .hg/store/meta/b/00manifest.*
600 $ rm .hg/store/meta/b/00manifest.*
613 $ hg verify
601 $ hg verify
614 checking changesets
602 checking changesets
615 checking manifests
603 checking manifests
616 checking directory manifests
604 checking directory manifests
617 0: empty or missing b/
605 0: empty or missing b/
618 b/@0: parent-directory manifest refers to unknown revision 67688a370455
606 b/@0: parent-directory manifest refers to unknown revision 67688a370455
619 b/@1: parent-directory manifest refers to unknown revision f065da70369e
607 b/@1: parent-directory manifest refers to unknown revision f065da70369e
620 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
608 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
621 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
609 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
622 warning: orphan data file 'meta/b/bar/00manifest.i' (reporevlogstore !)
610 warning: orphan data file 'meta/b/bar/00manifest.i' (reporevlogstore !)
623 warning: orphan data file 'meta/b/bar/orange/00manifest.i' (reporevlogstore !)
611 warning: orphan data file 'meta/b/bar/orange/00manifest.i' (reporevlogstore !)
624 warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i' (reporevlogstore !)
612 warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i' (reporevlogstore !)
625 warning: orphan data file 'meta/b/foo/00manifest.i' (reporevlogstore !)
613 warning: orphan data file 'meta/b/foo/00manifest.i' (reporevlogstore !)
626 warning: orphan data file 'meta/b/foo/apple/00manifest.i' (reporevlogstore !)
614 warning: orphan data file 'meta/b/foo/apple/00manifest.i' (reporevlogstore !)
627 warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i' (reporevlogstore !)
615 warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i' (reporevlogstore !)
628 crosschecking files in changesets and manifests
616 crosschecking files in changesets and manifests
629 b/bar/fruits.txt@0: in changeset but not in manifest
617 b/bar/fruits.txt@0: in changeset but not in manifest
630 b/bar/orange/fly/gnat.py@0: in changeset but not in manifest
618 b/bar/orange/fly/gnat.py@0: in changeset but not in manifest
631 b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest
619 b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest
632 b/foo/apple/bees/flower.py@0: in changeset but not in manifest
620 b/foo/apple/bees/flower.py@0: in changeset but not in manifest
633 checking files
621 checking files
634 checked 4 changesets with 18 changes to 8 files
622 checked 4 changesets with 18 changes to 8 files
635 6 warnings encountered! (reporevlogstore !)
623 6 warnings encountered! (reporevlogstore !)
636 9 integrity errors encountered!
624 9 integrity errors encountered!
637 (first damaged changeset appears to be 0)
625 (first damaged changeset appears to be 0)
638 [1]
626 [1]
639 $ cp -R .hg/store-newcopy/. .hg/store
627 $ cp -R .hg/store-newcopy/. .hg/store
640
628
641 Verify reports missing dirlog entry
629 Verify reports missing dirlog entry
642 $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
630 $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
643 $ hg verify
631 $ hg verify
644 checking changesets
632 checking changesets
645 checking manifests
633 checking manifests
646 checking directory manifests
634 checking directory manifests
647 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
635 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
648 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
636 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
649 b/bar/@?: rev 2 points to unexpected changeset 2
637 b/bar/@?: rev 2 points to unexpected changeset 2
650 b/bar/@?: 44d7e1146e0d not in parent-directory manifest
638 b/bar/@?: 44d7e1146e0d not in parent-directory manifest
651 b/bar/@?: rev 3 points to unexpected changeset 3
639 b/bar/@?: rev 3 points to unexpected changeset 3
652 b/bar/@?: 70b10c6b17b7 not in parent-directory manifest
640 b/bar/@?: 70b10c6b17b7 not in parent-directory manifest
653 b/bar/orange/@?: rev 2 points to unexpected changeset 3
641 b/bar/orange/@?: rev 2 points to unexpected changeset 3
654 (expected None)
642 (expected None)
655 b/bar/orange/fly/@?: rev 2 points to unexpected changeset 3
643 b/bar/orange/fly/@?: rev 2 points to unexpected changeset 3
656 (expected None)
644 (expected None)
657 crosschecking files in changesets and manifests
645 crosschecking files in changesets and manifests
658 checking files
646 checking files
659 checked 4 changesets with 18 changes to 8 files
647 checked 4 changesets with 18 changes to 8 files
660 2 warnings encountered!
648 2 warnings encountered!
661 8 integrity errors encountered!
649 8 integrity errors encountered!
662 (first damaged changeset appears to be 2)
650 (first damaged changeset appears to be 2)
663 [1]
651 [1]
664 $ cp -R .hg/store-newcopy/. .hg/store
652 $ cp -R .hg/store-newcopy/. .hg/store
665
653
666 Test cloning a treemanifest repo over http.
654 Test cloning a treemanifest repo over http.
667 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
655 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
668 $ cat hg.pid >> $DAEMON_PIDS
656 $ cat hg.pid >> $DAEMON_PIDS
669 $ cd ..
657 $ cd ..
670 We can clone even with the knob turned off and we'll get a treemanifest repo.
658 We can clone even with the knob turned off and we'll get a treemanifest repo.
671 $ hg clone --config experimental.treemanifest=False \
659 $ hg clone --config experimental.treemanifest=False \
672 > --config experimental.changegroup3=True \
660 > --config experimental.changegroup3=True \
673 > http://localhost:$HGPORT deepclone
661 > http://localhost:$HGPORT deepclone
674 requesting all changes
662 requesting all changes
675 adding changesets
663 adding changesets
676 adding manifests
664 adding manifests
677 adding file changes
665 adding file changes
678 added 4 changesets with 18 changes to 8 files
666 added 4 changesets with 18 changes to 8 files
679 new changesets 775704be6f52:523e5c631710
667 new changesets 775704be6f52:523e5c631710
680 updating to branch default
668 updating to branch default
681 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
669 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
682 No server errors.
670 No server errors.
683 $ cat deeprepo/errors.log
671 $ cat deeprepo/errors.log
684 requires got updated to include treemanifest
672 requires got updated to include treemanifest
685 $ hg debugrequires -R deepclone | grep treemanifest
673 $ hg debugrequires -R deepclone | grep treemanifest
686 treemanifest
674 treemanifest
687 Tree manifest revlogs exist.
675 Tree manifest revlogs exist.
688 $ find deepclone/.hg/store/meta | sort
676 $ find deepclone/.hg/store/meta | sort
689 deepclone/.hg/store/meta
677 deepclone/.hg/store/meta
690 deepclone/.hg/store/meta/._a (reposimplestore !)
678 deepclone/.hg/store/meta/._a (reposimplestore !)
691 deepclone/.hg/store/meta/._a/00manifest.i (reposimplestore !)
679 deepclone/.hg/store/meta/._a/00manifest.i (reposimplestore !)
692 deepclone/.hg/store/meta/b
680 deepclone/.hg/store/meta/b
693 deepclone/.hg/store/meta/b/00manifest.i
681 deepclone/.hg/store/meta/b/00manifest.i
694 deepclone/.hg/store/meta/b/bar
682 deepclone/.hg/store/meta/b/bar
695 deepclone/.hg/store/meta/b/bar/00manifest.i
683 deepclone/.hg/store/meta/b/bar/00manifest.i
696 deepclone/.hg/store/meta/b/bar/orange
684 deepclone/.hg/store/meta/b/bar/orange
697 deepclone/.hg/store/meta/b/bar/orange/00manifest.i
685 deepclone/.hg/store/meta/b/bar/orange/00manifest.i
698 deepclone/.hg/store/meta/b/bar/orange/fly
686 deepclone/.hg/store/meta/b/bar/orange/fly
699 deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i
687 deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i
700 deepclone/.hg/store/meta/b/foo
688 deepclone/.hg/store/meta/b/foo
701 deepclone/.hg/store/meta/b/foo/00manifest.i
689 deepclone/.hg/store/meta/b/foo/00manifest.i
702 deepclone/.hg/store/meta/b/foo/apple
690 deepclone/.hg/store/meta/b/foo/apple
703 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
691 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
704 deepclone/.hg/store/meta/b/foo/apple/bees
692 deepclone/.hg/store/meta/b/foo/apple/bees
705 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
693 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
706 deepclone/.hg/store/meta/~2e_a (reporevlogstore !)
694 deepclone/.hg/store/meta/~2e_a (reporevlogstore !)
707 deepclone/.hg/store/meta/~2e_a/00manifest.i (reporevlogstore !)
695 deepclone/.hg/store/meta/~2e_a/00manifest.i (reporevlogstore !)
708 Verify passes.
696 Verify passes.
709 $ cd deepclone
697 $ cd deepclone
710 $ hg verify
698 $ hg verify -q
711 checking changesets
712 checking manifests
713 checking directory manifests
714 crosschecking files in changesets and manifests
715 checking files
716 checked 4 changesets with 18 changes to 8 files
717 $ cd ..
699 $ cd ..
718
700
719 #if reporevlogstore
701 #if reporevlogstore
720 Create clones using old repo formats to use in later tests
702 Create clones using old repo formats to use in later tests
721 $ hg clone --config format.usestore=False \
703 $ hg clone --config format.usestore=False \
722 > --config experimental.changegroup3=True \
704 > --config experimental.changegroup3=True \
723 > http://localhost:$HGPORT deeprepo-basicstore
705 > http://localhost:$HGPORT deeprepo-basicstore
724 requesting all changes
706 requesting all changes
725 adding changesets
707 adding changesets
726 adding manifests
708 adding manifests
727 adding file changes
709 adding file changes
728 added 4 changesets with 18 changes to 8 files
710 added 4 changesets with 18 changes to 8 files
729 new changesets 775704be6f52:523e5c631710
711 new changesets 775704be6f52:523e5c631710
730 updating to branch default
712 updating to branch default
731 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
713 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
732 $ cd deeprepo-basicstore
714 $ cd deeprepo-basicstore
733 $ hg debugrequires | grep store
715 $ hg debugrequires | grep store
734 [1]
716 [1]
735 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log
717 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log
736 $ cat hg.pid >> $DAEMON_PIDS
718 $ cat hg.pid >> $DAEMON_PIDS
737 $ cd ..
719 $ cd ..
738 $ hg clone --config format.usefncache=False \
720 $ hg clone --config format.usefncache=False \
739 > --config experimental.changegroup3=True \
721 > --config experimental.changegroup3=True \
740 > http://localhost:$HGPORT deeprepo-encodedstore
722 > http://localhost:$HGPORT deeprepo-encodedstore
741 requesting all changes
723 requesting all changes
742 adding changesets
724 adding changesets
743 adding manifests
725 adding manifests
744 adding file changes
726 adding file changes
745 added 4 changesets with 18 changes to 8 files
727 added 4 changesets with 18 changes to 8 files
746 new changesets 775704be6f52:523e5c631710
728 new changesets 775704be6f52:523e5c631710
747 updating to branch default
729 updating to branch default
748 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
730 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
749 $ cd deeprepo-encodedstore
731 $ cd deeprepo-encodedstore
750 $ hg debugrequires | grep fncache
732 $ hg debugrequires | grep fncache
751 [1]
733 [1]
752 $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log
734 $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log
753 $ cat hg.pid >> $DAEMON_PIDS
735 $ cat hg.pid >> $DAEMON_PIDS
754 $ cd ..
736 $ cd ..
755
737
756 Local clone with basicstore
738 Local clone with basicstore
757 $ hg clone -U deeprepo-basicstore local-clone-basicstore
739 $ hg clone -U deeprepo-basicstore local-clone-basicstore
758 $ hg -R local-clone-basicstore verify
740 $ hg -R local-clone-basicstore verify -q
759 checking changesets
760 checking manifests
761 checking directory manifests
762 crosschecking files in changesets and manifests
763 checking files
764 checked 4 changesets with 18 changes to 8 files
765
741
766 Local clone with encodedstore
742 Local clone with encodedstore
767 $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
743 $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
768 $ hg -R local-clone-encodedstore verify
744 $ hg -R local-clone-encodedstore verify -q
769 checking changesets
770 checking manifests
771 checking directory manifests
772 crosschecking files in changesets and manifests
773 checking files
774 checked 4 changesets with 18 changes to 8 files
775
745
776 Local clone with fncachestore
746 Local clone with fncachestore
777 $ hg clone -U deeprepo local-clone-fncachestore
747 $ hg clone -U deeprepo local-clone-fncachestore
778 $ hg -R local-clone-fncachestore verify
748 $ hg -R local-clone-fncachestore verify -q
779 checking changesets
780 checking manifests
781 checking directory manifests
782 crosschecking files in changesets and manifests
783 checking files
784 checked 4 changesets with 18 changes to 8 files
785
749
786 Stream clone with basicstore
750 Stream clone with basicstore
787 $ hg clone --config experimental.changegroup3=True --stream -U \
751 $ hg clone --config experimental.changegroup3=True --stream -U \
788 > http://localhost:$HGPORT1 stream-clone-basicstore
752 > http://localhost:$HGPORT1 stream-clone-basicstore
789 streaming all changes
753 streaming all changes
790 28 files to transfer, * of data (glob)
754 28 files to transfer, * of data (glob)
791 transferred * in * seconds (*) (glob)
755 transferred * in * seconds (*) (glob)
792 $ hg -R stream-clone-basicstore verify
756 $ hg -R stream-clone-basicstore verify -q
793 checking changesets
794 checking manifests
795 checking directory manifests
796 crosschecking files in changesets and manifests
797 checking files
798 checked 4 changesets with 18 changes to 8 files
799
757
800 Stream clone with encodedstore
758 Stream clone with encodedstore
801 $ hg clone --config experimental.changegroup3=True --stream -U \
759 $ hg clone --config experimental.changegroup3=True --stream -U \
802 > http://localhost:$HGPORT2 stream-clone-encodedstore
760 > http://localhost:$HGPORT2 stream-clone-encodedstore
803 streaming all changes
761 streaming all changes
804 28 files to transfer, * of data (glob)
762 28 files to transfer, * of data (glob)
805 transferred * in * seconds (*) (glob)
763 transferred * in * seconds (*) (glob)
806 $ hg -R stream-clone-encodedstore verify
764 $ hg -R stream-clone-encodedstore verify -q
807 checking changesets
808 checking manifests
809 checking directory manifests
810 crosschecking files in changesets and manifests
811 checking files
812 checked 4 changesets with 18 changes to 8 files
813
765
814 Stream clone with fncachestore
766 Stream clone with fncachestore
815 $ hg clone --config experimental.changegroup3=True --stream -U \
767 $ hg clone --config experimental.changegroup3=True --stream -U \
816 > http://localhost:$HGPORT stream-clone-fncachestore
768 > http://localhost:$HGPORT stream-clone-fncachestore
817 streaming all changes
769 streaming all changes
818 22 files to transfer, * of data (glob)
770 22 files to transfer, * of data (glob)
819 transferred * in * seconds (*) (glob)
771 transferred * in * seconds (*) (glob)
820 $ hg -R stream-clone-fncachestore verify
772 $ hg -R stream-clone-fncachestore verify -q
821 checking changesets
822 checking manifests
823 checking directory manifests
824 crosschecking files in changesets and manifests
825 checking files
826 checked 4 changesets with 18 changes to 8 files
827
773
828 Packed bundle
774 Packed bundle
829 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
775 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
830 writing 5330 bytes for 18 files (no-zstd !)
776 writing 5330 bytes for 18 files (no-zstd !)
831 writing 5400 bytes for 18 files (zstd !)
777 writing 5400 bytes for 18 files (zstd !)
832 bundle requirements:.* treemanifest(,.*)? (re)
778 bundle requirements:.* treemanifest(,.*)? (re)
833 $ hg debugbundle --spec repo-packed.hg
779 $ hg debugbundle --spec repo-packed.hg
834 none-packed1;requirements%3D(.*%2C)?treemanifest(%2C.*)? (re)
780 none-packed1;requirements%3D(.*%2C)?treemanifest(%2C.*)? (re)
835
781
836 #endif
782 #endif
837
783
838 Bundle with changegroup2 is not supported
784 Bundle with changegroup2 is not supported
839
785
840 $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle
786 $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle
841 abort: repository does not support bundle version 02
787 abort: repository does not support bundle version 02
842 [255]
788 [255]
843
789
844 Pull does not include changegroup for manifest the client already has from
790 Pull does not include changegroup for manifest the client already has from
845 other branch
791 other branch
846
792
847 $ mkdir grafted-dir-repo
793 $ mkdir grafted-dir-repo
848 $ cd grafted-dir-repo
794 $ cd grafted-dir-repo
849 $ hg --config experimental.treemanifest=1 init
795 $ hg --config experimental.treemanifest=1 init
850 $ mkdir dir
796 $ mkdir dir
851 $ echo a > dir/file
797 $ echo a > dir/file
852 $ echo a > file
798 $ echo a > file
853 $ hg ci -Am initial
799 $ hg ci -Am initial
854 adding dir/file
800 adding dir/file
855 adding file
801 adding file
856 $ echo b > dir/file
802 $ echo b > dir/file
857 $ hg ci -m updated
803 $ hg ci -m updated
858 $ hg co '.^'
804 $ hg co '.^'
859 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
805 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
860 $ hg revert -r tip dir/
806 $ hg revert -r tip dir/
861 reverting dir/file
807 reverting dir/file
862 $ echo b > file # to make sure root manifest is sent
808 $ echo b > file # to make sure root manifest is sent
863 $ hg ci -m grafted
809 $ hg ci -m grafted
864 created new head
810 created new head
865 $ cd ..
811 $ cd ..
866
812
867 $ hg --config experimental.treemanifest=1 clone --pull -r 1 \
813 $ hg --config experimental.treemanifest=1 clone --pull -r 1 \
868 > grafted-dir-repo grafted-dir-repo-clone
814 > grafted-dir-repo grafted-dir-repo-clone
869 adding changesets
815 adding changesets
870 adding manifests
816 adding manifests
871 adding file changes
817 adding file changes
872 added 2 changesets with 3 changes to 2 files
818 added 2 changesets with 3 changes to 2 files
873 new changesets d84f4c419457:09ab742f3b0f
819 new changesets d84f4c419457:09ab742f3b0f
874 updating to branch default
820 updating to branch default
875 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
821 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
876 $ cd grafted-dir-repo-clone
822 $ cd grafted-dir-repo-clone
877 $ hg pull -r 2
823 $ hg pull -r 2
878 pulling from $TESTTMP/grafted-dir-repo
824 pulling from $TESTTMP/grafted-dir-repo
879 searching for changes
825 searching for changes
880 adding changesets
826 adding changesets
881 adding manifests
827 adding manifests
882 adding file changes
828 adding file changes
883 added 1 changesets with 1 changes to 1 files (+1 heads)
829 added 1 changesets with 1 changes to 1 files (+1 heads)
884 new changesets 73699489fb7c
830 new changesets 73699489fb7c
885 (run 'hg heads' to see heads, 'hg merge' to merge)
831 (run 'hg heads' to see heads, 'hg merge' to merge)
886
832
887 Committing a empty commit does not duplicate root treemanifest
833 Committing a empty commit does not duplicate root treemanifest
888 $ echo z >> z
834 $ echo z >> z
889 $ hg commit -Aqm 'pre-empty commit'
835 $ hg commit -Aqm 'pre-empty commit'
890 $ hg rm z
836 $ hg rm z
891 $ hg commit --amend -m 'empty commit'
837 $ hg commit --amend -m 'empty commit'
892 saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-9e3b6b02-amend.hg
838 saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-9e3b6b02-amend.hg
893 $ hg log -r 'tip + tip^' -T '{manifest}\n'
839 $ hg log -r 'tip + tip^' -T '{manifest}\n'
894 1:678d3574b88c
840 1:678d3574b88c
895 1:678d3574b88c
841 1:678d3574b88c
896 $ hg --config extensions.strip= strip -r . -q
842 $ hg --config extensions.strip= strip -r . -q
@@ -1,462 +1,456
1 Test for command `hg unamend` which lives in uncommit extension
1 Test for command `hg unamend` which lives in uncommit extension
2 ===============================================================
2 ===============================================================
3
3
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [alias]
5 > [alias]
6 > glog = log -G -T '{rev}:{node|short} {desc}'
6 > glog = log -G -T '{rev}:{node|short} {desc}'
7 > [experimental]
7 > [experimental]
8 > evolution = createmarkers, allowunstable
8 > evolution = createmarkers, allowunstable
9 > evolution.allowdivergence = true
9 > evolution.allowdivergence = true
10 > [extensions]
10 > [extensions]
11 > rebase =
11 > rebase =
12 > amend =
12 > amend =
13 > uncommit =
13 > uncommit =
14 > EOF
14 > EOF
15
15
16 Repo Setup
16 Repo Setup
17
17
18 $ hg init repo
18 $ hg init repo
19 $ cd repo
19 $ cd repo
20 $ for ch in a b c d e f g h; do touch $ch; echo "foo" >> $ch; hg ci -Aqm "Added "$ch; done
20 $ for ch in a b c d e f g h; do touch $ch; echo "foo" >> $ch; hg ci -Aqm "Added "$ch; done
21
21
22 $ hg glog
22 $ hg glog
23 @ 7:ec2426147f0e Added h
23 @ 7:ec2426147f0e Added h
24 |
24 |
25 o 6:87d6d6676308 Added g
25 o 6:87d6d6676308 Added g
26 |
26 |
27 o 5:825660c69f0c Added f
27 o 5:825660c69f0c Added f
28 |
28 |
29 o 4:aa98ab95a928 Added e
29 o 4:aa98ab95a928 Added e
30 |
30 |
31 o 3:62615734edd5 Added d
31 o 3:62615734edd5 Added d
32 |
32 |
33 o 2:28ad74487de9 Added c
33 o 2:28ad74487de9 Added c
34 |
34 |
35 o 1:29becc82797a Added b
35 o 1:29becc82797a Added b
36 |
36 |
37 o 0:18d04c59bb5d Added a
37 o 0:18d04c59bb5d Added a
38
38
39 Trying to unamend when there was no amend done
39 Trying to unamend when there was no amend done
40
40
41 $ hg unamend
41 $ hg unamend
42 abort: working copy parent was not created by 'hg amend' or 'hg unamend'
42 abort: working copy parent was not created by 'hg amend' or 'hg unamend'
43 [10]
43 [10]
44 $ echo "bar" >> h
44 $ echo "bar" >> h
45
45
46 Trying to unamend when the obsmarker is missing
46 Trying to unamend when the obsmarker is missing
47
47
48 $ hg amend
48 $ hg amend
49 $ hg debugobsolete --delete 0
49 $ hg debugobsolete --delete 0
50 deleted 1 obsolescence markers
50 deleted 1 obsolescence markers
51 $ hg unamend
51 $ hg unamend
52 abort: changeset must have one predecessor, found 0 predecessors
52 abort: changeset must have one predecessor, found 0 predecessors
53 [10]
53 [10]
54 $ hg strip tip --config extensions.strip=
54 $ hg strip tip --config extensions.strip=
55 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
55 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
56 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c9fa1a715c1b-06e5c233-backup.hg
56 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c9fa1a715c1b-06e5c233-backup.hg
57 $ hg up tip
57 $ hg up tip
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
59
59
60 Unamend on clean wdir and tip
60 Unamend on clean wdir and tip
61
61
62 $ echo "bar" >> h
62 $ echo "bar" >> h
63 $ hg amend
63 $ hg amend
64
64
65 $ hg exp
65 $ hg exp
66 # HG changeset patch
66 # HG changeset patch
67 # User test
67 # User test
68 # Date 0 0
68 # Date 0 0
69 # Thu Jan 01 00:00:00 1970 +0000
69 # Thu Jan 01 00:00:00 1970 +0000
70 # Node ID c9fa1a715c1b7661c0fafb362a9f30bd75878d7d
70 # Node ID c9fa1a715c1b7661c0fafb362a9f30bd75878d7d
71 # Parent 87d6d66763085b629e6d7ed56778c79827273022
71 # Parent 87d6d66763085b629e6d7ed56778c79827273022
72 Added h
72 Added h
73
73
74 diff -r 87d6d6676308 -r c9fa1a715c1b h
74 diff -r 87d6d6676308 -r c9fa1a715c1b h
75 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
75 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
76 +++ b/h Thu Jan 01 00:00:00 1970 +0000
76 +++ b/h Thu Jan 01 00:00:00 1970 +0000
77 @@ -0,0 +1,2 @@
77 @@ -0,0 +1,2 @@
78 +foo
78 +foo
79 +bar
79 +bar
80
80
81 $ hg glog --hidden
81 $ hg glog --hidden
82 @ 8:c9fa1a715c1b Added h
82 @ 8:c9fa1a715c1b Added h
83 |
83 |
84 | x 7:ec2426147f0e Added h
84 | x 7:ec2426147f0e Added h
85 |/
85 |/
86 o 6:87d6d6676308 Added g
86 o 6:87d6d6676308 Added g
87 |
87 |
88 o 5:825660c69f0c Added f
88 o 5:825660c69f0c Added f
89 |
89 |
90 o 4:aa98ab95a928 Added e
90 o 4:aa98ab95a928 Added e
91 |
91 |
92 o 3:62615734edd5 Added d
92 o 3:62615734edd5 Added d
93 |
93 |
94 o 2:28ad74487de9 Added c
94 o 2:28ad74487de9 Added c
95 |
95 |
96 o 1:29becc82797a Added b
96 o 1:29becc82797a Added b
97 |
97 |
98 o 0:18d04c59bb5d Added a
98 o 0:18d04c59bb5d Added a
99
99
100 $ hg unamend
100 $ hg unamend
101 $ hg glog --hidden
101 $ hg glog --hidden
102 @ 9:46d02d47eec6 Added h
102 @ 9:46d02d47eec6 Added h
103 |
103 |
104 | x 8:c9fa1a715c1b Added h
104 | x 8:c9fa1a715c1b Added h
105 |/
105 |/
106 | x 7:ec2426147f0e Added h
106 | x 7:ec2426147f0e Added h
107 |/
107 |/
108 o 6:87d6d6676308 Added g
108 o 6:87d6d6676308 Added g
109 |
109 |
110 o 5:825660c69f0c Added f
110 o 5:825660c69f0c Added f
111 |
111 |
112 o 4:aa98ab95a928 Added e
112 o 4:aa98ab95a928 Added e
113 |
113 |
114 o 3:62615734edd5 Added d
114 o 3:62615734edd5 Added d
115 |
115 |
116 o 2:28ad74487de9 Added c
116 o 2:28ad74487de9 Added c
117 |
117 |
118 o 1:29becc82797a Added b
118 o 1:29becc82797a Added b
119 |
119 |
120 o 0:18d04c59bb5d Added a
120 o 0:18d04c59bb5d Added a
121
121
122 $ hg diff
122 $ hg diff
123 diff -r 46d02d47eec6 h
123 diff -r 46d02d47eec6 h
124 --- a/h Thu Jan 01 00:00:00 1970 +0000
124 --- a/h Thu Jan 01 00:00:00 1970 +0000
125 +++ b/h Thu Jan 01 00:00:00 1970 +0000
125 +++ b/h Thu Jan 01 00:00:00 1970 +0000
126 @@ -1,1 +1,2 @@
126 @@ -1,1 +1,2 @@
127 foo
127 foo
128 +bar
128 +bar
129
129
130 $ hg exp
130 $ hg exp
131 # HG changeset patch
131 # HG changeset patch
132 # User test
132 # User test
133 # Date 0 0
133 # Date 0 0
134 # Thu Jan 01 00:00:00 1970 +0000
134 # Thu Jan 01 00:00:00 1970 +0000
135 # Node ID 46d02d47eec6ca096b8dcab3f8f5579c40c3dd9a
135 # Node ID 46d02d47eec6ca096b8dcab3f8f5579c40c3dd9a
136 # Parent 87d6d66763085b629e6d7ed56778c79827273022
136 # Parent 87d6d66763085b629e6d7ed56778c79827273022
137 Added h
137 Added h
138
138
139 diff -r 87d6d6676308 -r 46d02d47eec6 h
139 diff -r 87d6d6676308 -r 46d02d47eec6 h
140 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
140 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
141 +++ b/h Thu Jan 01 00:00:00 1970 +0000
141 +++ b/h Thu Jan 01 00:00:00 1970 +0000
142 @@ -0,0 +1,1 @@
142 @@ -0,0 +1,1 @@
143 +foo
143 +foo
144
144
145 $ hg status
145 $ hg status
146 M h
146 M h
147
147
148 $ hg log -r . -T '{extras % "{extra}\n"}' --config alias.log=log
148 $ hg log -r . -T '{extras % "{extra}\n"}' --config alias.log=log
149 branch=default
149 branch=default
150 unamend_source=c9fa1a715c1b7661c0fafb362a9f30bd75878d7d
150 unamend_source=c9fa1a715c1b7661c0fafb362a9f30bd75878d7d
151
151
152 Using unamend to undo an unamed (intentional)
152 Using unamend to undo an unamed (intentional)
153
153
154 $ hg unamend
154 $ hg unamend
155 $ hg exp
155 $ hg exp
156 # HG changeset patch
156 # HG changeset patch
157 # User test
157 # User test
158 # Date 0 0
158 # Date 0 0
159 # Thu Jan 01 00:00:00 1970 +0000
159 # Thu Jan 01 00:00:00 1970 +0000
160 # Node ID 850ddfc1bc662997ec6094ada958f01f0cc8070a
160 # Node ID 850ddfc1bc662997ec6094ada958f01f0cc8070a
161 # Parent 87d6d66763085b629e6d7ed56778c79827273022
161 # Parent 87d6d66763085b629e6d7ed56778c79827273022
162 Added h
162 Added h
163
163
164 diff -r 87d6d6676308 -r 850ddfc1bc66 h
164 diff -r 87d6d6676308 -r 850ddfc1bc66 h
165 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
165 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
166 +++ b/h Thu Jan 01 00:00:00 1970 +0000
166 +++ b/h Thu Jan 01 00:00:00 1970 +0000
167 @@ -0,0 +1,2 @@
167 @@ -0,0 +1,2 @@
168 +foo
168 +foo
169 +bar
169 +bar
170 $ hg diff
170 $ hg diff
171
171
172 Unamend on a dirty working directory
172 Unamend on a dirty working directory
173
173
174 $ echo "bar" >> a
174 $ echo "bar" >> a
175 $ hg amend
175 $ hg amend
176 $ echo "foobar" >> a
176 $ echo "foobar" >> a
177 $ echo "bar" >> b
177 $ echo "bar" >> b
178 $ hg status
178 $ hg status
179 M a
179 M a
180 M b
180 M b
181
181
182 $ hg unamend
182 $ hg unamend
183
183
184 $ hg status
184 $ hg status
185 M a
185 M a
186 M b
186 M b
187
187
188 $ hg diff
188 $ hg diff
189 diff -r ec338db45d51 a
189 diff -r ec338db45d51 a
190 --- a/a Thu Jan 01 00:00:00 1970 +0000
190 --- a/a Thu Jan 01 00:00:00 1970 +0000
191 +++ b/a Thu Jan 01 00:00:00 1970 +0000
191 +++ b/a Thu Jan 01 00:00:00 1970 +0000
192 @@ -1,1 +1,3 @@
192 @@ -1,1 +1,3 @@
193 foo
193 foo
194 +bar
194 +bar
195 +foobar
195 +foobar
196 diff -r ec338db45d51 b
196 diff -r ec338db45d51 b
197 --- a/b Thu Jan 01 00:00:00 1970 +0000
197 --- a/b Thu Jan 01 00:00:00 1970 +0000
198 +++ b/b Thu Jan 01 00:00:00 1970 +0000
198 +++ b/b Thu Jan 01 00:00:00 1970 +0000
199 @@ -1,1 +1,2 @@
199 @@ -1,1 +1,2 @@
200 foo
200 foo
201 +bar
201 +bar
202
202
203 Unamending an added file
203 Unamending an added file
204
204
205 $ hg ci -m "Added things to a and b"
205 $ hg ci -m "Added things to a and b"
206 $ echo foo > bar
206 $ echo foo > bar
207 $ hg add bar
207 $ hg add bar
208 $ hg amend
208 $ hg amend
209
209
210 $ hg unamend
210 $ hg unamend
211 $ hg status
211 $ hg status
212 A bar
212 A bar
213
213
214 $ hg revert --all
214 $ hg revert --all
215 forgetting bar
215 forgetting bar
216
216
217 Unamending a removed file
217 Unamending a removed file
218
218
219 $ hg remove a
219 $ hg remove a
220 $ hg amend
220 $ hg amend
221
221
222 $ hg unamend
222 $ hg unamend
223 $ hg status
223 $ hg status
224 R a
224 R a
225 ? bar
225 ? bar
226
226
227 $ hg revert --all
227 $ hg revert --all
228 undeleting a
228 undeleting a
229
229
230 Unamending an added file with dirty wdir status
230 Unamending an added file with dirty wdir status
231
231
232 $ hg add bar
232 $ hg add bar
233 $ hg amend
233 $ hg amend
234 $ echo bar >> bar
234 $ echo bar >> bar
235 $ hg status
235 $ hg status
236 M bar
236 M bar
237
237
238 $ hg unamend
238 $ hg unamend
239 $ hg status
239 $ hg status
240 A bar
240 A bar
241 $ hg diff
241 $ hg diff
242 diff -r 7f79409af972 bar
242 diff -r 7f79409af972 bar
243 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
243 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
244 +++ b/bar Thu Jan 01 00:00:00 1970 +0000
244 +++ b/bar Thu Jan 01 00:00:00 1970 +0000
245 @@ -0,0 +1,2 @@
245 @@ -0,0 +1,2 @@
246 +foo
246 +foo
247 +bar
247 +bar
248
248
249 $ hg revert --all
249 $ hg revert --all
250 forgetting bar
250 forgetting bar
251 $ rm bar
251 $ rm bar
252
252
253 Unamending in middle of a stack
253 Unamending in middle of a stack
254
254
255 $ hg glog
255 $ hg glog
256 @ 19:7f79409af972 Added things to a and b
256 @ 19:7f79409af972 Added things to a and b
257 |
257 |
258 o 12:ec338db45d51 Added h
258 o 12:ec338db45d51 Added h
259 |
259 |
260 o 6:87d6d6676308 Added g
260 o 6:87d6d6676308 Added g
261 |
261 |
262 o 5:825660c69f0c Added f
262 o 5:825660c69f0c Added f
263 |
263 |
264 o 4:aa98ab95a928 Added e
264 o 4:aa98ab95a928 Added e
265 |
265 |
266 o 3:62615734edd5 Added d
266 o 3:62615734edd5 Added d
267 |
267 |
268 o 2:28ad74487de9 Added c
268 o 2:28ad74487de9 Added c
269 |
269 |
270 o 1:29becc82797a Added b
270 o 1:29becc82797a Added b
271 |
271 |
272 o 0:18d04c59bb5d Added a
272 o 0:18d04c59bb5d Added a
273
273
274 $ hg up 5
274 $ hg up 5
275 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
275 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
276 $ echo bar >> f
276 $ echo bar >> f
277 $ hg amend
277 $ hg amend
278 3 new orphan changesets
278 3 new orphan changesets
279 $ hg rebase -s 6 -d . -q
279 $ hg rebase -s 6 -d . -q
280
280
281 $ hg glog
281 $ hg glog
282 o 23:03ddd6fc5af1 Added things to a and b
282 o 23:03ddd6fc5af1 Added things to a and b
283 |
283 |
284 o 22:3e7b64ee157b Added h
284 o 22:3e7b64ee157b Added h
285 |
285 |
286 o 21:49635b68477e Added g
286 o 21:49635b68477e Added g
287 |
287 |
288 @ 20:93f0e8ffab32 Added f
288 @ 20:93f0e8ffab32 Added f
289 |
289 |
290 o 4:aa98ab95a928 Added e
290 o 4:aa98ab95a928 Added e
291 |
291 |
292 o 3:62615734edd5 Added d
292 o 3:62615734edd5 Added d
293 |
293 |
294 o 2:28ad74487de9 Added c
294 o 2:28ad74487de9 Added c
295 |
295 |
296 o 1:29becc82797a Added b
296 o 1:29becc82797a Added b
297 |
297 |
298 o 0:18d04c59bb5d Added a
298 o 0:18d04c59bb5d Added a
299
299
300
300
301 $ hg --config experimental.evolution=createmarkers unamend
301 $ hg --config experimental.evolution=createmarkers unamend
302 abort: cannot unamend changeset, as that will orphan 3 descendants
302 abort: cannot unamend changeset, as that will orphan 3 descendants
303 (see 'hg help evolution.instability')
303 (see 'hg help evolution.instability')
304 [10]
304 [10]
305
305
306 $ hg unamend
306 $ hg unamend
307 3 new orphan changesets
307 3 new orphan changesets
308
308
309 Trying to unamend a public changeset
309 Trying to unamend a public changeset
310
310
311 $ hg up -C 23
311 $ hg up -C 23
312 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
312 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
313 $ hg phase -r . -p
313 $ hg phase -r . -p
314 1 new phase-divergent changesets
314 1 new phase-divergent changesets
315 $ hg unamend
315 $ hg unamend
316 abort: cannot unamend public changesets: 03ddd6fc5af1
316 abort: cannot unamend public changesets: 03ddd6fc5af1
317 (see 'hg help phases' for details)
317 (see 'hg help phases' for details)
318 [10]
318 [10]
319
319
320 Testing whether unamend retains copies or not
320 Testing whether unamend retains copies or not
321
321
322 $ hg status
322 $ hg status
323
323
324 $ hg mv a foo
324 $ hg mv a foo
325
325
326 $ hg ci -m "Moved a to foo"
326 $ hg ci -m "Moved a to foo"
327 $ hg exp --git
327 $ hg exp --git
328 # HG changeset patch
328 # HG changeset patch
329 # User test
329 # User test
330 # Date 0 0
330 # Date 0 0
331 # Thu Jan 01 00:00:00 1970 +0000
331 # Thu Jan 01 00:00:00 1970 +0000
332 # Node ID cfef290346fbee5126313d7e1aab51d877679b09
332 # Node ID cfef290346fbee5126313d7e1aab51d877679b09
333 # Parent 03ddd6fc5af19e028c44a2fd6d790dd22712f231
333 # Parent 03ddd6fc5af19e028c44a2fd6d790dd22712f231
334 Moved a to foo
334 Moved a to foo
335
335
336 diff --git a/a b/foo
336 diff --git a/a b/foo
337 rename from a
337 rename from a
338 rename to foo
338 rename to foo
339
339
340 $ hg mv b foobar
340 $ hg mv b foobar
341 $ hg diff --git
341 $ hg diff --git
342 diff --git a/b b/foobar
342 diff --git a/b b/foobar
343 rename from b
343 rename from b
344 rename to foobar
344 rename to foobar
345 $ hg amend
345 $ hg amend
346
346
347 $ hg exp --git
347 $ hg exp --git
348 # HG changeset patch
348 # HG changeset patch
349 # User test
349 # User test
350 # Date 0 0
350 # Date 0 0
351 # Thu Jan 01 00:00:00 1970 +0000
351 # Thu Jan 01 00:00:00 1970 +0000
352 # Node ID eca050985275bb271ce3092b54e56ea5c85d29a3
352 # Node ID eca050985275bb271ce3092b54e56ea5c85d29a3
353 # Parent 03ddd6fc5af19e028c44a2fd6d790dd22712f231
353 # Parent 03ddd6fc5af19e028c44a2fd6d790dd22712f231
354 Moved a to foo
354 Moved a to foo
355
355
356 diff --git a/a b/foo
356 diff --git a/a b/foo
357 rename from a
357 rename from a
358 rename to foo
358 rename to foo
359 diff --git a/b b/foobar
359 diff --git a/b b/foobar
360 rename from b
360 rename from b
361 rename to foobar
361 rename to foobar
362
362
363 $ hg mv c wat
363 $ hg mv c wat
364 $ hg unamend
364 $ hg unamend
365
365
366 $ hg verify -v
366 $ hg verify -q
367 repository uses revlog format 1
368 checking changesets
369 checking manifests
370 crosschecking files in changesets and manifests
371 checking files
372 checked 28 changesets with 16 changes to 11 files
373
367
374 Retained copies in new prdecessor commit
368 Retained copies in new prdecessor commit
375
369
376 $ hg exp --git
370 $ hg exp --git
377 # HG changeset patch
371 # HG changeset patch
378 # User test
372 # User test
379 # Date 0 0
373 # Date 0 0
380 # Thu Jan 01 00:00:00 1970 +0000
374 # Thu Jan 01 00:00:00 1970 +0000
381 # Node ID 552e3af4f01f620f88ca27be1f898316235b736a
375 # Node ID 552e3af4f01f620f88ca27be1f898316235b736a
382 # Parent 03ddd6fc5af19e028c44a2fd6d790dd22712f231
376 # Parent 03ddd6fc5af19e028c44a2fd6d790dd22712f231
383 Moved a to foo
377 Moved a to foo
384
378
385 diff --git a/a b/foo
379 diff --git a/a b/foo
386 rename from a
380 rename from a
387 rename to foo
381 rename to foo
388
382
389 Retained copies in working directoy
383 Retained copies in working directoy
390
384
391 $ hg diff --git
385 $ hg diff --git
392 diff --git a/b b/foobar
386 diff --git a/b b/foobar
393 rename from b
387 rename from b
394 rename to foobar
388 rename to foobar
395 diff --git a/c b/wat
389 diff --git a/c b/wat
396 rename from c
390 rename from c
397 rename to wat
391 rename to wat
398 $ hg revert -qa
392 $ hg revert -qa
399 $ rm foobar wat
393 $ rm foobar wat
400
394
401 Rename a->b, then amend b->c. After unamend, should look like b->c.
395 Rename a->b, then amend b->c. After unamend, should look like b->c.
402
396
403 $ hg co -q 0
397 $ hg co -q 0
404 $ hg mv a b
398 $ hg mv a b
405 $ hg ci -qm 'move to a b'
399 $ hg ci -qm 'move to a b'
406 $ hg mv b c
400 $ hg mv b c
407 $ hg amend
401 $ hg amend
408 $ hg unamend
402 $ hg unamend
409 $ hg st --copies --change .
403 $ hg st --copies --change .
410 A b
404 A b
411 a
405 a
412 R a
406 R a
413 $ hg st --copies
407 $ hg st --copies
414 A c
408 A c
415 b
409 b
416 R b
410 R b
417 $ hg revert -qa
411 $ hg revert -qa
418 $ rm c
412 $ rm c
419
413
420 Rename a->b, then amend b->c, and working copy change c->d. After unamend, should look like b->d
414 Rename a->b, then amend b->c, and working copy change c->d. After unamend, should look like b->d
421
415
422 $ hg co -q 0
416 $ hg co -q 0
423 $ hg mv a b
417 $ hg mv a b
424 $ hg ci -qm 'move to a b'
418 $ hg ci -qm 'move to a b'
425 warning: commit already existed in the repository!
419 warning: commit already existed in the repository!
426 $ hg mv b c
420 $ hg mv b c
427 $ hg amend
421 $ hg amend
428 warning: commit already existed in the repository!
422 warning: commit already existed in the repository!
429 $ hg mv c d
423 $ hg mv c d
430 $ hg unamend
424 $ hg unamend
431 $ hg st --copies --change .
425 $ hg st --copies --change .
432 A b
426 A b
433 a
427 a
434 R a
428 R a
435 $ hg st --copies
429 $ hg st --copies
436 A d
430 A d
437 b
431 b
438 R b
432 R b
439
433
440 Try to unamend a merge
434 Try to unamend a merge
441
435
442 $ cd ..
436 $ cd ..
443 $ hg init merge
437 $ hg init merge
444 $ cd merge
438 $ cd merge
445 $ echo initial > initial
439 $ echo initial > initial
446 $ hg ci -Aqm initial
440 $ hg ci -Aqm initial
447 $ echo left > left
441 $ echo left > left
448 $ hg ci -Aqm left
442 $ hg ci -Aqm left
449 $ hg co -q 0
443 $ hg co -q 0
450 $ echo right > right
444 $ echo right > right
451 $ hg ci -Aqm right
445 $ hg ci -Aqm right
452 $ hg merge -q 1
446 $ hg merge -q 1
453 $ hg ci -m merge
447 $ hg ci -m merge
454 $ echo accidental > initial
448 $ echo accidental > initial
455 $ hg st --rev 1 --rev .
449 $ hg st --rev 1 --rev .
456 A right
450 A right
457 $ hg st --rev 2 --rev .
451 $ hg st --rev 2 --rev .
458 A left
452 A left
459 $ hg amend
453 $ hg amend
460 $ hg unamend
454 $ hg unamend
461 abort: cannot unamend merge changeset
455 abort: cannot unamend merge changeset
462 [10]
456 [10]
@@ -1,172 +1,167
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 Test unionrepo functionality
3 Test unionrepo functionality
4
4
5 Create one repository
5 Create one repository
6
6
7 $ hg init repo1
7 $ hg init repo1
8 $ cd repo1
8 $ cd repo1
9 $ touch repo1-0
9 $ touch repo1-0
10 $ echo repo1-0 > f
10 $ echo repo1-0 > f
11 $ hg ci -Aqmrepo1-0
11 $ hg ci -Aqmrepo1-0
12 $ touch repo1-1
12 $ touch repo1-1
13 $ echo repo1-1 >> f
13 $ echo repo1-1 >> f
14 $ hg ci -Aqmrepo1-1
14 $ hg ci -Aqmrepo1-1
15 $ touch repo1-2
15 $ touch repo1-2
16 $ echo repo1-2 >> f
16 $ echo repo1-2 >> f
17 $ hg ci -Aqmrepo1-2
17 $ hg ci -Aqmrepo1-2
18 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
18 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
19 2:68c0685446a3 repo1-2
19 2:68c0685446a3 repo1-2
20 1:8a58db72e69d repo1-1
20 1:8a58db72e69d repo1-1
21 0:f093fec0529b repo1-0
21 0:f093fec0529b repo1-0
22 $ tip1=`hg id -q`
22 $ tip1=`hg id -q`
23 $ cd ..
23 $ cd ..
24
24
25 - and a clone with a not-completely-trivial history
25 - and a clone with a not-completely-trivial history
26
26
27 $ hg clone -q repo1 --rev 0 repo2
27 $ hg clone -q repo1 --rev 0 repo2
28 $ cd repo2
28 $ cd repo2
29 $ touch repo2-1
29 $ touch repo2-1
30 $ sed '1i\
30 $ sed '1i\
31 > repo2-1 at top
31 > repo2-1 at top
32 > ' f > f.tmp
32 > ' f > f.tmp
33 $ mv f.tmp f
33 $ mv f.tmp f
34 $ hg ci -Aqmrepo2-1
34 $ hg ci -Aqmrepo2-1
35 $ touch repo2-2
35 $ touch repo2-2
36 $ hg pull -q ../repo1 -r 1
36 $ hg pull -q ../repo1 -r 1
37 $ hg merge -q
37 $ hg merge -q
38 $ hg ci -Aqmrepo2-2-merge
38 $ hg ci -Aqmrepo2-2-merge
39 $ touch repo2-3
39 $ touch repo2-3
40 $ echo repo2-3 >> f
40 $ echo repo2-3 >> f
41 $ hg ci -mrepo2-3
41 $ hg ci -mrepo2-3
42 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
42 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
43 4:2f0d178c469c repo2-3
43 4:2f0d178c469c repo2-3
44 3:9e6fb3e0b9da repo2-2-merge
44 3:9e6fb3e0b9da repo2-2-merge
45 2:8a58db72e69d repo1-1
45 2:8a58db72e69d repo1-1
46 1:c337dba826e7 repo2-1
46 1:c337dba826e7 repo2-1
47 0:f093fec0529b repo1-0
47 0:f093fec0529b repo1-0
48 $ cd ..
48 $ cd ..
49
49
50 revisions from repo2 appear as appended / pulled to repo1
50 revisions from repo2 appear as appended / pulled to repo1
51
51
52 $ hg -R union:repo1+repo2 log --template '{rev}:{node|short} {desc|firstline}\n'
52 $ hg -R union:repo1+repo2 log --template '{rev}:{node|short} {desc|firstline}\n'
53 5:2f0d178c469c repo2-3
53 5:2f0d178c469c repo2-3
54 4:9e6fb3e0b9da repo2-2-merge
54 4:9e6fb3e0b9da repo2-2-merge
55 3:c337dba826e7 repo2-1
55 3:c337dba826e7 repo2-1
56 2:68c0685446a3 repo1-2
56 2:68c0685446a3 repo1-2
57 1:8a58db72e69d repo1-1
57 1:8a58db72e69d repo1-1
58 0:f093fec0529b repo1-0
58 0:f093fec0529b repo1-0
59
59
60 manifest can be retrieved for revisions in both repos
60 manifest can be retrieved for revisions in both repos
61
61
62 $ hg -R union:repo1+repo2 mani -r $tip1
62 $ hg -R union:repo1+repo2 mani -r $tip1
63 f
63 f
64 repo1-0
64 repo1-0
65 repo1-1
65 repo1-1
66 repo1-2
66 repo1-2
67 $ hg -R union:repo1+repo2 mani -r 4
67 $ hg -R union:repo1+repo2 mani -r 4
68 f
68 f
69 repo1-0
69 repo1-0
70 repo1-1
70 repo1-1
71 repo2-1
71 repo2-1
72 repo2-2
72 repo2-2
73
73
74 files can be retrieved form both repos
74 files can be retrieved form both repos
75
75
76 $ hg -R repo1 cat repo1/f -r2
76 $ hg -R repo1 cat repo1/f -r2
77 repo1-0
77 repo1-0
78 repo1-1
78 repo1-1
79 repo1-2
79 repo1-2
80
80
81 $ hg -R union:repo1+repo2 cat -r$tip1 repo1/f
81 $ hg -R union:repo1+repo2 cat -r$tip1 repo1/f
82 repo1-0
82 repo1-0
83 repo1-1
83 repo1-1
84 repo1-2
84 repo1-2
85
85
86 $ hg -R union:repo1+repo2 cat -r4 $TESTTMP/repo1/f
86 $ hg -R union:repo1+repo2 cat -r4 $TESTTMP/repo1/f
87 repo2-1 at top
87 repo2-1 at top
88 repo1-0
88 repo1-0
89 repo1-1
89 repo1-1
90
90
91 files can be compared across repos
91 files can be compared across repos
92
92
93 $ hg -R union:repo1+repo2 diff -r$tip1 -rtip
93 $ hg -R union:repo1+repo2 diff -r$tip1 -rtip
94 diff -r 68c0685446a3 -r 2f0d178c469c f
94 diff -r 68c0685446a3 -r 2f0d178c469c f
95 --- a/f Thu Jan 01 00:00:00 1970 +0000
95 --- a/f Thu Jan 01 00:00:00 1970 +0000
96 +++ b/f Thu Jan 01 00:00:00 1970 +0000
96 +++ b/f Thu Jan 01 00:00:00 1970 +0000
97 @@ -1,3 +1,4 @@
97 @@ -1,3 +1,4 @@
98 +repo2-1 at top
98 +repo2-1 at top
99 repo1-0
99 repo1-0
100 repo1-1
100 repo1-1
101 -repo1-2
101 -repo1-2
102 +repo2-3
102 +repo2-3
103
103
104 heads from both repos are found correctly
104 heads from both repos are found correctly
105
105
106 $ hg -R union:repo1+repo2 heads --template '{rev}:{node|short} {desc|firstline}\n'
106 $ hg -R union:repo1+repo2 heads --template '{rev}:{node|short} {desc|firstline}\n'
107 5:2f0d178c469c repo2-3
107 5:2f0d178c469c repo2-3
108 2:68c0685446a3 repo1-2
108 2:68c0685446a3 repo1-2
109
109
110 revsets works across repos
110 revsets works across repos
111
111
112 $ hg -R union:repo1+repo2 id -r "ancestor($tip1, 5)"
112 $ hg -R union:repo1+repo2 id -r "ancestor($tip1, 5)"
113 8a58db72e69d
113 8a58db72e69d
114
114
115 annotate works - an indication that linkrevs works
115 annotate works - an indication that linkrevs works
116
116
117 $ hg --cwd repo1 -Runion:../repo2 annotate $TESTTMP/repo1/f -r tip
117 $ hg --cwd repo1 -Runion:../repo2 annotate $TESTTMP/repo1/f -r tip
118 3: repo2-1 at top
118 3: repo2-1 at top
119 0: repo1-0
119 0: repo1-0
120 1: repo1-1
120 1: repo1-1
121 5: repo2-3
121 5: repo2-3
122
122
123 union repos can be cloned ... and clones works correctly
123 union repos can be cloned ... and clones works correctly
124
124
125 $ hg clone -U union:repo1+repo2 repo3
125 $ hg clone -U union:repo1+repo2 repo3
126 requesting all changes
126 requesting all changes
127 adding changesets
127 adding changesets
128 adding manifests
128 adding manifests
129 adding file changes
129 adding file changes
130 added 6 changesets with 11 changes to 6 files (+1 heads)
130 added 6 changesets with 11 changes to 6 files (+1 heads)
131 new changesets f093fec0529b:2f0d178c469c (6 drafts)
131 new changesets f093fec0529b:2f0d178c469c (6 drafts)
132
132
133 $ hg -R repo3 paths
133 $ hg -R repo3 paths
134 default = union:repo1+repo2
134 default = union:repo1+repo2
135
135
136 $ hg -R repo3 verify
136 $ hg -R repo3 verify -q
137 checking changesets
138 checking manifests
139 crosschecking files in changesets and manifests
140 checking files
141 checked 6 changesets with 11 changes to 6 files
142
137
143 $ hg -R repo3 heads --template '{rev}:{node|short} {desc|firstline}\n'
138 $ hg -R repo3 heads --template '{rev}:{node|short} {desc|firstline}\n'
144 5:2f0d178c469c repo2-3
139 5:2f0d178c469c repo2-3
145 2:68c0685446a3 repo1-2
140 2:68c0685446a3 repo1-2
146
141
147 $ hg -R repo3 log --template '{rev}:{node|short} {desc|firstline}\n'
142 $ hg -R repo3 log --template '{rev}:{node|short} {desc|firstline}\n'
148 5:2f0d178c469c repo2-3
143 5:2f0d178c469c repo2-3
149 4:9e6fb3e0b9da repo2-2-merge
144 4:9e6fb3e0b9da repo2-2-merge
150 3:c337dba826e7 repo2-1
145 3:c337dba826e7 repo2-1
151 2:68c0685446a3 repo1-2
146 2:68c0685446a3 repo1-2
152 1:8a58db72e69d repo1-1
147 1:8a58db72e69d repo1-1
153 0:f093fec0529b repo1-0
148 0:f093fec0529b repo1-0
154
149
155 union repos should use the correct rev number (issue5024)
150 union repos should use the correct rev number (issue5024)
156
151
157 $ hg init a
152 $ hg init a
158 $ cd a
153 $ cd a
159 $ echo a0 >> f
154 $ echo a0 >> f
160 $ hg ci -Aqm a0
155 $ hg ci -Aqm a0
161 $ cd ..
156 $ cd ..
162 $ hg init b
157 $ hg init b
163 $ cd b
158 $ cd b
164 $ echo b0 >> f
159 $ echo b0 >> f
165 $ hg ci -Aqm b0
160 $ hg ci -Aqm b0
166 $ echo b1 >> f
161 $ echo b1 >> f
167 $ hg ci -qm b1
162 $ hg ci -qm b1
168 $ cd ..
163 $ cd ..
169
164
170 "hg files -v" to call fctx.size() -> fctx.iscensored()
165 "hg files -v" to call fctx.size() -> fctx.iscensored()
171 $ hg files -R union:b+a -r2 -v
166 $ hg files -R union:b+a -r2 -v
172 3 b/f
167 3 b/f
@@ -1,2143 +1,2103
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > [format]
6 > [format]
7 > # stabilize test accross variant
7 > # stabilize test accross variant
8 > revlog-compression=zlib
8 > revlog-compression=zlib
9 > [storage]
9 > [storage]
10 > dirstate-v2.slow-path=allow
10 > dirstate-v2.slow-path=allow
11 > EOF
11 > EOF
12
12
13 store and revlogv1 are required in source
13 store and revlogv1 are required in source
14
14
15 $ hg --config format.usestore=false init no-store
15 $ hg --config format.usestore=false init no-store
16 $ hg -R no-store debugupgraderepo
16 $ hg -R no-store debugupgraderepo
17 abort: cannot upgrade repository; requirement missing: store
17 abort: cannot upgrade repository; requirement missing: store
18 [255]
18 [255]
19
19
20 $ hg init no-revlogv1
20 $ hg init no-revlogv1
21 $ cat > no-revlogv1/.hg/requires << EOF
21 $ cat > no-revlogv1/.hg/requires << EOF
22 > dotencode
22 > dotencode
23 > fncache
23 > fncache
24 > generaldelta
24 > generaldelta
25 > store
25 > store
26 > EOF
26 > EOF
27
27
28 $ hg -R no-revlogv1 debugupgraderepo
28 $ hg -R no-revlogv1 debugupgraderepo
29 abort: cannot upgrade repository; missing a revlog version
29 abort: cannot upgrade repository; missing a revlog version
30 [255]
30 [255]
31
31
32 Cannot upgrade shared repositories
32 Cannot upgrade shared repositories
33
33
34 $ hg init share-parent
34 $ hg init share-parent
35 $ hg -R share-parent debugbuilddag -n .+9
35 $ hg -R share-parent debugbuilddag -n .+9
36 $ hg -R share-parent up tip
36 $ hg -R share-parent up tip
37 10 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 10 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 $ hg -q share share-parent share-child
38 $ hg -q share share-parent share-child
39
39
40 $ hg -R share-child debugupgraderepo --config format.sparse-revlog=no
40 $ hg -R share-child debugupgraderepo --config format.sparse-revlog=no
41 abort: cannot use these actions on a share repository: sparserevlog
41 abort: cannot use these actions on a share repository: sparserevlog
42 (upgrade the main repository directly)
42 (upgrade the main repository directly)
43 [255]
43 [255]
44
44
45 Unless the action is compatible with share
45 Unless the action is compatible with share
46
46
47 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet
47 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet
48 requirements
48 requirements
49 preserved: * (glob)
49 preserved: * (glob)
50 added: dirstate-v2
50 added: dirstate-v2
51
51
52 no revlogs to process
52 no revlogs to process
53
53
54
54
55 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet --run
55 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet --run
56 upgrade will perform the following actions:
56 upgrade will perform the following actions:
57
57
58 requirements
58 requirements
59 preserved: * (glob)
59 preserved: * (glob)
60 added: dirstate-v2
60 added: dirstate-v2
61
61
62 no revlogs to process
62 no revlogs to process
63
63
64 $ hg debugformat -R share-child | grep dirstate-v2
64 $ hg debugformat -R share-child | grep dirstate-v2
65 dirstate-v2: yes
65 dirstate-v2: yes
66 $ hg debugformat -R share-parent | grep dirstate-v2
66 $ hg debugformat -R share-parent | grep dirstate-v2
67 dirstate-v2: no
67 dirstate-v2: no
68 $ hg status --all -R share-child
68 $ hg status --all -R share-child
69 C nf0
69 C nf0
70 C nf1
70 C nf1
71 C nf2
71 C nf2
72 C nf3
72 C nf3
73 C nf4
73 C nf4
74 C nf5
74 C nf5
75 C nf6
75 C nf6
76 C nf7
76 C nf7
77 C nf8
77 C nf8
78 C nf9
78 C nf9
79 $ hg log -l 3 -R share-child
79 $ hg log -l 3 -R share-child
80 changeset: 9:0059eb38e4a4
80 changeset: 9:0059eb38e4a4
81 tag: tip
81 tag: tip
82 user: debugbuilddag
82 user: debugbuilddag
83 date: Thu Jan 01 00:00:09 1970 +0000
83 date: Thu Jan 01 00:00:09 1970 +0000
84 summary: r9
84 summary: r9
85
85
86 changeset: 8:4d5be70c8130
86 changeset: 8:4d5be70c8130
87 user: debugbuilddag
87 user: debugbuilddag
88 date: Thu Jan 01 00:00:08 1970 +0000
88 date: Thu Jan 01 00:00:08 1970 +0000
89 summary: r8
89 summary: r8
90
90
91 changeset: 7:e60bfe72517e
91 changeset: 7:e60bfe72517e
92 user: debugbuilddag
92 user: debugbuilddag
93 date: Thu Jan 01 00:00:07 1970 +0000
93 date: Thu Jan 01 00:00:07 1970 +0000
94 summary: r7
94 summary: r7
95
95
96 $ hg status --all -R share-parent
96 $ hg status --all -R share-parent
97 C nf0
97 C nf0
98 C nf1
98 C nf1
99 C nf2
99 C nf2
100 C nf3
100 C nf3
101 C nf4
101 C nf4
102 C nf5
102 C nf5
103 C nf6
103 C nf6
104 C nf7
104 C nf7
105 C nf8
105 C nf8
106 C nf9
106 C nf9
107 $ hg log -l 3 -R share-parent
107 $ hg log -l 3 -R share-parent
108 changeset: 9:0059eb38e4a4
108 changeset: 9:0059eb38e4a4
109 tag: tip
109 tag: tip
110 user: debugbuilddag
110 user: debugbuilddag
111 date: Thu Jan 01 00:00:09 1970 +0000
111 date: Thu Jan 01 00:00:09 1970 +0000
112 summary: r9
112 summary: r9
113
113
114 changeset: 8:4d5be70c8130
114 changeset: 8:4d5be70c8130
115 user: debugbuilddag
115 user: debugbuilddag
116 date: Thu Jan 01 00:00:08 1970 +0000
116 date: Thu Jan 01 00:00:08 1970 +0000
117 summary: r8
117 summary: r8
118
118
119 changeset: 7:e60bfe72517e
119 changeset: 7:e60bfe72517e
120 user: debugbuilddag
120 user: debugbuilddag
121 date: Thu Jan 01 00:00:07 1970 +0000
121 date: Thu Jan 01 00:00:07 1970 +0000
122 summary: r7
122 summary: r7
123
123
124
124
125 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=no --quiet --run
125 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=no --quiet --run
126 upgrade will perform the following actions:
126 upgrade will perform the following actions:
127
127
128 requirements
128 requirements
129 preserved: * (glob)
129 preserved: * (glob)
130 removed: dirstate-v2
130 removed: dirstate-v2
131
131
132 no revlogs to process
132 no revlogs to process
133
133
134 $ hg debugformat -R share-child | grep dirstate-v2
134 $ hg debugformat -R share-child | grep dirstate-v2
135 dirstate-v2: no
135 dirstate-v2: no
136 $ hg debugformat -R share-parent | grep dirstate-v2
136 $ hg debugformat -R share-parent | grep dirstate-v2
137 dirstate-v2: no
137 dirstate-v2: no
138 $ hg status --all -R share-child
138 $ hg status --all -R share-child
139 C nf0
139 C nf0
140 C nf1
140 C nf1
141 C nf2
141 C nf2
142 C nf3
142 C nf3
143 C nf4
143 C nf4
144 C nf5
144 C nf5
145 C nf6
145 C nf6
146 C nf7
146 C nf7
147 C nf8
147 C nf8
148 C nf9
148 C nf9
149 $ hg log -l 3 -R share-child
149 $ hg log -l 3 -R share-child
150 changeset: 9:0059eb38e4a4
150 changeset: 9:0059eb38e4a4
151 tag: tip
151 tag: tip
152 user: debugbuilddag
152 user: debugbuilddag
153 date: Thu Jan 01 00:00:09 1970 +0000
153 date: Thu Jan 01 00:00:09 1970 +0000
154 summary: r9
154 summary: r9
155
155
156 changeset: 8:4d5be70c8130
156 changeset: 8:4d5be70c8130
157 user: debugbuilddag
157 user: debugbuilddag
158 date: Thu Jan 01 00:00:08 1970 +0000
158 date: Thu Jan 01 00:00:08 1970 +0000
159 summary: r8
159 summary: r8
160
160
161 changeset: 7:e60bfe72517e
161 changeset: 7:e60bfe72517e
162 user: debugbuilddag
162 user: debugbuilddag
163 date: Thu Jan 01 00:00:07 1970 +0000
163 date: Thu Jan 01 00:00:07 1970 +0000
164 summary: r7
164 summary: r7
165
165
166 $ hg status --all -R share-parent
166 $ hg status --all -R share-parent
167 C nf0
167 C nf0
168 C nf1
168 C nf1
169 C nf2
169 C nf2
170 C nf3
170 C nf3
171 C nf4
171 C nf4
172 C nf5
172 C nf5
173 C nf6
173 C nf6
174 C nf7
174 C nf7
175 C nf8
175 C nf8
176 C nf9
176 C nf9
177 $ hg log -l 3 -R share-parent
177 $ hg log -l 3 -R share-parent
178 changeset: 9:0059eb38e4a4
178 changeset: 9:0059eb38e4a4
179 tag: tip
179 tag: tip
180 user: debugbuilddag
180 user: debugbuilddag
181 date: Thu Jan 01 00:00:09 1970 +0000
181 date: Thu Jan 01 00:00:09 1970 +0000
182 summary: r9
182 summary: r9
183
183
184 changeset: 8:4d5be70c8130
184 changeset: 8:4d5be70c8130
185 user: debugbuilddag
185 user: debugbuilddag
186 date: Thu Jan 01 00:00:08 1970 +0000
186 date: Thu Jan 01 00:00:08 1970 +0000
187 summary: r8
187 summary: r8
188
188
189 changeset: 7:e60bfe72517e
189 changeset: 7:e60bfe72517e
190 user: debugbuilddag
190 user: debugbuilddag
191 date: Thu Jan 01 00:00:07 1970 +0000
191 date: Thu Jan 01 00:00:07 1970 +0000
192 summary: r7
192 summary: r7
193
193
194
194
195 Do not yet support upgrading treemanifest repos
195 Do not yet support upgrading treemanifest repos
196
196
197 $ hg --config experimental.treemanifest=true init treemanifest
197 $ hg --config experimental.treemanifest=true init treemanifest
198 $ hg -R treemanifest debugupgraderepo
198 $ hg -R treemanifest debugupgraderepo
199 abort: cannot upgrade repository; unsupported source requirement: treemanifest
199 abort: cannot upgrade repository; unsupported source requirement: treemanifest
200 [255]
200 [255]
201
201
202 Cannot add treemanifest requirement during upgrade
202 Cannot add treemanifest requirement during upgrade
203
203
204 $ hg init disallowaddedreq
204 $ hg init disallowaddedreq
205 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
205 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
206 abort: cannot upgrade repository; do not support adding requirement: treemanifest
206 abort: cannot upgrade repository; do not support adding requirement: treemanifest
207 [255]
207 [255]
208
208
209 An upgrade of a repository created with recommended settings only suggests optimizations
209 An upgrade of a repository created with recommended settings only suggests optimizations
210
210
211 $ hg init empty
211 $ hg init empty
212 $ cd empty
212 $ cd empty
213 $ hg debugformat
213 $ hg debugformat
214 format-variant repo
214 format-variant repo
215 fncache: yes
215 fncache: yes
216 dirstate-v2: no
216 dirstate-v2: no
217 tracked-hint: no
217 tracked-hint: no
218 dotencode: yes
218 dotencode: yes
219 generaldelta: yes
219 generaldelta: yes
220 share-safe: yes
220 share-safe: yes
221 sparserevlog: yes
221 sparserevlog: yes
222 persistent-nodemap: no (no-rust !)
222 persistent-nodemap: no (no-rust !)
223 persistent-nodemap: yes (rust !)
223 persistent-nodemap: yes (rust !)
224 copies-sdc: no
224 copies-sdc: no
225 revlog-v2: no
225 revlog-v2: no
226 changelog-v2: no
226 changelog-v2: no
227 plain-cl-delta: yes
227 plain-cl-delta: yes
228 compression: zlib
228 compression: zlib
229 compression-level: default
229 compression-level: default
230 $ hg debugformat --verbose
230 $ hg debugformat --verbose
231 format-variant repo config default
231 format-variant repo config default
232 fncache: yes yes yes
232 fncache: yes yes yes
233 dirstate-v2: no no no
233 dirstate-v2: no no no
234 tracked-hint: no no no
234 tracked-hint: no no no
235 dotencode: yes yes yes
235 dotencode: yes yes yes
236 generaldelta: yes yes yes
236 generaldelta: yes yes yes
237 share-safe: yes yes yes
237 share-safe: yes yes yes
238 sparserevlog: yes yes yes
238 sparserevlog: yes yes yes
239 persistent-nodemap: no no no (no-rust !)
239 persistent-nodemap: no no no (no-rust !)
240 persistent-nodemap: yes yes no (rust !)
240 persistent-nodemap: yes yes no (rust !)
241 copies-sdc: no no no
241 copies-sdc: no no no
242 revlog-v2: no no no
242 revlog-v2: no no no
243 changelog-v2: no no no
243 changelog-v2: no no no
244 plain-cl-delta: yes yes yes
244 plain-cl-delta: yes yes yes
245 compression: zlib zlib zlib (no-zstd !)
245 compression: zlib zlib zlib (no-zstd !)
246 compression: zlib zlib zstd (zstd !)
246 compression: zlib zlib zstd (zstd !)
247 compression-level: default default default
247 compression-level: default default default
248 $ hg debugformat --verbose --config format.usefncache=no
248 $ hg debugformat --verbose --config format.usefncache=no
249 format-variant repo config default
249 format-variant repo config default
250 fncache: yes no yes
250 fncache: yes no yes
251 dirstate-v2: no no no
251 dirstate-v2: no no no
252 tracked-hint: no no no
252 tracked-hint: no no no
253 dotencode: yes no yes
253 dotencode: yes no yes
254 generaldelta: yes yes yes
254 generaldelta: yes yes yes
255 share-safe: yes yes yes
255 share-safe: yes yes yes
256 sparserevlog: yes yes yes
256 sparserevlog: yes yes yes
257 persistent-nodemap: no no no (no-rust !)
257 persistent-nodemap: no no no (no-rust !)
258 persistent-nodemap: yes yes no (rust !)
258 persistent-nodemap: yes yes no (rust !)
259 copies-sdc: no no no
259 copies-sdc: no no no
260 revlog-v2: no no no
260 revlog-v2: no no no
261 changelog-v2: no no no
261 changelog-v2: no no no
262 plain-cl-delta: yes yes yes
262 plain-cl-delta: yes yes yes
263 compression: zlib zlib zlib (no-zstd !)
263 compression: zlib zlib zlib (no-zstd !)
264 compression: zlib zlib zstd (zstd !)
264 compression: zlib zlib zstd (zstd !)
265 compression-level: default default default
265 compression-level: default default default
266 $ hg debugformat --verbose --config format.usefncache=no --color=debug
266 $ hg debugformat --verbose --config format.usefncache=no --color=debug
267 format-variant repo config default
267 format-variant repo config default
268 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
268 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
269 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
269 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
270 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
270 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
271 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
271 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
272 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
272 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
273 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
273 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
274 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
274 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
275 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
275 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
276 [formatvariant.name.mismatchdefault|persistent-nodemap:][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
276 [formatvariant.name.mismatchdefault|persistent-nodemap:][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
277 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
277 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
278 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
278 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
279 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
279 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
280 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
280 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
281 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
281 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
282 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
282 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
283 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
283 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
284 $ hg debugformat -Tjson
284 $ hg debugformat -Tjson
285 [
285 [
286 {
286 {
287 "config": true,
287 "config": true,
288 "default": true,
288 "default": true,
289 "name": "fncache",
289 "name": "fncache",
290 "repo": true
290 "repo": true
291 },
291 },
292 {
292 {
293 "config": false,
293 "config": false,
294 "default": false,
294 "default": false,
295 "name": "dirstate-v2",
295 "name": "dirstate-v2",
296 "repo": false
296 "repo": false
297 },
297 },
298 {
298 {
299 "config": false,
299 "config": false,
300 "default": false,
300 "default": false,
301 "name": "tracked-hint",
301 "name": "tracked-hint",
302 "repo": false
302 "repo": false
303 },
303 },
304 {
304 {
305 "config": true,
305 "config": true,
306 "default": true,
306 "default": true,
307 "name": "dotencode",
307 "name": "dotencode",
308 "repo": true
308 "repo": true
309 },
309 },
310 {
310 {
311 "config": true,
311 "config": true,
312 "default": true,
312 "default": true,
313 "name": "generaldelta",
313 "name": "generaldelta",
314 "repo": true
314 "repo": true
315 },
315 },
316 {
316 {
317 "config": true,
317 "config": true,
318 "default": true,
318 "default": true,
319 "name": "share-safe",
319 "name": "share-safe",
320 "repo": true
320 "repo": true
321 },
321 },
322 {
322 {
323 "config": true,
323 "config": true,
324 "default": true,
324 "default": true,
325 "name": "sparserevlog",
325 "name": "sparserevlog",
326 "repo": true
326 "repo": true
327 },
327 },
328 {
328 {
329 "config": false, (no-rust !)
329 "config": false, (no-rust !)
330 "config": true, (rust !)
330 "config": true, (rust !)
331 "default": false,
331 "default": false,
332 "name": "persistent-nodemap",
332 "name": "persistent-nodemap",
333 "repo": false (no-rust !)
333 "repo": false (no-rust !)
334 "repo": true (rust !)
334 "repo": true (rust !)
335 },
335 },
336 {
336 {
337 "config": false,
337 "config": false,
338 "default": false,
338 "default": false,
339 "name": "copies-sdc",
339 "name": "copies-sdc",
340 "repo": false
340 "repo": false
341 },
341 },
342 {
342 {
343 "config": false,
343 "config": false,
344 "default": false,
344 "default": false,
345 "name": "revlog-v2",
345 "name": "revlog-v2",
346 "repo": false
346 "repo": false
347 },
347 },
348 {
348 {
349 "config": false,
349 "config": false,
350 "default": false,
350 "default": false,
351 "name": "changelog-v2",
351 "name": "changelog-v2",
352 "repo": false
352 "repo": false
353 },
353 },
354 {
354 {
355 "config": true,
355 "config": true,
356 "default": true,
356 "default": true,
357 "name": "plain-cl-delta",
357 "name": "plain-cl-delta",
358 "repo": true
358 "repo": true
359 },
359 },
360 {
360 {
361 "config": "zlib",
361 "config": "zlib",
362 "default": "zlib", (no-zstd !)
362 "default": "zlib", (no-zstd !)
363 "default": "zstd", (zstd !)
363 "default": "zstd", (zstd !)
364 "name": "compression",
364 "name": "compression",
365 "repo": "zlib"
365 "repo": "zlib"
366 },
366 },
367 {
367 {
368 "config": "default",
368 "config": "default",
369 "default": "default",
369 "default": "default",
370 "name": "compression-level",
370 "name": "compression-level",
371 "repo": "default"
371 "repo": "default"
372 }
372 }
373 ]
373 ]
374 $ hg debugupgraderepo
374 $ hg debugupgraderepo
375 (no format upgrades found in existing repository)
375 (no format upgrades found in existing repository)
376 performing an upgrade with "--run" will make the following changes:
376 performing an upgrade with "--run" will make the following changes:
377
377
378 requirements
378 requirements
379 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
379 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
380 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
380 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
381
381
382 no revlogs to process
382 no revlogs to process
383
383
384 additional optimizations are available by specifying "--optimize <name>":
384 additional optimizations are available by specifying "--optimize <name>":
385
385
386 re-delta-parent
386 re-delta-parent
387 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
387 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
388
388
389 re-delta-multibase
389 re-delta-multibase
390 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
390 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
391
391
392 re-delta-all
392 re-delta-all
393 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
393 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
394
394
395 re-delta-fulladd
395 re-delta-fulladd
396 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
396 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
397
397
398
398
399 $ hg debugupgraderepo --quiet
399 $ hg debugupgraderepo --quiet
400 requirements
400 requirements
401 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
401 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
402 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
402 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
403
403
404 no revlogs to process
404 no revlogs to process
405
405
406
406
407 --optimize can be used to add optimizations
407 --optimize can be used to add optimizations
408
408
409 $ hg debugupgrade --optimize 're-delta-parent'
409 $ hg debugupgrade --optimize 're-delta-parent'
410 (no format upgrades found in existing repository)
410 (no format upgrades found in existing repository)
411 performing an upgrade with "--run" will make the following changes:
411 performing an upgrade with "--run" will make the following changes:
412
412
413 requirements
413 requirements
414 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
414 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
415 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
415 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
416
416
417 optimisations: re-delta-parent
417 optimisations: re-delta-parent
418
418
419 re-delta-parent
419 re-delta-parent
420 deltas within internal storage will choose a new base revision if needed
420 deltas within internal storage will choose a new base revision if needed
421
421
422 processed revlogs:
422 processed revlogs:
423 - all-filelogs
423 - all-filelogs
424 - changelog
424 - changelog
425 - manifest
425 - manifest
426
426
427 additional optimizations are available by specifying "--optimize <name>":
427 additional optimizations are available by specifying "--optimize <name>":
428
428
429 re-delta-multibase
429 re-delta-multibase
430 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
430 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
431
431
432 re-delta-all
432 re-delta-all
433 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
433 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
434
434
435 re-delta-fulladd
435 re-delta-fulladd
436 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
436 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
437
437
438
438
439 modern form of the option
439 modern form of the option
440
440
441 $ hg debugupgrade --optimize re-delta-parent
441 $ hg debugupgrade --optimize re-delta-parent
442 (no format upgrades found in existing repository)
442 (no format upgrades found in existing repository)
443 performing an upgrade with "--run" will make the following changes:
443 performing an upgrade with "--run" will make the following changes:
444
444
445 requirements
445 requirements
446 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
446 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
447 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
447 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
448
448
449 optimisations: re-delta-parent
449 optimisations: re-delta-parent
450
450
451 re-delta-parent
451 re-delta-parent
452 deltas within internal storage will choose a new base revision if needed
452 deltas within internal storage will choose a new base revision if needed
453
453
454 processed revlogs:
454 processed revlogs:
455 - all-filelogs
455 - all-filelogs
456 - changelog
456 - changelog
457 - manifest
457 - manifest
458
458
459 additional optimizations are available by specifying "--optimize <name>":
459 additional optimizations are available by specifying "--optimize <name>":
460
460
461 re-delta-multibase
461 re-delta-multibase
462 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
462 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
463
463
464 re-delta-all
464 re-delta-all
465 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
465 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
466
466
467 re-delta-fulladd
467 re-delta-fulladd
468 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
468 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
469
469
470
470
471 $ hg debugupgrade --optimize re-delta-parent --quiet
471 $ hg debugupgrade --optimize re-delta-parent --quiet
472 requirements
472 requirements
473 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
473 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
474 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
474 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
475
475
476 optimisations: re-delta-parent
476 optimisations: re-delta-parent
477
477
478 processed revlogs:
478 processed revlogs:
479 - all-filelogs
479 - all-filelogs
480 - changelog
480 - changelog
481 - manifest
481 - manifest
482
482
483
483
484 passing multiple optimization:
484 passing multiple optimization:
485
485
486 $ hg debugupgrade --optimize re-delta-parent --optimize re-delta-multibase --quiet
486 $ hg debugupgrade --optimize re-delta-parent --optimize re-delta-multibase --quiet
487 requirements
487 requirements
488 preserved: * (glob)
488 preserved: * (glob)
489
489
490 optimisations: re-delta-multibase, re-delta-parent
490 optimisations: re-delta-multibase, re-delta-parent
491
491
492 processed revlogs:
492 processed revlogs:
493 - all-filelogs
493 - all-filelogs
494 - changelog
494 - changelog
495 - manifest
495 - manifest
496
496
497
497
498 unknown optimization:
498 unknown optimization:
499
499
500 $ hg debugupgrade --optimize foobar
500 $ hg debugupgrade --optimize foobar
501 abort: unknown optimization action requested: foobar
501 abort: unknown optimization action requested: foobar
502 (run without arguments to see valid optimizations)
502 (run without arguments to see valid optimizations)
503 [255]
503 [255]
504
504
505 Various sub-optimal detections work
505 Various sub-optimal detections work
506
506
507 $ cat > .hg/requires << EOF
507 $ cat > .hg/requires << EOF
508 > revlogv1
508 > revlogv1
509 > store
509 > store
510 > EOF
510 > EOF
511
511
512 $ hg debugformat
512 $ hg debugformat
513 format-variant repo
513 format-variant repo
514 fncache: no
514 fncache: no
515 dirstate-v2: no
515 dirstate-v2: no
516 tracked-hint: no
516 tracked-hint: no
517 dotencode: no
517 dotencode: no
518 generaldelta: no
518 generaldelta: no
519 share-safe: no
519 share-safe: no
520 sparserevlog: no
520 sparserevlog: no
521 persistent-nodemap: no
521 persistent-nodemap: no
522 copies-sdc: no
522 copies-sdc: no
523 revlog-v2: no
523 revlog-v2: no
524 changelog-v2: no
524 changelog-v2: no
525 plain-cl-delta: yes
525 plain-cl-delta: yes
526 compression: zlib
526 compression: zlib
527 compression-level: default
527 compression-level: default
528 $ hg debugformat --verbose
528 $ hg debugformat --verbose
529 format-variant repo config default
529 format-variant repo config default
530 fncache: no yes yes
530 fncache: no yes yes
531 dirstate-v2: no no no
531 dirstate-v2: no no no
532 tracked-hint: no no no
532 tracked-hint: no no no
533 dotencode: no yes yes
533 dotencode: no yes yes
534 generaldelta: no yes yes
534 generaldelta: no yes yes
535 share-safe: no yes yes
535 share-safe: no yes yes
536 sparserevlog: no yes yes
536 sparserevlog: no yes yes
537 persistent-nodemap: no no no (no-rust !)
537 persistent-nodemap: no no no (no-rust !)
538 persistent-nodemap: no yes no (rust !)
538 persistent-nodemap: no yes no (rust !)
539 copies-sdc: no no no
539 copies-sdc: no no no
540 revlog-v2: no no no
540 revlog-v2: no no no
541 changelog-v2: no no no
541 changelog-v2: no no no
542 plain-cl-delta: yes yes yes
542 plain-cl-delta: yes yes yes
543 compression: zlib zlib zlib (no-zstd !)
543 compression: zlib zlib zlib (no-zstd !)
544 compression: zlib zlib zstd (zstd !)
544 compression: zlib zlib zstd (zstd !)
545 compression-level: default default default
545 compression-level: default default default
546 $ hg debugformat --verbose --config format.usegeneraldelta=no
546 $ hg debugformat --verbose --config format.usegeneraldelta=no
547 format-variant repo config default
547 format-variant repo config default
548 fncache: no yes yes
548 fncache: no yes yes
549 dirstate-v2: no no no
549 dirstate-v2: no no no
550 tracked-hint: no no no
550 tracked-hint: no no no
551 dotencode: no yes yes
551 dotencode: no yes yes
552 generaldelta: no no yes
552 generaldelta: no no yes
553 share-safe: no yes yes
553 share-safe: no yes yes
554 sparserevlog: no no yes
554 sparserevlog: no no yes
555 persistent-nodemap: no no no (no-rust !)
555 persistent-nodemap: no no no (no-rust !)
556 persistent-nodemap: no yes no (rust !)
556 persistent-nodemap: no yes no (rust !)
557 copies-sdc: no no no
557 copies-sdc: no no no
558 revlog-v2: no no no
558 revlog-v2: no no no
559 changelog-v2: no no no
559 changelog-v2: no no no
560 plain-cl-delta: yes yes yes
560 plain-cl-delta: yes yes yes
561 compression: zlib zlib zlib (no-zstd !)
561 compression: zlib zlib zlib (no-zstd !)
562 compression: zlib zlib zstd (zstd !)
562 compression: zlib zlib zstd (zstd !)
563 compression-level: default default default
563 compression-level: default default default
564 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
564 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
565 format-variant repo config default
565 format-variant repo config default
566 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
566 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
567 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
567 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
568 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
568 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
569 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
569 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
570 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
570 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
571 [formatvariant.name.mismatchconfig|share-safe: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
571 [formatvariant.name.mismatchconfig|share-safe: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
572 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
572 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
573 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
573 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
574 [formatvariant.name.mismatchconfig|persistent-nodemap:][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
574 [formatvariant.name.mismatchconfig|persistent-nodemap:][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
575 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
575 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
576 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
576 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
577 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
577 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
578 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
578 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
579 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
579 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
580 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
580 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
581 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
581 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
582 $ hg debugupgraderepo
582 $ hg debugupgraderepo
583 note: selecting all-filelogs for processing to change: dotencode
583 note: selecting all-filelogs for processing to change: dotencode
584 note: selecting all-manifestlogs for processing to change: dotencode
584 note: selecting all-manifestlogs for processing to change: dotencode
585 note: selecting changelog for processing to change: dotencode
585 note: selecting changelog for processing to change: dotencode
586
586
587 repository lacks features recommended by current config options:
587 repository lacks features recommended by current config options:
588
588
589 fncache
589 fncache
590 long and reserved filenames may not work correctly; repository performance is sub-optimal
590 long and reserved filenames may not work correctly; repository performance is sub-optimal
591
591
592 dotencode
592 dotencode
593 storage of filenames beginning with a period or space may not work correctly
593 storage of filenames beginning with a period or space may not work correctly
594
594
595 generaldelta
595 generaldelta
596 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
596 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
597
597
598 share-safe
598 share-safe
599 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
599 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
600
600
601 sparserevlog
601 sparserevlog
602 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
602 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
603
603
604 persistent-nodemap (rust !)
604 persistent-nodemap (rust !)
605 persist the node -> rev mapping on disk to speedup lookup (rust !)
605 persist the node -> rev mapping on disk to speedup lookup (rust !)
606 (rust !)
606 (rust !)
607
607
608 performing an upgrade with "--run" will make the following changes:
608 performing an upgrade with "--run" will make the following changes:
609
609
610 requirements
610 requirements
611 preserved: revlogv1, store
611 preserved: revlogv1, store
612 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
612 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
613 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
613 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
614
614
615 fncache
615 fncache
616 repository will be more resilient to storing certain paths and performance of certain operations should be improved
616 repository will be more resilient to storing certain paths and performance of certain operations should be improved
617
617
618 dotencode
618 dotencode
619 repository will be better able to store files beginning with a space or period
619 repository will be better able to store files beginning with a space or period
620
620
621 generaldelta
621 generaldelta
622 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
622 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
623
623
624 share-safe
624 share-safe
625 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
625 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
626
626
627 sparserevlog
627 sparserevlog
628 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
628 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
629
629
630 persistent-nodemap (rust !)
630 persistent-nodemap (rust !)
631 Speedup revision lookup by node id. (rust !)
631 Speedup revision lookup by node id. (rust !)
632 (rust !)
632 (rust !)
633 processed revlogs:
633 processed revlogs:
634 - all-filelogs
634 - all-filelogs
635 - changelog
635 - changelog
636 - manifest
636 - manifest
637
637
638 additional optimizations are available by specifying "--optimize <name>":
638 additional optimizations are available by specifying "--optimize <name>":
639
639
640 re-delta-parent
640 re-delta-parent
641 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
641 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
642
642
643 re-delta-multibase
643 re-delta-multibase
644 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
644 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
645
645
646 re-delta-all
646 re-delta-all
647 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
647 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
648
648
649 re-delta-fulladd
649 re-delta-fulladd
650 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
650 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
651
651
652 $ hg debugupgraderepo --quiet
652 $ hg debugupgraderepo --quiet
653 requirements
653 requirements
654 preserved: revlogv1, store
654 preserved: revlogv1, store
655 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
655 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
656 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
656 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
657
657
658 processed revlogs:
658 processed revlogs:
659 - all-filelogs
659 - all-filelogs
660 - changelog
660 - changelog
661 - manifest
661 - manifest
662
662
663
663
664 $ hg --config format.dotencode=false debugupgraderepo
664 $ hg --config format.dotencode=false debugupgraderepo
665 note: selecting all-filelogs for processing to change: fncache
665 note: selecting all-filelogs for processing to change: fncache
666 note: selecting all-manifestlogs for processing to change: fncache
666 note: selecting all-manifestlogs for processing to change: fncache
667 note: selecting changelog for processing to change: fncache
667 note: selecting changelog for processing to change: fncache
668
668
669 repository lacks features recommended by current config options:
669 repository lacks features recommended by current config options:
670
670
671 fncache
671 fncache
672 long and reserved filenames may not work correctly; repository performance is sub-optimal
672 long and reserved filenames may not work correctly; repository performance is sub-optimal
673
673
674 generaldelta
674 generaldelta
675 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
675 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
676
676
677 share-safe
677 share-safe
678 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
678 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
679
679
680 sparserevlog
680 sparserevlog
681 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
681 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
682
682
683 persistent-nodemap (rust !)
683 persistent-nodemap (rust !)
684 persist the node -> rev mapping on disk to speedup lookup (rust !)
684 persist the node -> rev mapping on disk to speedup lookup (rust !)
685 (rust !)
685 (rust !)
686 repository lacks features used by the default config options:
686 repository lacks features used by the default config options:
687
687
688 dotencode
688 dotencode
689 storage of filenames beginning with a period or space may not work correctly
689 storage of filenames beginning with a period or space may not work correctly
690
690
691
691
692 performing an upgrade with "--run" will make the following changes:
692 performing an upgrade with "--run" will make the following changes:
693
693
694 requirements
694 requirements
695 preserved: revlogv1, store
695 preserved: revlogv1, store
696 added: fncache, generaldelta, share-safe, sparserevlog (no-rust !)
696 added: fncache, generaldelta, share-safe, sparserevlog (no-rust !)
697 added: fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
697 added: fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
698
698
699 fncache
699 fncache
700 repository will be more resilient to storing certain paths and performance of certain operations should be improved
700 repository will be more resilient to storing certain paths and performance of certain operations should be improved
701
701
702 generaldelta
702 generaldelta
703 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
703 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
704
704
705 share-safe
705 share-safe
706 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
706 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
707
707
708 sparserevlog
708 sparserevlog
709 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
709 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
710
710
711 persistent-nodemap (rust !)
711 persistent-nodemap (rust !)
712 Speedup revision lookup by node id. (rust !)
712 Speedup revision lookup by node id. (rust !)
713 (rust !)
713 (rust !)
714 processed revlogs:
714 processed revlogs:
715 - all-filelogs
715 - all-filelogs
716 - changelog
716 - changelog
717 - manifest
717 - manifest
718
718
719 additional optimizations are available by specifying "--optimize <name>":
719 additional optimizations are available by specifying "--optimize <name>":
720
720
721 re-delta-parent
721 re-delta-parent
722 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
722 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
723
723
724 re-delta-multibase
724 re-delta-multibase
725 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
725 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
726
726
727 re-delta-all
727 re-delta-all
728 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
728 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
729
729
730 re-delta-fulladd
730 re-delta-fulladd
731 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
731 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
732
732
733
733
734 $ cd ..
734 $ cd ..
735
735
736 Upgrading a repository that is already modern essentially no-ops
736 Upgrading a repository that is already modern essentially no-ops
737
737
738 $ hg init modern
738 $ hg init modern
739 $ hg -R modern debugupgraderepo --run
739 $ hg -R modern debugupgraderepo --run
740 nothing to do
740 nothing to do
741
741
742 Upgrading a repository to generaldelta works
742 Upgrading a repository to generaldelta works
743
743
744 $ hg --config format.usegeneraldelta=false init upgradegd
744 $ hg --config format.usegeneraldelta=false init upgradegd
745 $ cd upgradegd
745 $ cd upgradegd
746 $ touch f0
746 $ touch f0
747 $ hg -q commit -A -m initial
747 $ hg -q commit -A -m initial
748 $ mkdir FooBarDirectory.d
748 $ mkdir FooBarDirectory.d
749 $ touch FooBarDirectory.d/f1
749 $ touch FooBarDirectory.d/f1
750 $ hg -q commit -A -m 'add f1'
750 $ hg -q commit -A -m 'add f1'
751 $ hg -q up -r 0
751 $ hg -q up -r 0
752 >>> import random
752 >>> import random
753 >>> random.seed(0) # have a reproducible content
753 >>> random.seed(0) # have a reproducible content
754 >>> with open("f2", "wb") as f:
754 >>> with open("f2", "wb") as f:
755 ... for i in range(100000):
755 ... for i in range(100000):
756 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
756 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
757 $ hg -q commit -A -m 'add f2'
757 $ hg -q commit -A -m 'add f2'
758
758
759 make sure we have a .d file
759 make sure we have a .d file
760
760
761 $ ls -d .hg/store/data/*
761 $ ls -d .hg/store/data/*
762 .hg/store/data/_foo_bar_directory.d.hg
762 .hg/store/data/_foo_bar_directory.d.hg
763 .hg/store/data/f0.i
763 .hg/store/data/f0.i
764 .hg/store/data/f2.d
764 .hg/store/data/f2.d
765 .hg/store/data/f2.i
765 .hg/store/data/f2.i
766
766
767 $ hg debugupgraderepo --run --config format.sparse-revlog=false
767 $ hg debugupgraderepo --run --config format.sparse-revlog=false
768 note: selecting all-filelogs for processing to change: generaldelta
768 note: selecting all-filelogs for processing to change: generaldelta
769 note: selecting all-manifestlogs for processing to change: generaldelta
769 note: selecting all-manifestlogs for processing to change: generaldelta
770 note: selecting changelog for processing to change: generaldelta
770 note: selecting changelog for processing to change: generaldelta
771
771
772 upgrade will perform the following actions:
772 upgrade will perform the following actions:
773
773
774 requirements
774 requirements
775 preserved: dotencode, fncache, revlogv1, share-safe, store (no-rust !)
775 preserved: dotencode, fncache, revlogv1, share-safe, store (no-rust !)
776 preserved: dotencode, fncache, persistent-nodemap, revlogv1, share-safe, store (rust !)
776 preserved: dotencode, fncache, persistent-nodemap, revlogv1, share-safe, store (rust !)
777 added: generaldelta
777 added: generaldelta
778
778
779 generaldelta
779 generaldelta
780 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
780 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
781
781
782 processed revlogs:
782 processed revlogs:
783 - all-filelogs
783 - all-filelogs
784 - changelog
784 - changelog
785 - manifest
785 - manifest
786
786
787 beginning upgrade...
787 beginning upgrade...
788 repository locked and read-only
788 repository locked and read-only
789 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
789 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
790 (it is safe to interrupt this process any time before data migration completes)
790 (it is safe to interrupt this process any time before data migration completes)
791 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
791 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
792 migrating 519 KB in store; 1.05 MB tracked data
792 migrating 519 KB in store; 1.05 MB tracked data
793 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
793 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
794 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
794 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
795 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
795 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
796 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
796 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
797 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
797 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
798 finished migrating 3 changelog revisions; change in size: 0 bytes
798 finished migrating 3 changelog revisions; change in size: 0 bytes
799 finished migrating 9 total revisions; total change in store size: -17 bytes
799 finished migrating 9 total revisions; total change in store size: -17 bytes
800 copying phaseroots
800 copying phaseroots
801 copying requires
801 copying requires
802 data fully upgraded in a temporary repository
802 data fully upgraded in a temporary repository
803 marking source repository as being upgraded; clients will be unable to read from repository
803 marking source repository as being upgraded; clients will be unable to read from repository
804 starting in-place swap of repository data
804 starting in-place swap of repository data
805 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
805 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
806 replacing store...
806 replacing store...
807 store replacement complete; repository was inconsistent for *s (glob)
807 store replacement complete; repository was inconsistent for *s (glob)
808 finalizing requirements file and making repository readable again
808 finalizing requirements file and making repository readable again
809 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
809 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
810 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
810 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
811 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
811 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
812
812
813 Original requirements backed up
813 Original requirements backed up
814
814
815 $ cat .hg/upgradebackup.*/requires
815 $ cat .hg/upgradebackup.*/requires
816 share-safe
816 share-safe
817 $ cat .hg/upgradebackup.*/store/requires
817 $ cat .hg/upgradebackup.*/store/requires
818 dotencode
818 dotencode
819 fncache
819 fncache
820 persistent-nodemap (rust !)
820 persistent-nodemap (rust !)
821 revlogv1
821 revlogv1
822 store
822 store
823 upgradeinprogress
823 upgradeinprogress
824
824
825 generaldelta added to original requirements files
825 generaldelta added to original requirements files
826
826
827 $ hg debugrequires
827 $ hg debugrequires
828 dotencode
828 dotencode
829 fncache
829 fncache
830 generaldelta
830 generaldelta
831 persistent-nodemap (rust !)
831 persistent-nodemap (rust !)
832 revlogv1
832 revlogv1
833 share-safe
833 share-safe
834 store
834 store
835
835
836 store directory has files we expect
836 store directory has files we expect
837
837
838 $ ls .hg/store
838 $ ls .hg/store
839 00changelog.i
839 00changelog.i
840 00manifest.i
840 00manifest.i
841 data
841 data
842 fncache
842 fncache
843 phaseroots
843 phaseroots
844 requires
844 requires
845 undo
845 undo
846 undo.backupfiles
846 undo.backupfiles
847 undo.phaseroots
847 undo.phaseroots
848
848
849 manifest should be generaldelta
849 manifest should be generaldelta
850
850
851 $ hg debugrevlog -m | grep flags
851 $ hg debugrevlog -m | grep flags
852 flags : inline, generaldelta
852 flags : inline, generaldelta
853
853
854 verify should be happy
854 verify should be happy
855
855
856 $ hg verify
856 $ hg verify -q
857 checking changesets
858 checking manifests
859 crosschecking files in changesets and manifests
860 checking files
861 checked 3 changesets with 3 changes to 3 files
862
857
863 old store should be backed up
858 old store should be backed up
864
859
865 $ ls -d .hg/upgradebackup.*/
860 $ ls -d .hg/upgradebackup.*/
866 .hg/upgradebackup.*/ (glob)
861 .hg/upgradebackup.*/ (glob)
867 $ ls .hg/upgradebackup.*/store
862 $ ls .hg/upgradebackup.*/store
868 00changelog.i
863 00changelog.i
869 00manifest.i
864 00manifest.i
870 data
865 data
871 fncache
866 fncache
872 phaseroots
867 phaseroots
873 requires
868 requires
874 undo
869 undo
875 undo.backup.fncache
870 undo.backup.fncache
876 undo.backupfiles
871 undo.backupfiles
877 undo.phaseroots
872 undo.phaseroots
878
873
879 unless --no-backup is passed
874 unless --no-backup is passed
880
875
881 $ rm -rf .hg/upgradebackup.*/
876 $ rm -rf .hg/upgradebackup.*/
882 $ hg debugupgraderepo --run --no-backup
877 $ hg debugupgraderepo --run --no-backup
883 note: selecting all-filelogs for processing to change: sparserevlog
878 note: selecting all-filelogs for processing to change: sparserevlog
884 note: selecting all-manifestlogs for processing to change: sparserevlog
879 note: selecting all-manifestlogs for processing to change: sparserevlog
885 note: selecting changelog for processing to change: sparserevlog
880 note: selecting changelog for processing to change: sparserevlog
886
881
887 upgrade will perform the following actions:
882 upgrade will perform the following actions:
888
883
889 requirements
884 requirements
890 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
885 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
891 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
886 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
892 added: sparserevlog
887 added: sparserevlog
893
888
894 sparserevlog
889 sparserevlog
895 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
890 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
896
891
897 processed revlogs:
892 processed revlogs:
898 - all-filelogs
893 - all-filelogs
899 - changelog
894 - changelog
900 - manifest
895 - manifest
901
896
902 beginning upgrade...
897 beginning upgrade...
903 repository locked and read-only
898 repository locked and read-only
904 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
899 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
905 (it is safe to interrupt this process any time before data migration completes)
900 (it is safe to interrupt this process any time before data migration completes)
906 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
901 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
907 migrating 519 KB in store; 1.05 MB tracked data
902 migrating 519 KB in store; 1.05 MB tracked data
908 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
903 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
909 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
904 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
910 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
905 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
911 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
906 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
912 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
907 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
913 finished migrating 3 changelog revisions; change in size: 0 bytes
908 finished migrating 3 changelog revisions; change in size: 0 bytes
914 finished migrating 9 total revisions; total change in store size: 0 bytes
909 finished migrating 9 total revisions; total change in store size: 0 bytes
915 copying phaseroots
910 copying phaseroots
916 copying requires
911 copying requires
917 data fully upgraded in a temporary repository
912 data fully upgraded in a temporary repository
918 marking source repository as being upgraded; clients will be unable to read from repository
913 marking source repository as being upgraded; clients will be unable to read from repository
919 starting in-place swap of repository data
914 starting in-place swap of repository data
920 replacing store...
915 replacing store...
921 store replacement complete; repository was inconsistent for * (glob)
916 store replacement complete; repository was inconsistent for * (glob)
922 finalizing requirements file and making repository readable again
917 finalizing requirements file and making repository readable again
923 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
918 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
924 $ ls -1 .hg/ | grep upgradebackup
919 $ ls -1 .hg/ | grep upgradebackup
925 [1]
920 [1]
926
921
927 We can restrict optimization to some revlog:
922 We can restrict optimization to some revlog:
928
923
929 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
924 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
930 upgrade will perform the following actions:
925 upgrade will perform the following actions:
931
926
932 requirements
927 requirements
933 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
928 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
934 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
929 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
935
930
936 optimisations: re-delta-parent
931 optimisations: re-delta-parent
937
932
938 re-delta-parent
933 re-delta-parent
939 deltas within internal storage will choose a new base revision if needed
934 deltas within internal storage will choose a new base revision if needed
940
935
941 processed revlogs:
936 processed revlogs:
942 - manifest
937 - manifest
943
938
944 beginning upgrade...
939 beginning upgrade...
945 repository locked and read-only
940 repository locked and read-only
946 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
941 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
947 (it is safe to interrupt this process any time before data migration completes)
942 (it is safe to interrupt this process any time before data migration completes)
948 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
943 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
949 migrating 519 KB in store; 1.05 MB tracked data
944 migrating 519 KB in store; 1.05 MB tracked data
950 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
945 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
951 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
946 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
952 blindly copying data/f0.i containing 1 revisions
947 blindly copying data/f0.i containing 1 revisions
953 blindly copying data/f2.i containing 1 revisions
948 blindly copying data/f2.i containing 1 revisions
954 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
949 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
955 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
950 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
956 cloning 3 revisions from 00manifest.i
951 cloning 3 revisions from 00manifest.i
957 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
952 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
958 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
953 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
959 blindly copying 00changelog.i containing 3 revisions
954 blindly copying 00changelog.i containing 3 revisions
960 finished migrating 3 changelog revisions; change in size: 0 bytes
955 finished migrating 3 changelog revisions; change in size: 0 bytes
961 finished migrating 9 total revisions; total change in store size: 0 bytes
956 finished migrating 9 total revisions; total change in store size: 0 bytes
962 copying phaseroots
957 copying phaseroots
963 copying requires
958 copying requires
964 data fully upgraded in a temporary repository
959 data fully upgraded in a temporary repository
965 marking source repository as being upgraded; clients will be unable to read from repository
960 marking source repository as being upgraded; clients will be unable to read from repository
966 starting in-place swap of repository data
961 starting in-place swap of repository data
967 replacing store...
962 replacing store...
968 store replacement complete; repository was inconsistent for *s (glob)
963 store replacement complete; repository was inconsistent for *s (glob)
969 finalizing requirements file and making repository readable again
964 finalizing requirements file and making repository readable again
970 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
965 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
971
966
972 Check that the repo still works fine
967 Check that the repo still works fine
973
968
974 $ hg log -G --stat
969 $ hg log -G --stat
975 @ changeset: 2:fca376863211 (py3 !)
970 @ changeset: 2:fca376863211 (py3 !)
976 | tag: tip
971 | tag: tip
977 | parent: 0:ba592bf28da2
972 | parent: 0:ba592bf28da2
978 | user: test
973 | user: test
979 | date: Thu Jan 01 00:00:00 1970 +0000
974 | date: Thu Jan 01 00:00:00 1970 +0000
980 | summary: add f2
975 | summary: add f2
981 |
976 |
982 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
977 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
983 | 1 files changed, 100000 insertions(+), 0 deletions(-)
978 | 1 files changed, 100000 insertions(+), 0 deletions(-)
984 |
979 |
985 | o changeset: 1:2029ce2354e2
980 | o changeset: 1:2029ce2354e2
986 |/ user: test
981 |/ user: test
987 | date: Thu Jan 01 00:00:00 1970 +0000
982 | date: Thu Jan 01 00:00:00 1970 +0000
988 | summary: add f1
983 | summary: add f1
989 |
984 |
990 |
985 |
991 o changeset: 0:ba592bf28da2
986 o changeset: 0:ba592bf28da2
992 user: test
987 user: test
993 date: Thu Jan 01 00:00:00 1970 +0000
988 date: Thu Jan 01 00:00:00 1970 +0000
994 summary: initial
989 summary: initial
995
990
996
991
997
992
998 $ hg verify
993 $ hg verify -q
999 checking changesets
1000 checking manifests
1001 crosschecking files in changesets and manifests
1002 checking files
1003 checked 3 changesets with 3 changes to 3 files
1004
994
1005 Check we can select negatively
995 Check we can select negatively
1006
996
1007 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
997 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
1008 upgrade will perform the following actions:
998 upgrade will perform the following actions:
1009
999
1010 requirements
1000 requirements
1011 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1001 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1012 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1002 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1013
1003
1014 optimisations: re-delta-parent
1004 optimisations: re-delta-parent
1015
1005
1016 re-delta-parent
1006 re-delta-parent
1017 deltas within internal storage will choose a new base revision if needed
1007 deltas within internal storage will choose a new base revision if needed
1018
1008
1019 processed revlogs:
1009 processed revlogs:
1020 - all-filelogs
1010 - all-filelogs
1021 - changelog
1011 - changelog
1022
1012
1023 beginning upgrade...
1013 beginning upgrade...
1024 repository locked and read-only
1014 repository locked and read-only
1025 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1015 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1026 (it is safe to interrupt this process any time before data migration completes)
1016 (it is safe to interrupt this process any time before data migration completes)
1027 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1017 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1028 migrating 519 KB in store; 1.05 MB tracked data
1018 migrating 519 KB in store; 1.05 MB tracked data
1029 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1019 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1030 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1020 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1031 cloning 1 revisions from data/f0.i
1021 cloning 1 revisions from data/f0.i
1032 cloning 1 revisions from data/f2.i
1022 cloning 1 revisions from data/f2.i
1033 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1023 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1034 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1024 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1035 blindly copying 00manifest.i containing 3 revisions
1025 blindly copying 00manifest.i containing 3 revisions
1036 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1026 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1037 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1027 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1038 cloning 3 revisions from 00changelog.i
1028 cloning 3 revisions from 00changelog.i
1039 finished migrating 3 changelog revisions; change in size: 0 bytes
1029 finished migrating 3 changelog revisions; change in size: 0 bytes
1040 finished migrating 9 total revisions; total change in store size: 0 bytes
1030 finished migrating 9 total revisions; total change in store size: 0 bytes
1041 copying phaseroots
1031 copying phaseroots
1042 copying requires
1032 copying requires
1043 data fully upgraded in a temporary repository
1033 data fully upgraded in a temporary repository
1044 marking source repository as being upgraded; clients will be unable to read from repository
1034 marking source repository as being upgraded; clients will be unable to read from repository
1045 starting in-place swap of repository data
1035 starting in-place swap of repository data
1046 replacing store...
1036 replacing store...
1047 store replacement complete; repository was inconsistent for *s (glob)
1037 store replacement complete; repository was inconsistent for *s (glob)
1048 finalizing requirements file and making repository readable again
1038 finalizing requirements file and making repository readable again
1049 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1039 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1050 $ hg verify
1040 $ hg verify -q
1051 checking changesets
1052 checking manifests
1053 crosschecking files in changesets and manifests
1054 checking files
1055 checked 3 changesets with 3 changes to 3 files
1056
1041
1057 Check that we can select changelog only
1042 Check that we can select changelog only
1058
1043
1059 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
1044 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
1060 upgrade will perform the following actions:
1045 upgrade will perform the following actions:
1061
1046
1062 requirements
1047 requirements
1063 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1048 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1064 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1049 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1065
1050
1066 optimisations: re-delta-parent
1051 optimisations: re-delta-parent
1067
1052
1068 re-delta-parent
1053 re-delta-parent
1069 deltas within internal storage will choose a new base revision if needed
1054 deltas within internal storage will choose a new base revision if needed
1070
1055
1071 processed revlogs:
1056 processed revlogs:
1072 - changelog
1057 - changelog
1073
1058
1074 beginning upgrade...
1059 beginning upgrade...
1075 repository locked and read-only
1060 repository locked and read-only
1076 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1061 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1077 (it is safe to interrupt this process any time before data migration completes)
1062 (it is safe to interrupt this process any time before data migration completes)
1078 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1063 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1079 migrating 519 KB in store; 1.05 MB tracked data
1064 migrating 519 KB in store; 1.05 MB tracked data
1080 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1065 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1081 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
1066 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
1082 blindly copying data/f0.i containing 1 revisions
1067 blindly copying data/f0.i containing 1 revisions
1083 blindly copying data/f2.i containing 1 revisions
1068 blindly copying data/f2.i containing 1 revisions
1084 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1069 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1085 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1070 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1086 blindly copying 00manifest.i containing 3 revisions
1071 blindly copying 00manifest.i containing 3 revisions
1087 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1072 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1088 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1073 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1089 cloning 3 revisions from 00changelog.i
1074 cloning 3 revisions from 00changelog.i
1090 finished migrating 3 changelog revisions; change in size: 0 bytes
1075 finished migrating 3 changelog revisions; change in size: 0 bytes
1091 finished migrating 9 total revisions; total change in store size: 0 bytes
1076 finished migrating 9 total revisions; total change in store size: 0 bytes
1092 copying phaseroots
1077 copying phaseroots
1093 copying requires
1078 copying requires
1094 data fully upgraded in a temporary repository
1079 data fully upgraded in a temporary repository
1095 marking source repository as being upgraded; clients will be unable to read from repository
1080 marking source repository as being upgraded; clients will be unable to read from repository
1096 starting in-place swap of repository data
1081 starting in-place swap of repository data
1097 replacing store...
1082 replacing store...
1098 store replacement complete; repository was inconsistent for *s (glob)
1083 store replacement complete; repository was inconsistent for *s (glob)
1099 finalizing requirements file and making repository readable again
1084 finalizing requirements file and making repository readable again
1100 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1085 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1101 $ hg verify
1086 $ hg verify -q
1102 checking changesets
1103 checking manifests
1104 crosschecking files in changesets and manifests
1105 checking files
1106 checked 3 changesets with 3 changes to 3 files
1107
1087
1108 Check that we can select filelog only
1088 Check that we can select filelog only
1109
1089
1110 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
1090 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
1111 upgrade will perform the following actions:
1091 upgrade will perform the following actions:
1112
1092
1113 requirements
1093 requirements
1114 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1094 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1115 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1095 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1116
1096
1117 optimisations: re-delta-parent
1097 optimisations: re-delta-parent
1118
1098
1119 re-delta-parent
1099 re-delta-parent
1120 deltas within internal storage will choose a new base revision if needed
1100 deltas within internal storage will choose a new base revision if needed
1121
1101
1122 processed revlogs:
1102 processed revlogs:
1123 - all-filelogs
1103 - all-filelogs
1124
1104
1125 beginning upgrade...
1105 beginning upgrade...
1126 repository locked and read-only
1106 repository locked and read-only
1127 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1107 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1128 (it is safe to interrupt this process any time before data migration completes)
1108 (it is safe to interrupt this process any time before data migration completes)
1129 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1109 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1130 migrating 519 KB in store; 1.05 MB tracked data
1110 migrating 519 KB in store; 1.05 MB tracked data
1131 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1111 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1132 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1112 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1133 cloning 1 revisions from data/f0.i
1113 cloning 1 revisions from data/f0.i
1134 cloning 1 revisions from data/f2.i
1114 cloning 1 revisions from data/f2.i
1135 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1115 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1136 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1116 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1137 blindly copying 00manifest.i containing 3 revisions
1117 blindly copying 00manifest.i containing 3 revisions
1138 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1118 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1139 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1119 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1140 blindly copying 00changelog.i containing 3 revisions
1120 blindly copying 00changelog.i containing 3 revisions
1141 finished migrating 3 changelog revisions; change in size: 0 bytes
1121 finished migrating 3 changelog revisions; change in size: 0 bytes
1142 finished migrating 9 total revisions; total change in store size: 0 bytes
1122 finished migrating 9 total revisions; total change in store size: 0 bytes
1143 copying phaseroots
1123 copying phaseroots
1144 copying requires
1124 copying requires
1145 data fully upgraded in a temporary repository
1125 data fully upgraded in a temporary repository
1146 marking source repository as being upgraded; clients will be unable to read from repository
1126 marking source repository as being upgraded; clients will be unable to read from repository
1147 starting in-place swap of repository data
1127 starting in-place swap of repository data
1148 replacing store...
1128 replacing store...
1149 store replacement complete; repository was inconsistent for *s (glob)
1129 store replacement complete; repository was inconsistent for *s (glob)
1150 finalizing requirements file and making repository readable again
1130 finalizing requirements file and making repository readable again
1151 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1131 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1152 $ hg verify
1132 $ hg verify -q
1153 checking changesets
1154 checking manifests
1155 crosschecking files in changesets and manifests
1156 checking files
1157 checked 3 changesets with 3 changes to 3 files
1158
1133
1159
1134
1160 Check you can't skip revlog clone during important format downgrade
1135 Check you can't skip revlog clone during important format downgrade
1161
1136
1162 $ echo "[format]" > .hg/hgrc
1137 $ echo "[format]" > .hg/hgrc
1163 $ echo "sparse-revlog=no" >> .hg/hgrc
1138 $ echo "sparse-revlog=no" >> .hg/hgrc
1164 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
1139 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
1165 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
1140 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
1166
1141
1167 requirements
1142 requirements
1168 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1143 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1169 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1144 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1170 removed: sparserevlog
1145 removed: sparserevlog
1171
1146
1172 optimisations: re-delta-parent
1147 optimisations: re-delta-parent
1173
1148
1174 processed revlogs:
1149 processed revlogs:
1175 - all-filelogs
1150 - all-filelogs
1176 - changelog
1151 - changelog
1177 - manifest
1152 - manifest
1178
1153
1179 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1154 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1180 note: selecting all-filelogs for processing to change: sparserevlog
1155 note: selecting all-filelogs for processing to change: sparserevlog
1181 note: selecting changelog for processing to change: sparserevlog
1156 note: selecting changelog for processing to change: sparserevlog
1182
1157
1183 upgrade will perform the following actions:
1158 upgrade will perform the following actions:
1184
1159
1185 requirements
1160 requirements
1186 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1161 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1187 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1162 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1188 removed: sparserevlog
1163 removed: sparserevlog
1189
1164
1190 optimisations: re-delta-parent
1165 optimisations: re-delta-parent
1191
1166
1192 re-delta-parent
1167 re-delta-parent
1193 deltas within internal storage will choose a new base revision if needed
1168 deltas within internal storage will choose a new base revision if needed
1194
1169
1195 processed revlogs:
1170 processed revlogs:
1196 - all-filelogs
1171 - all-filelogs
1197 - changelog
1172 - changelog
1198 - manifest
1173 - manifest
1199
1174
1200 beginning upgrade...
1175 beginning upgrade...
1201 repository locked and read-only
1176 repository locked and read-only
1202 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1177 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1203 (it is safe to interrupt this process any time before data migration completes)
1178 (it is safe to interrupt this process any time before data migration completes)
1204 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1179 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1205 migrating 519 KB in store; 1.05 MB tracked data
1180 migrating 519 KB in store; 1.05 MB tracked data
1206 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1181 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1207 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1182 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1208 cloning 1 revisions from data/f0.i
1183 cloning 1 revisions from data/f0.i
1209 cloning 1 revisions from data/f2.i
1184 cloning 1 revisions from data/f2.i
1210 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1185 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1211 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1186 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1212 cloning 3 revisions from 00manifest.i
1187 cloning 3 revisions from 00manifest.i
1213 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1188 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1214 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1189 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1215 cloning 3 revisions from 00changelog.i
1190 cloning 3 revisions from 00changelog.i
1216 finished migrating 3 changelog revisions; change in size: 0 bytes
1191 finished migrating 3 changelog revisions; change in size: 0 bytes
1217 finished migrating 9 total revisions; total change in store size: 0 bytes
1192 finished migrating 9 total revisions; total change in store size: 0 bytes
1218 copying phaseroots
1193 copying phaseroots
1219 copying requires
1194 copying requires
1220 data fully upgraded in a temporary repository
1195 data fully upgraded in a temporary repository
1221 marking source repository as being upgraded; clients will be unable to read from repository
1196 marking source repository as being upgraded; clients will be unable to read from repository
1222 starting in-place swap of repository data
1197 starting in-place swap of repository data
1223 replacing store...
1198 replacing store...
1224 store replacement complete; repository was inconsistent for *s (glob)
1199 store replacement complete; repository was inconsistent for *s (glob)
1225 finalizing requirements file and making repository readable again
1200 finalizing requirements file and making repository readable again
1226 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1201 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1227 $ hg verify
1202 $ hg verify -q
1228 checking changesets
1229 checking manifests
1230 crosschecking files in changesets and manifests
1231 checking files
1232 checked 3 changesets with 3 changes to 3 files
1233
1203
1234 Check you can't skip revlog clone during important format upgrade
1204 Check you can't skip revlog clone during important format upgrade
1235
1205
1236 $ echo "sparse-revlog=yes" >> .hg/hgrc
1206 $ echo "sparse-revlog=yes" >> .hg/hgrc
1237 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1207 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1238 note: selecting all-filelogs for processing to change: sparserevlog
1208 note: selecting all-filelogs for processing to change: sparserevlog
1239 note: selecting changelog for processing to change: sparserevlog
1209 note: selecting changelog for processing to change: sparserevlog
1240
1210
1241 upgrade will perform the following actions:
1211 upgrade will perform the following actions:
1242
1212
1243 requirements
1213 requirements
1244 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1214 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1245 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1215 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1246 added: sparserevlog
1216 added: sparserevlog
1247
1217
1248 optimisations: re-delta-parent
1218 optimisations: re-delta-parent
1249
1219
1250 sparserevlog
1220 sparserevlog
1251 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
1221 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
1252
1222
1253 re-delta-parent
1223 re-delta-parent
1254 deltas within internal storage will choose a new base revision if needed
1224 deltas within internal storage will choose a new base revision if needed
1255
1225
1256 processed revlogs:
1226 processed revlogs:
1257 - all-filelogs
1227 - all-filelogs
1258 - changelog
1228 - changelog
1259 - manifest
1229 - manifest
1260
1230
1261 beginning upgrade...
1231 beginning upgrade...
1262 repository locked and read-only
1232 repository locked and read-only
1263 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1233 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1264 (it is safe to interrupt this process any time before data migration completes)
1234 (it is safe to interrupt this process any time before data migration completes)
1265 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1235 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1266 migrating 519 KB in store; 1.05 MB tracked data
1236 migrating 519 KB in store; 1.05 MB tracked data
1267 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1237 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1268 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1238 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1269 cloning 1 revisions from data/f0.i
1239 cloning 1 revisions from data/f0.i
1270 cloning 1 revisions from data/f2.i
1240 cloning 1 revisions from data/f2.i
1271 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1241 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1272 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1242 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1273 cloning 3 revisions from 00manifest.i
1243 cloning 3 revisions from 00manifest.i
1274 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1244 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1275 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1245 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1276 cloning 3 revisions from 00changelog.i
1246 cloning 3 revisions from 00changelog.i
1277 finished migrating 3 changelog revisions; change in size: 0 bytes
1247 finished migrating 3 changelog revisions; change in size: 0 bytes
1278 finished migrating 9 total revisions; total change in store size: 0 bytes
1248 finished migrating 9 total revisions; total change in store size: 0 bytes
1279 copying phaseroots
1249 copying phaseroots
1280 copying requires
1250 copying requires
1281 data fully upgraded in a temporary repository
1251 data fully upgraded in a temporary repository
1282 marking source repository as being upgraded; clients will be unable to read from repository
1252 marking source repository as being upgraded; clients will be unable to read from repository
1283 starting in-place swap of repository data
1253 starting in-place swap of repository data
1284 replacing store...
1254 replacing store...
1285 store replacement complete; repository was inconsistent for *s (glob)
1255 store replacement complete; repository was inconsistent for *s (glob)
1286 finalizing requirements file and making repository readable again
1256 finalizing requirements file and making repository readable again
1287 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1257 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1288 $ hg verify
1258 $ hg verify -q
1289 checking changesets
1290 checking manifests
1291 crosschecking files in changesets and manifests
1292 checking files
1293 checked 3 changesets with 3 changes to 3 files
1294
1259
1295 $ cd ..
1260 $ cd ..
1296
1261
1297 store files with special filenames aren't encoded during copy
1262 store files with special filenames aren't encoded during copy
1298
1263
1299 $ hg init store-filenames
1264 $ hg init store-filenames
1300 $ cd store-filenames
1265 $ cd store-filenames
1301 $ touch foo
1266 $ touch foo
1302 $ hg -q commit -A -m initial
1267 $ hg -q commit -A -m initial
1303 $ touch .hg/store/.XX_special_filename
1268 $ touch .hg/store/.XX_special_filename
1304
1269
1305 $ hg debugupgraderepo --run
1270 $ hg debugupgraderepo --run
1306 nothing to do
1271 nothing to do
1307 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1272 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1308 upgrade will perform the following actions:
1273 upgrade will perform the following actions:
1309
1274
1310 requirements
1275 requirements
1311 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1276 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1312 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1277 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1313
1278
1314 optimisations: re-delta-fulladd
1279 optimisations: re-delta-fulladd
1315
1280
1316 re-delta-fulladd
1281 re-delta-fulladd
1317 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1282 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1318
1283
1319 processed revlogs:
1284 processed revlogs:
1320 - all-filelogs
1285 - all-filelogs
1321 - changelog
1286 - changelog
1322 - manifest
1287 - manifest
1323
1288
1324 beginning upgrade...
1289 beginning upgrade...
1325 repository locked and read-only
1290 repository locked and read-only
1326 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1291 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1327 (it is safe to interrupt this process any time before data migration completes)
1292 (it is safe to interrupt this process any time before data migration completes)
1328 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1293 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1329 migrating 301 bytes in store; 107 bytes tracked data
1294 migrating 301 bytes in store; 107 bytes tracked data
1330 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1295 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1331 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1296 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1332 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1297 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1333 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1298 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1334 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1299 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1335 finished migrating 1 changelog revisions; change in size: 0 bytes
1300 finished migrating 1 changelog revisions; change in size: 0 bytes
1336 finished migrating 3 total revisions; total change in store size: 0 bytes
1301 finished migrating 3 total revisions; total change in store size: 0 bytes
1337 copying .XX_special_filename
1302 copying .XX_special_filename
1338 copying phaseroots
1303 copying phaseroots
1339 copying requires
1304 copying requires
1340 data fully upgraded in a temporary repository
1305 data fully upgraded in a temporary repository
1341 marking source repository as being upgraded; clients will be unable to read from repository
1306 marking source repository as being upgraded; clients will be unable to read from repository
1342 starting in-place swap of repository data
1307 starting in-place swap of repository data
1343 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1308 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1344 replacing store...
1309 replacing store...
1345 store replacement complete; repository was inconsistent for *s (glob)
1310 store replacement complete; repository was inconsistent for *s (glob)
1346 finalizing requirements file and making repository readable again
1311 finalizing requirements file and making repository readable again
1347 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1312 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1348 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1313 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1349 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1314 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1350
1315
1351 fncache is valid after upgrade
1316 fncache is valid after upgrade
1352
1317
1353 $ hg debugrebuildfncache
1318 $ hg debugrebuildfncache
1354 fncache already up to date
1319 fncache already up to date
1355
1320
1356 $ cd ..
1321 $ cd ..
1357
1322
1358 Check upgrading a large file repository
1323 Check upgrading a large file repository
1359 ---------------------------------------
1324 ---------------------------------------
1360
1325
1361 $ hg init largefilesrepo
1326 $ hg init largefilesrepo
1362 $ cat << EOF >> largefilesrepo/.hg/hgrc
1327 $ cat << EOF >> largefilesrepo/.hg/hgrc
1363 > [extensions]
1328 > [extensions]
1364 > largefiles =
1329 > largefiles =
1365 > EOF
1330 > EOF
1366
1331
1367 $ cd largefilesrepo
1332 $ cd largefilesrepo
1368 $ touch foo
1333 $ touch foo
1369 $ hg add --large foo
1334 $ hg add --large foo
1370 $ hg -q commit -m initial
1335 $ hg -q commit -m initial
1371 $ hg debugrequires
1336 $ hg debugrequires
1372 dotencode
1337 dotencode
1373 fncache
1338 fncache
1374 generaldelta
1339 generaldelta
1375 largefiles
1340 largefiles
1376 persistent-nodemap (rust !)
1341 persistent-nodemap (rust !)
1377 revlogv1
1342 revlogv1
1378 share-safe
1343 share-safe
1379 sparserevlog
1344 sparserevlog
1380 store
1345 store
1381
1346
1382 $ hg debugupgraderepo --run
1347 $ hg debugupgraderepo --run
1383 nothing to do
1348 nothing to do
1384 $ hg debugrequires
1349 $ hg debugrequires
1385 dotencode
1350 dotencode
1386 fncache
1351 fncache
1387 generaldelta
1352 generaldelta
1388 largefiles
1353 largefiles
1389 persistent-nodemap (rust !)
1354 persistent-nodemap (rust !)
1390 revlogv1
1355 revlogv1
1391 share-safe
1356 share-safe
1392 sparserevlog
1357 sparserevlog
1393 store
1358 store
1394
1359
1395 $ cat << EOF >> .hg/hgrc
1360 $ cat << EOF >> .hg/hgrc
1396 > [extensions]
1361 > [extensions]
1397 > lfs =
1362 > lfs =
1398 > [lfs]
1363 > [lfs]
1399 > threshold = 10
1364 > threshold = 10
1400 > EOF
1365 > EOF
1401 $ echo '123456789012345' > lfs.bin
1366 $ echo '123456789012345' > lfs.bin
1402 $ hg ci -Am 'lfs.bin'
1367 $ hg ci -Am 'lfs.bin'
1403 adding lfs.bin
1368 adding lfs.bin
1404 $ hg debugrequires | grep lfs
1369 $ hg debugrequires | grep lfs
1405 lfs
1370 lfs
1406 $ find .hg/store/lfs -type f
1371 $ find .hg/store/lfs -type f
1407 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1372 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1408
1373
1409 $ hg debugupgraderepo --run
1374 $ hg debugupgraderepo --run
1410 nothing to do
1375 nothing to do
1411
1376
1412 $ hg debugrequires | grep lfs
1377 $ hg debugrequires | grep lfs
1413 lfs
1378 lfs
1414 $ find .hg/store/lfs -type f
1379 $ find .hg/store/lfs -type f
1415 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1380 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1416 $ hg verify
1381 $ hg verify -q
1417 checking changesets
1418 checking manifests
1419 crosschecking files in changesets and manifests
1420 checking files
1421 checked 2 changesets with 2 changes to 2 files
1422 $ hg debugdata lfs.bin 0
1382 $ hg debugdata lfs.bin 0
1423 version https://git-lfs.github.com/spec/v1
1383 version https://git-lfs.github.com/spec/v1
1424 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1384 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1425 size 16
1385 size 16
1426 x-is-binary 0
1386 x-is-binary 0
1427
1387
1428 $ cd ..
1388 $ cd ..
1429
1389
1430 repository config is taken in account
1390 repository config is taken in account
1431 -------------------------------------
1391 -------------------------------------
1432
1392
1433 $ cat << EOF >> $HGRCPATH
1393 $ cat << EOF >> $HGRCPATH
1434 > [format]
1394 > [format]
1435 > maxchainlen = 1
1395 > maxchainlen = 1
1436 > EOF
1396 > EOF
1437
1397
1438 $ hg init localconfig
1398 $ hg init localconfig
1439 $ cd localconfig
1399 $ cd localconfig
1440 $ cat << EOF > file
1400 $ cat << EOF > file
1441 > some content
1401 > some content
1442 > with some length
1402 > with some length
1443 > to make sure we get a delta
1403 > to make sure we get a delta
1444 > after changes
1404 > after changes
1445 > very long
1405 > very long
1446 > very long
1406 > very long
1447 > very long
1407 > very long
1448 > very long
1408 > very long
1449 > very long
1409 > very long
1450 > very long
1410 > very long
1451 > very long
1411 > very long
1452 > very long
1412 > very long
1453 > very long
1413 > very long
1454 > very long
1414 > very long
1455 > very long
1415 > very long
1456 > EOF
1416 > EOF
1457 $ hg -q commit -A -m A
1417 $ hg -q commit -A -m A
1458 $ echo "new line" >> file
1418 $ echo "new line" >> file
1459 $ hg -q commit -m B
1419 $ hg -q commit -m B
1460 $ echo "new line" >> file
1420 $ echo "new line" >> file
1461 $ hg -q commit -m C
1421 $ hg -q commit -m C
1462
1422
1463 $ cat << EOF >> .hg/hgrc
1423 $ cat << EOF >> .hg/hgrc
1464 > [format]
1424 > [format]
1465 > maxchainlen = 9001
1425 > maxchainlen = 9001
1466 > EOF
1426 > EOF
1467 $ hg config format
1427 $ hg config format
1468 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1428 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1469 format.maxchainlen=9001
1429 format.maxchainlen=9001
1470 $ hg debugdeltachain file
1430 $ hg debugdeltachain file
1471 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1431 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1472 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1432 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1473 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1433 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1474 2 1 -1 1 2 0 snap 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1434 2 1 -1 1 2 0 snap 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1475
1435
1476 $ hg debugupgraderepo --run --optimize 're-delta-all'
1436 $ hg debugupgraderepo --run --optimize 're-delta-all'
1477 upgrade will perform the following actions:
1437 upgrade will perform the following actions:
1478
1438
1479 requirements
1439 requirements
1480 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1440 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1481 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1441 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1482
1442
1483 optimisations: re-delta-all
1443 optimisations: re-delta-all
1484
1444
1485 re-delta-all
1445 re-delta-all
1486 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1446 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1487
1447
1488 processed revlogs:
1448 processed revlogs:
1489 - all-filelogs
1449 - all-filelogs
1490 - changelog
1450 - changelog
1491 - manifest
1451 - manifest
1492
1452
1493 beginning upgrade...
1453 beginning upgrade...
1494 repository locked and read-only
1454 repository locked and read-only
1495 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1455 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1496 (it is safe to interrupt this process any time before data migration completes)
1456 (it is safe to interrupt this process any time before data migration completes)
1497 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1457 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1498 migrating 1019 bytes in store; 882 bytes tracked data
1458 migrating 1019 bytes in store; 882 bytes tracked data
1499 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1459 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1500 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1460 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1501 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1461 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1502 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1462 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1503 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1463 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1504 finished migrating 3 changelog revisions; change in size: 0 bytes
1464 finished migrating 3 changelog revisions; change in size: 0 bytes
1505 finished migrating 9 total revisions; total change in store size: -9 bytes
1465 finished migrating 9 total revisions; total change in store size: -9 bytes
1506 copying phaseroots
1466 copying phaseroots
1507 copying requires
1467 copying requires
1508 data fully upgraded in a temporary repository
1468 data fully upgraded in a temporary repository
1509 marking source repository as being upgraded; clients will be unable to read from repository
1469 marking source repository as being upgraded; clients will be unable to read from repository
1510 starting in-place swap of repository data
1470 starting in-place swap of repository data
1511 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1471 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1512 replacing store...
1472 replacing store...
1513 store replacement complete; repository was inconsistent for *s (glob)
1473 store replacement complete; repository was inconsistent for *s (glob)
1514 finalizing requirements file and making repository readable again
1474 finalizing requirements file and making repository readable again
1515 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1475 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1516 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1476 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1517 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1477 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1518 $ hg debugdeltachain file
1478 $ hg debugdeltachain file
1519 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1479 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1520 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1480 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1521 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1481 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1522 2 1 -1 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1482 2 1 -1 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1523 $ cd ..
1483 $ cd ..
1524
1484
1525 $ cat << EOF >> $HGRCPATH
1485 $ cat << EOF >> $HGRCPATH
1526 > [format]
1486 > [format]
1527 > maxchainlen = 9001
1487 > maxchainlen = 9001
1528 > EOF
1488 > EOF
1529
1489
1530 Check upgrading a sparse-revlog repository
1490 Check upgrading a sparse-revlog repository
1531 ---------------------------------------
1491 ---------------------------------------
1532
1492
1533 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1493 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1534 $ cd sparserevlogrepo
1494 $ cd sparserevlogrepo
1535 $ touch foo
1495 $ touch foo
1536 $ hg add foo
1496 $ hg add foo
1537 $ hg -q commit -m "foo"
1497 $ hg -q commit -m "foo"
1538 $ hg debugrequires
1498 $ hg debugrequires
1539 dotencode
1499 dotencode
1540 fncache
1500 fncache
1541 generaldelta
1501 generaldelta
1542 persistent-nodemap (rust !)
1502 persistent-nodemap (rust !)
1543 revlogv1
1503 revlogv1
1544 share-safe
1504 share-safe
1545 store
1505 store
1546
1506
1547 Check that we can add the sparse-revlog format requirement
1507 Check that we can add the sparse-revlog format requirement
1548 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1508 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1549 upgrade will perform the following actions:
1509 upgrade will perform the following actions:
1550
1510
1551 requirements
1511 requirements
1552 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1512 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1553 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1513 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1554 added: sparserevlog
1514 added: sparserevlog
1555
1515
1556 processed revlogs:
1516 processed revlogs:
1557 - all-filelogs
1517 - all-filelogs
1558 - changelog
1518 - changelog
1559 - manifest
1519 - manifest
1560
1520
1561 $ hg debugrequires
1521 $ hg debugrequires
1562 dotencode
1522 dotencode
1563 fncache
1523 fncache
1564 generaldelta
1524 generaldelta
1565 persistent-nodemap (rust !)
1525 persistent-nodemap (rust !)
1566 revlogv1
1526 revlogv1
1567 share-safe
1527 share-safe
1568 sparserevlog
1528 sparserevlog
1569 store
1529 store
1570
1530
1571 Check that we can remove the sparse-revlog format requirement
1531 Check that we can remove the sparse-revlog format requirement
1572 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1532 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1573 upgrade will perform the following actions:
1533 upgrade will perform the following actions:
1574
1534
1575 requirements
1535 requirements
1576 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1536 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1577 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1537 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1578 removed: sparserevlog
1538 removed: sparserevlog
1579
1539
1580 processed revlogs:
1540 processed revlogs:
1581 - all-filelogs
1541 - all-filelogs
1582 - changelog
1542 - changelog
1583 - manifest
1543 - manifest
1584
1544
1585 $ hg debugrequires
1545 $ hg debugrequires
1586 dotencode
1546 dotencode
1587 fncache
1547 fncache
1588 generaldelta
1548 generaldelta
1589 persistent-nodemap (rust !)
1549 persistent-nodemap (rust !)
1590 revlogv1
1550 revlogv1
1591 share-safe
1551 share-safe
1592 store
1552 store
1593
1553
1594 #if zstd
1554 #if zstd
1595
1555
1596 Check upgrading to a zstd revlog
1556 Check upgrading to a zstd revlog
1597 --------------------------------
1557 --------------------------------
1598
1558
1599 upgrade
1559 upgrade
1600
1560
1601 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1561 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1602 upgrade will perform the following actions:
1562 upgrade will perform the following actions:
1603
1563
1604 requirements
1564 requirements
1605 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1565 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1606 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1566 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1607 added: revlog-compression-zstd, sparserevlog
1567 added: revlog-compression-zstd, sparserevlog
1608
1568
1609 processed revlogs:
1569 processed revlogs:
1610 - all-filelogs
1570 - all-filelogs
1611 - changelog
1571 - changelog
1612 - manifest
1572 - manifest
1613
1573
1614 $ hg debugformat -v
1574 $ hg debugformat -v
1615 format-variant repo config default
1575 format-variant repo config default
1616 fncache: yes yes yes
1576 fncache: yes yes yes
1617 dirstate-v2: no no no
1577 dirstate-v2: no no no
1618 tracked-hint: no no no
1578 tracked-hint: no no no
1619 dotencode: yes yes yes
1579 dotencode: yes yes yes
1620 generaldelta: yes yes yes
1580 generaldelta: yes yes yes
1621 share-safe: yes yes yes
1581 share-safe: yes yes yes
1622 sparserevlog: yes yes yes
1582 sparserevlog: yes yes yes
1623 persistent-nodemap: no no no (no-rust !)
1583 persistent-nodemap: no no no (no-rust !)
1624 persistent-nodemap: yes yes no (rust !)
1584 persistent-nodemap: yes yes no (rust !)
1625 copies-sdc: no no no
1585 copies-sdc: no no no
1626 revlog-v2: no no no
1586 revlog-v2: no no no
1627 changelog-v2: no no no
1587 changelog-v2: no no no
1628 plain-cl-delta: yes yes yes
1588 plain-cl-delta: yes yes yes
1629 compression: zlib zlib zlib (no-zstd !)
1589 compression: zlib zlib zlib (no-zstd !)
1630 compression: zstd zlib zstd (zstd !)
1590 compression: zstd zlib zstd (zstd !)
1631 compression-level: default default default
1591 compression-level: default default default
1632 $ hg debugrequires
1592 $ hg debugrequires
1633 dotencode
1593 dotencode
1634 fncache
1594 fncache
1635 generaldelta
1595 generaldelta
1636 persistent-nodemap (rust !)
1596 persistent-nodemap (rust !)
1637 revlog-compression-zstd
1597 revlog-compression-zstd
1638 revlogv1
1598 revlogv1
1639 share-safe
1599 share-safe
1640 sparserevlog
1600 sparserevlog
1641 store
1601 store
1642
1602
1643 downgrade
1603 downgrade
1644
1604
1645 $ hg debugupgraderepo --run --no-backup --quiet
1605 $ hg debugupgraderepo --run --no-backup --quiet
1646 upgrade will perform the following actions:
1606 upgrade will perform the following actions:
1647
1607
1648 requirements
1608 requirements
1649 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1609 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1650 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1610 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1651 removed: revlog-compression-zstd
1611 removed: revlog-compression-zstd
1652
1612
1653 processed revlogs:
1613 processed revlogs:
1654 - all-filelogs
1614 - all-filelogs
1655 - changelog
1615 - changelog
1656 - manifest
1616 - manifest
1657
1617
1658 $ hg debugformat -v
1618 $ hg debugformat -v
1659 format-variant repo config default
1619 format-variant repo config default
1660 fncache: yes yes yes
1620 fncache: yes yes yes
1661 dirstate-v2: no no no
1621 dirstate-v2: no no no
1662 tracked-hint: no no no
1622 tracked-hint: no no no
1663 dotencode: yes yes yes
1623 dotencode: yes yes yes
1664 generaldelta: yes yes yes
1624 generaldelta: yes yes yes
1665 share-safe: yes yes yes
1625 share-safe: yes yes yes
1666 sparserevlog: yes yes yes
1626 sparserevlog: yes yes yes
1667 persistent-nodemap: no no no (no-rust !)
1627 persistent-nodemap: no no no (no-rust !)
1668 persistent-nodemap: yes yes no (rust !)
1628 persistent-nodemap: yes yes no (rust !)
1669 copies-sdc: no no no
1629 copies-sdc: no no no
1670 revlog-v2: no no no
1630 revlog-v2: no no no
1671 changelog-v2: no no no
1631 changelog-v2: no no no
1672 plain-cl-delta: yes yes yes
1632 plain-cl-delta: yes yes yes
1673 compression: zlib zlib zlib (no-zstd !)
1633 compression: zlib zlib zlib (no-zstd !)
1674 compression: zlib zlib zstd (zstd !)
1634 compression: zlib zlib zstd (zstd !)
1675 compression-level: default default default
1635 compression-level: default default default
1676 $ hg debugrequires
1636 $ hg debugrequires
1677 dotencode
1637 dotencode
1678 fncache
1638 fncache
1679 generaldelta
1639 generaldelta
1680 persistent-nodemap (rust !)
1640 persistent-nodemap (rust !)
1681 revlogv1
1641 revlogv1
1682 share-safe
1642 share-safe
1683 sparserevlog
1643 sparserevlog
1684 store
1644 store
1685
1645
1686 upgrade from hgrc
1646 upgrade from hgrc
1687
1647
1688 $ cat >> .hg/hgrc << EOF
1648 $ cat >> .hg/hgrc << EOF
1689 > [format]
1649 > [format]
1690 > revlog-compression=zstd
1650 > revlog-compression=zstd
1691 > EOF
1651 > EOF
1692 $ hg debugupgraderepo --run --no-backup --quiet
1652 $ hg debugupgraderepo --run --no-backup --quiet
1693 upgrade will perform the following actions:
1653 upgrade will perform the following actions:
1694
1654
1695 requirements
1655 requirements
1696 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1656 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1697 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1657 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1698 added: revlog-compression-zstd
1658 added: revlog-compression-zstd
1699
1659
1700 processed revlogs:
1660 processed revlogs:
1701 - all-filelogs
1661 - all-filelogs
1702 - changelog
1662 - changelog
1703 - manifest
1663 - manifest
1704
1664
1705 $ hg debugformat -v
1665 $ hg debugformat -v
1706 format-variant repo config default
1666 format-variant repo config default
1707 fncache: yes yes yes
1667 fncache: yes yes yes
1708 dirstate-v2: no no no
1668 dirstate-v2: no no no
1709 tracked-hint: no no no
1669 tracked-hint: no no no
1710 dotencode: yes yes yes
1670 dotencode: yes yes yes
1711 generaldelta: yes yes yes
1671 generaldelta: yes yes yes
1712 share-safe: yes yes yes
1672 share-safe: yes yes yes
1713 sparserevlog: yes yes yes
1673 sparserevlog: yes yes yes
1714 persistent-nodemap: no no no (no-rust !)
1674 persistent-nodemap: no no no (no-rust !)
1715 persistent-nodemap: yes yes no (rust !)
1675 persistent-nodemap: yes yes no (rust !)
1716 copies-sdc: no no no
1676 copies-sdc: no no no
1717 revlog-v2: no no no
1677 revlog-v2: no no no
1718 changelog-v2: no no no
1678 changelog-v2: no no no
1719 plain-cl-delta: yes yes yes
1679 plain-cl-delta: yes yes yes
1720 compression: zlib zlib zlib (no-zstd !)
1680 compression: zlib zlib zlib (no-zstd !)
1721 compression: zstd zstd zstd (zstd !)
1681 compression: zstd zstd zstd (zstd !)
1722 compression-level: default default default
1682 compression-level: default default default
1723 $ hg debugrequires
1683 $ hg debugrequires
1724 dotencode
1684 dotencode
1725 fncache
1685 fncache
1726 generaldelta
1686 generaldelta
1727 persistent-nodemap (rust !)
1687 persistent-nodemap (rust !)
1728 revlog-compression-zstd
1688 revlog-compression-zstd
1729 revlogv1
1689 revlogv1
1730 share-safe
1690 share-safe
1731 sparserevlog
1691 sparserevlog
1732 store
1692 store
1733
1693
1734 #endif
1694 #endif
1735
1695
1736 Check upgrading to a revlog format supporting sidedata
1696 Check upgrading to a revlog format supporting sidedata
1737 ------------------------------------------------------
1697 ------------------------------------------------------
1738
1698
1739 upgrade
1699 upgrade
1740
1700
1741 $ hg debugsidedata -c 0
1701 $ hg debugsidedata -c 0
1742 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1702 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1743 upgrade will perform the following actions:
1703 upgrade will perform the following actions:
1744
1704
1745 requirements
1705 requirements
1746 preserved: dotencode, fncache, generaldelta, share-safe, store (no-zstd !)
1706 preserved: dotencode, fncache, generaldelta, share-safe, store (no-zstd !)
1747 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1707 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1748 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1708 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1749 removed: revlogv1
1709 removed: revlogv1
1750 added: exp-revlogv2.2 (zstd !)
1710 added: exp-revlogv2.2 (zstd !)
1751 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1711 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1752
1712
1753 processed revlogs:
1713 processed revlogs:
1754 - all-filelogs
1714 - all-filelogs
1755 - changelog
1715 - changelog
1756 - manifest
1716 - manifest
1757
1717
1758 $ hg debugformat -v
1718 $ hg debugformat -v
1759 format-variant repo config default
1719 format-variant repo config default
1760 fncache: yes yes yes
1720 fncache: yes yes yes
1761 dirstate-v2: no no no
1721 dirstate-v2: no no no
1762 tracked-hint: no no no
1722 tracked-hint: no no no
1763 dotencode: yes yes yes
1723 dotencode: yes yes yes
1764 generaldelta: yes yes yes
1724 generaldelta: yes yes yes
1765 share-safe: yes yes yes
1725 share-safe: yes yes yes
1766 sparserevlog: yes yes yes
1726 sparserevlog: yes yes yes
1767 persistent-nodemap: no no no (no-rust !)
1727 persistent-nodemap: no no no (no-rust !)
1768 persistent-nodemap: yes yes no (rust !)
1728 persistent-nodemap: yes yes no (rust !)
1769 copies-sdc: no no no
1729 copies-sdc: no no no
1770 revlog-v2: yes no no
1730 revlog-v2: yes no no
1771 changelog-v2: no no no
1731 changelog-v2: no no no
1772 plain-cl-delta: yes yes yes
1732 plain-cl-delta: yes yes yes
1773 compression: zlib zlib zlib (no-zstd !)
1733 compression: zlib zlib zlib (no-zstd !)
1774 compression: zstd zstd zstd (zstd !)
1734 compression: zstd zstd zstd (zstd !)
1775 compression-level: default default default
1735 compression-level: default default default
1776 $ hg debugrequires
1736 $ hg debugrequires
1777 dotencode
1737 dotencode
1778 exp-revlogv2.2
1738 exp-revlogv2.2
1779 fncache
1739 fncache
1780 generaldelta
1740 generaldelta
1781 persistent-nodemap (rust !)
1741 persistent-nodemap (rust !)
1782 revlog-compression-zstd (zstd !)
1742 revlog-compression-zstd (zstd !)
1783 share-safe
1743 share-safe
1784 sparserevlog
1744 sparserevlog
1785 store
1745 store
1786 $ hg debugsidedata -c 0
1746 $ hg debugsidedata -c 0
1787 2 sidedata entries
1747 2 sidedata entries
1788 entry-0001 size 4
1748 entry-0001 size 4
1789 entry-0002 size 32
1749 entry-0002 size 32
1790
1750
1791 downgrade
1751 downgrade
1792
1752
1793 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1753 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1794 upgrade will perform the following actions:
1754 upgrade will perform the following actions:
1795
1755
1796 requirements
1756 requirements
1797 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1757 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1798 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1758 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1799 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1759 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1800 removed: exp-revlogv2.2
1760 removed: exp-revlogv2.2
1801 added: revlogv1
1761 added: revlogv1
1802
1762
1803 processed revlogs:
1763 processed revlogs:
1804 - all-filelogs
1764 - all-filelogs
1805 - changelog
1765 - changelog
1806 - manifest
1766 - manifest
1807
1767
1808 $ hg debugformat -v
1768 $ hg debugformat -v
1809 format-variant repo config default
1769 format-variant repo config default
1810 fncache: yes yes yes
1770 fncache: yes yes yes
1811 dirstate-v2: no no no
1771 dirstate-v2: no no no
1812 tracked-hint: no no no
1772 tracked-hint: no no no
1813 dotencode: yes yes yes
1773 dotencode: yes yes yes
1814 generaldelta: yes yes yes
1774 generaldelta: yes yes yes
1815 share-safe: yes yes yes
1775 share-safe: yes yes yes
1816 sparserevlog: yes yes yes
1776 sparserevlog: yes yes yes
1817 persistent-nodemap: no no no (no-rust !)
1777 persistent-nodemap: no no no (no-rust !)
1818 persistent-nodemap: yes yes no (rust !)
1778 persistent-nodemap: yes yes no (rust !)
1819 copies-sdc: no no no
1779 copies-sdc: no no no
1820 revlog-v2: no no no
1780 revlog-v2: no no no
1821 changelog-v2: no no no
1781 changelog-v2: no no no
1822 plain-cl-delta: yes yes yes
1782 plain-cl-delta: yes yes yes
1823 compression: zlib zlib zlib (no-zstd !)
1783 compression: zlib zlib zlib (no-zstd !)
1824 compression: zstd zstd zstd (zstd !)
1784 compression: zstd zstd zstd (zstd !)
1825 compression-level: default default default
1785 compression-level: default default default
1826 $ hg debugrequires
1786 $ hg debugrequires
1827 dotencode
1787 dotencode
1828 fncache
1788 fncache
1829 generaldelta
1789 generaldelta
1830 persistent-nodemap (rust !)
1790 persistent-nodemap (rust !)
1831 revlog-compression-zstd (zstd !)
1791 revlog-compression-zstd (zstd !)
1832 revlogv1
1792 revlogv1
1833 share-safe
1793 share-safe
1834 sparserevlog
1794 sparserevlog
1835 store
1795 store
1836 $ hg debugsidedata -c 0
1796 $ hg debugsidedata -c 0
1837
1797
1838 upgrade from hgrc
1798 upgrade from hgrc
1839
1799
1840 $ cat >> .hg/hgrc << EOF
1800 $ cat >> .hg/hgrc << EOF
1841 > [experimental]
1801 > [experimental]
1842 > revlogv2=enable-unstable-format-and-corrupt-my-data
1802 > revlogv2=enable-unstable-format-and-corrupt-my-data
1843 > EOF
1803 > EOF
1844 $ hg debugupgraderepo --run --no-backup --quiet
1804 $ hg debugupgraderepo --run --no-backup --quiet
1845 upgrade will perform the following actions:
1805 upgrade will perform the following actions:
1846
1806
1847 requirements
1807 requirements
1848 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1808 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1849 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1809 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1850 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1810 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1851 removed: revlogv1
1811 removed: revlogv1
1852 added: exp-revlogv2.2
1812 added: exp-revlogv2.2
1853
1813
1854 processed revlogs:
1814 processed revlogs:
1855 - all-filelogs
1815 - all-filelogs
1856 - changelog
1816 - changelog
1857 - manifest
1817 - manifest
1858
1818
1859 $ hg debugformat -v
1819 $ hg debugformat -v
1860 format-variant repo config default
1820 format-variant repo config default
1861 fncache: yes yes yes
1821 fncache: yes yes yes
1862 dirstate-v2: no no no
1822 dirstate-v2: no no no
1863 tracked-hint: no no no
1823 tracked-hint: no no no
1864 dotencode: yes yes yes
1824 dotencode: yes yes yes
1865 generaldelta: yes yes yes
1825 generaldelta: yes yes yes
1866 share-safe: yes yes yes
1826 share-safe: yes yes yes
1867 sparserevlog: yes yes yes
1827 sparserevlog: yes yes yes
1868 persistent-nodemap: no no no (no-rust !)
1828 persistent-nodemap: no no no (no-rust !)
1869 persistent-nodemap: yes yes no (rust !)
1829 persistent-nodemap: yes yes no (rust !)
1870 copies-sdc: no no no
1830 copies-sdc: no no no
1871 revlog-v2: yes yes no
1831 revlog-v2: yes yes no
1872 changelog-v2: no no no
1832 changelog-v2: no no no
1873 plain-cl-delta: yes yes yes
1833 plain-cl-delta: yes yes yes
1874 compression: zlib zlib zlib (no-zstd !)
1834 compression: zlib zlib zlib (no-zstd !)
1875 compression: zstd zstd zstd (zstd !)
1835 compression: zstd zstd zstd (zstd !)
1876 compression-level: default default default
1836 compression-level: default default default
1877 $ hg debugrequires
1837 $ hg debugrequires
1878 dotencode
1838 dotencode
1879 exp-revlogv2.2
1839 exp-revlogv2.2
1880 fncache
1840 fncache
1881 generaldelta
1841 generaldelta
1882 persistent-nodemap (rust !)
1842 persistent-nodemap (rust !)
1883 revlog-compression-zstd (zstd !)
1843 revlog-compression-zstd (zstd !)
1884 share-safe
1844 share-safe
1885 sparserevlog
1845 sparserevlog
1886 store
1846 store
1887 $ hg debugsidedata -c 0
1847 $ hg debugsidedata -c 0
1888
1848
1889 Demonstrate that nothing to perform upgrade will still run all the way through
1849 Demonstrate that nothing to perform upgrade will still run all the way through
1890
1850
1891 $ hg debugupgraderepo --run
1851 $ hg debugupgraderepo --run
1892 nothing to do
1852 nothing to do
1893
1853
1894 #if no-rust
1854 #if no-rust
1895
1855
1896 $ cat << EOF >> $HGRCPATH
1856 $ cat << EOF >> $HGRCPATH
1897 > [storage]
1857 > [storage]
1898 > dirstate-v2.slow-path = allow
1858 > dirstate-v2.slow-path = allow
1899 > EOF
1859 > EOF
1900
1860
1901 #endif
1861 #endif
1902
1862
1903 Upgrade to dirstate-v2
1863 Upgrade to dirstate-v2
1904
1864
1905 $ hg debugformat -v --config format.use-dirstate-v2=1 | grep dirstate-v2
1865 $ hg debugformat -v --config format.use-dirstate-v2=1 | grep dirstate-v2
1906 dirstate-v2: no yes no
1866 dirstate-v2: no yes no
1907 $ hg debugupgraderepo --config format.use-dirstate-v2=1 --run
1867 $ hg debugupgraderepo --config format.use-dirstate-v2=1 --run
1908 upgrade will perform the following actions:
1868 upgrade will perform the following actions:
1909
1869
1910 requirements
1870 requirements
1911 preserved: * (glob)
1871 preserved: * (glob)
1912 added: dirstate-v2
1872 added: dirstate-v2
1913
1873
1914 dirstate-v2
1874 dirstate-v2
1915 "hg status" will be faster
1875 "hg status" will be faster
1916
1876
1917 no revlogs to process
1877 no revlogs to process
1918
1878
1919 beginning upgrade...
1879 beginning upgrade...
1920 repository locked and read-only
1880 repository locked and read-only
1921 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1881 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1922 (it is safe to interrupt this process any time before data migration completes)
1882 (it is safe to interrupt this process any time before data migration completes)
1923 upgrading to dirstate-v2 from v1
1883 upgrading to dirstate-v2 from v1
1924 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1884 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1925 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1885 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1926 $ ls .hg/upgradebackup.*/dirstate
1886 $ ls .hg/upgradebackup.*/dirstate
1927 .hg/upgradebackup.*/dirstate (glob)
1887 .hg/upgradebackup.*/dirstate (glob)
1928 $ hg debugformat -v | grep dirstate-v2
1888 $ hg debugformat -v | grep dirstate-v2
1929 dirstate-v2: yes no no
1889 dirstate-v2: yes no no
1930 $ hg status
1890 $ hg status
1931 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1891 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1932 dirstate-v2
1892 dirstate-v2
1933
1893
1934 Downgrade from dirstate-v2
1894 Downgrade from dirstate-v2
1935
1895
1936 $ hg debugupgraderepo --run
1896 $ hg debugupgraderepo --run
1937 upgrade will perform the following actions:
1897 upgrade will perform the following actions:
1938
1898
1939 requirements
1899 requirements
1940 preserved: * (glob)
1900 preserved: * (glob)
1941 removed: dirstate-v2
1901 removed: dirstate-v2
1942
1902
1943 no revlogs to process
1903 no revlogs to process
1944
1904
1945 beginning upgrade...
1905 beginning upgrade...
1946 repository locked and read-only
1906 repository locked and read-only
1947 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1907 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1948 (it is safe to interrupt this process any time before data migration completes)
1908 (it is safe to interrupt this process any time before data migration completes)
1949 downgrading from dirstate-v2 to v1
1909 downgrading from dirstate-v2 to v1
1950 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1910 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1951 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1911 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1952 $ hg debugformat -v | grep dirstate-v2
1912 $ hg debugformat -v | grep dirstate-v2
1953 dirstate-v2: no no no
1913 dirstate-v2: no no no
1954 $ hg status
1914 $ hg status
1955
1915
1956 $ cd ..
1916 $ cd ..
1957
1917
1958 dirstate-v2: upgrade and downgrade from and empty repository:
1918 dirstate-v2: upgrade and downgrade from and empty repository:
1959 -------------------------------------------------------------
1919 -------------------------------------------------------------
1960
1920
1961 $ hg init --config format.use-dirstate-v2=no dirstate-v2-empty
1921 $ hg init --config format.use-dirstate-v2=no dirstate-v2-empty
1962 $ cd dirstate-v2-empty
1922 $ cd dirstate-v2-empty
1963 $ hg debugformat | grep dirstate-v2
1923 $ hg debugformat | grep dirstate-v2
1964 dirstate-v2: no
1924 dirstate-v2: no
1965
1925
1966 upgrade
1926 upgrade
1967
1927
1968 $ hg debugupgraderepo --run --config format.use-dirstate-v2=yes
1928 $ hg debugupgraderepo --run --config format.use-dirstate-v2=yes
1969 upgrade will perform the following actions:
1929 upgrade will perform the following actions:
1970
1930
1971 requirements
1931 requirements
1972 preserved: * (glob)
1932 preserved: * (glob)
1973 added: dirstate-v2
1933 added: dirstate-v2
1974
1934
1975 dirstate-v2
1935 dirstate-v2
1976 "hg status" will be faster
1936 "hg status" will be faster
1977
1937
1978 no revlogs to process
1938 no revlogs to process
1979
1939
1980 beginning upgrade...
1940 beginning upgrade...
1981 repository locked and read-only
1941 repository locked and read-only
1982 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1942 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1983 (it is safe to interrupt this process any time before data migration completes)
1943 (it is safe to interrupt this process any time before data migration completes)
1984 upgrading to dirstate-v2 from v1
1944 upgrading to dirstate-v2 from v1
1985 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1945 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1986 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1946 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1987 $ hg debugformat | grep dirstate-v2
1947 $ hg debugformat | grep dirstate-v2
1988 dirstate-v2: yes
1948 dirstate-v2: yes
1989
1949
1990 downgrade
1950 downgrade
1991
1951
1992 $ hg debugupgraderepo --run --config format.use-dirstate-v2=no
1952 $ hg debugupgraderepo --run --config format.use-dirstate-v2=no
1993 upgrade will perform the following actions:
1953 upgrade will perform the following actions:
1994
1954
1995 requirements
1955 requirements
1996 preserved: * (glob)
1956 preserved: * (glob)
1997 removed: dirstate-v2
1957 removed: dirstate-v2
1998
1958
1999 no revlogs to process
1959 no revlogs to process
2000
1960
2001 beginning upgrade...
1961 beginning upgrade...
2002 repository locked and read-only
1962 repository locked and read-only
2003 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1963 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
2004 (it is safe to interrupt this process any time before data migration completes)
1964 (it is safe to interrupt this process any time before data migration completes)
2005 downgrading from dirstate-v2 to v1
1965 downgrading from dirstate-v2 to v1
2006 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1966 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
2007 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1967 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
2008 $ hg debugformat | grep dirstate-v2
1968 $ hg debugformat | grep dirstate-v2
2009 dirstate-v2: no
1969 dirstate-v2: no
2010
1970
2011 $ cd ..
1971 $ cd ..
2012
1972
2013 Test automatic upgrade/downgrade
1973 Test automatic upgrade/downgrade
2014 ================================
1974 ================================
2015
1975
2016
1976
2017 For dirstate v2
1977 For dirstate v2
2018 ---------------
1978 ---------------
2019
1979
2020 create an initial repository
1980 create an initial repository
2021
1981
2022 $ hg init auto-upgrade \
1982 $ hg init auto-upgrade \
2023 > --config format.use-dirstate-v2=no \
1983 > --config format.use-dirstate-v2=no \
2024 > --config format.use-dirstate-tracked-hint=yes \
1984 > --config format.use-dirstate-tracked-hint=yes \
2025 > --config format.use-share-safe=no
1985 > --config format.use-share-safe=no
2026 $ hg debugbuilddag -R auto-upgrade --new-file .+5
1986 $ hg debugbuilddag -R auto-upgrade --new-file .+5
2027 $ hg -R auto-upgrade update
1987 $ hg -R auto-upgrade update
2028 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1988 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
2029 $ hg debugformat -R auto-upgrade | grep dirstate-v2
1989 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2030 dirstate-v2: no
1990 dirstate-v2: no
2031
1991
2032 upgrade it to dirstate-v2 automatically
1992 upgrade it to dirstate-v2 automatically
2033
1993
2034 $ hg status -R auto-upgrade \
1994 $ hg status -R auto-upgrade \
2035 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
1995 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2036 > --config format.use-dirstate-v2=yes
1996 > --config format.use-dirstate-v2=yes
2037 automatically upgrading repository to the `dirstate-v2` feature
1997 automatically upgrading repository to the `dirstate-v2` feature
2038 (see `hg help config.format.use-dirstate-v2` for details)
1998 (see `hg help config.format.use-dirstate-v2` for details)
2039 $ hg debugformat -R auto-upgrade | grep dirstate-v2
1999 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2040 dirstate-v2: yes
2000 dirstate-v2: yes
2041
2001
2042 downgrade it from dirstate-v2 automatically
2002 downgrade it from dirstate-v2 automatically
2043
2003
2044 $ hg status -R auto-upgrade \
2004 $ hg status -R auto-upgrade \
2045 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2005 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2046 > --config format.use-dirstate-v2=no
2006 > --config format.use-dirstate-v2=no
2047 automatically downgrading repository from the `dirstate-v2` feature
2007 automatically downgrading repository from the `dirstate-v2` feature
2048 (see `hg help config.format.use-dirstate-v2` for details)
2008 (see `hg help config.format.use-dirstate-v2` for details)
2049 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2009 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2050 dirstate-v2: no
2010 dirstate-v2: no
2051
2011
2052
2012
2053 For multiple change at the same time
2013 For multiple change at the same time
2054 ------------------------------------
2014 ------------------------------------
2055
2015
2056 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2016 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2057 dirstate-v2: no
2017 dirstate-v2: no
2058 tracked-hint: yes
2018 tracked-hint: yes
2059 share-safe: no
2019 share-safe: no
2060
2020
2061 $ hg status -R auto-upgrade \
2021 $ hg status -R auto-upgrade \
2062 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2022 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2063 > --config format.use-dirstate-v2=yes \
2023 > --config format.use-dirstate-v2=yes \
2064 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2024 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2065 > --config format.use-dirstate-tracked-hint=no\
2025 > --config format.use-dirstate-tracked-hint=no\
2066 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2026 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2067 > --config format.use-share-safe=yes
2027 > --config format.use-share-safe=yes
2068 automatically upgrading repository to the `dirstate-v2` feature
2028 automatically upgrading repository to the `dirstate-v2` feature
2069 (see `hg help config.format.use-dirstate-v2` for details)
2029 (see `hg help config.format.use-dirstate-v2` for details)
2070 automatically upgrading repository to the `share-safe` feature
2030 automatically upgrading repository to the `share-safe` feature
2071 (see `hg help config.format.use-share-safe` for details)
2031 (see `hg help config.format.use-share-safe` for details)
2072 automatically downgrading repository from the `tracked-hint` feature
2032 automatically downgrading repository from the `tracked-hint` feature
2073 (see `hg help config.format.use-dirstate-tracked-hint` for details)
2033 (see `hg help config.format.use-dirstate-tracked-hint` for details)
2074 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2034 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2075 dirstate-v2: yes
2035 dirstate-v2: yes
2076 tracked-hint: no
2036 tracked-hint: no
2077 share-safe: yes
2037 share-safe: yes
2078
2038
2079 Quiet upgrade and downgrade
2039 Quiet upgrade and downgrade
2080 ---------------------------
2040 ---------------------------
2081
2041
2082
2042
2083 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2043 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2084 dirstate-v2: yes
2044 dirstate-v2: yes
2085 tracked-hint: no
2045 tracked-hint: no
2086 share-safe: yes
2046 share-safe: yes
2087 $ hg status -R auto-upgrade \
2047 $ hg status -R auto-upgrade \
2088 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2048 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2089 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2049 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2090 > --config format.use-dirstate-v2=no \
2050 > --config format.use-dirstate-v2=no \
2091 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2051 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2092 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2052 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2093 > --config format.use-dirstate-tracked-hint=yes \
2053 > --config format.use-dirstate-tracked-hint=yes \
2094 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2054 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2095 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2055 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2096 > --config format.use-share-safe=no
2056 > --config format.use-share-safe=no
2097
2057
2098 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2058 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2099 dirstate-v2: no
2059 dirstate-v2: no
2100 tracked-hint: yes
2060 tracked-hint: yes
2101 share-safe: no
2061 share-safe: no
2102
2062
2103 $ hg status -R auto-upgrade \
2063 $ hg status -R auto-upgrade \
2104 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2064 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2105 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2065 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2106 > --config format.use-dirstate-v2=yes \
2066 > --config format.use-dirstate-v2=yes \
2107 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2067 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2108 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2068 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2109 > --config format.use-dirstate-tracked-hint=no\
2069 > --config format.use-dirstate-tracked-hint=no\
2110 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2070 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2111 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2071 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2112 > --config format.use-share-safe=yes
2072 > --config format.use-share-safe=yes
2113 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2073 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2114 dirstate-v2: yes
2074 dirstate-v2: yes
2115 tracked-hint: no
2075 tracked-hint: no
2116 share-safe: yes
2076 share-safe: yes
2117
2077
2118 Attempting Auto-upgrade on a read-only repository
2078 Attempting Auto-upgrade on a read-only repository
2119 -------------------------------------------------
2079 -------------------------------------------------
2120
2080
2121 $ chmod -R a-w auto-upgrade
2081 $ chmod -R a-w auto-upgrade
2122
2082
2123 $ hg status -R auto-upgrade \
2083 $ hg status -R auto-upgrade \
2124 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2084 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2125 > --config format.use-dirstate-v2=no
2085 > --config format.use-dirstate-v2=no
2126 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2086 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2127 dirstate-v2: yes
2087 dirstate-v2: yes
2128
2088
2129 $ chmod -R u+w auto-upgrade
2089 $ chmod -R u+w auto-upgrade
2130
2090
2131 Attempting Auto-upgrade on a locked repository
2091 Attempting Auto-upgrade on a locked repository
2132 ----------------------------------------------
2092 ----------------------------------------------
2133
2093
2134 $ hg -R auto-upgrade debuglock --set-lock --quiet &
2094 $ hg -R auto-upgrade debuglock --set-lock --quiet &
2135 $ echo $! >> $DAEMON_PIDS
2095 $ echo $! >> $DAEMON_PIDS
2136 $ $RUNTESTDIR/testlib/wait-on-file 10 auto-upgrade/.hg/store/lock
2096 $ $RUNTESTDIR/testlib/wait-on-file 10 auto-upgrade/.hg/store/lock
2137 $ hg status -R auto-upgrade \
2097 $ hg status -R auto-upgrade \
2138 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2098 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2139 > --config format.use-dirstate-v2=no
2099 > --config format.use-dirstate-v2=no
2140 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2100 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2141 dirstate-v2: yes
2101 dirstate-v2: yes
2142
2102
2143 $ killdaemons.py
2103 $ killdaemons.py
@@ -1,364 +1,339
1 #require reporevlogstore
1 #require reporevlogstore
2
2
3 prepare repo
3 prepare repo
4
4
5 $ hg init a
5 $ hg init a
6 $ cd a
6 $ cd a
7 $ echo "some text" > FOO.txt
7 $ echo "some text" > FOO.txt
8 $ echo "another text" > bar.txt
8 $ echo "another text" > bar.txt
9 $ echo "more text" > QUICK.txt
9 $ echo "more text" > QUICK.txt
10 $ hg add
10 $ hg add
11 adding FOO.txt
11 adding FOO.txt
12 adding QUICK.txt
12 adding QUICK.txt
13 adding bar.txt
13 adding bar.txt
14 $ hg ci -mtest1
14 $ hg ci -mtest1
15
15
16 verify
16 verify
17
17
18 $ hg verify
18 $ hg verify
19 checking changesets
19 checking changesets
20 checking manifests
20 checking manifests
21 crosschecking files in changesets and manifests
21 crosschecking files in changesets and manifests
22 checking files
22 checking files
23 checked 1 changesets with 3 changes to 3 files
23 checked 1 changesets with 3 changes to 3 files
24
24
25 verify with journal
25 verify with journal
26
26
27 $ touch .hg/store/journal
27 $ touch .hg/store/journal
28 $ hg verify
28 $ hg verify
29 abandoned transaction found - run hg recover
29 abandoned transaction found - run hg recover
30 checking changesets
30 checking changesets
31 checking manifests
31 checking manifests
32 crosschecking files in changesets and manifests
32 crosschecking files in changesets and manifests
33 checking files
33 checking files
34 checked 1 changesets with 3 changes to 3 files
34 checked 1 changesets with 3 changes to 3 files
35 $ rm .hg/store/journal
35 $ rm .hg/store/journal
36
36
37 introduce some bugs in repo
37 introduce some bugs in repo
38
38
39 $ cd .hg/store/data
39 $ cd .hg/store/data
40 $ mv _f_o_o.txt.i X_f_o_o.txt.i
40 $ mv _f_o_o.txt.i X_f_o_o.txt.i
41 $ mv bar.txt.i xbar.txt.i
41 $ mv bar.txt.i xbar.txt.i
42 $ rm _q_u_i_c_k.txt.i
42 $ rm _q_u_i_c_k.txt.i
43
43
44 $ hg verify
44 $ hg verify
45 checking changesets
45 checking changesets
46 checking manifests
46 checking manifests
47 crosschecking files in changesets and manifests
47 crosschecking files in changesets and manifests
48 checking files
48 checking files
49 warning: revlog 'data/FOO.txt.i' not in fncache!
49 warning: revlog 'data/FOO.txt.i' not in fncache!
50 0: empty or missing FOO.txt
50 0: empty or missing FOO.txt
51 FOO.txt@0: manifest refers to unknown revision f62022d3d590
51 FOO.txt@0: manifest refers to unknown revision f62022d3d590
52 warning: revlog 'data/QUICK.txt.i' not in fncache!
52 warning: revlog 'data/QUICK.txt.i' not in fncache!
53 0: empty or missing QUICK.txt
53 0: empty or missing QUICK.txt
54 QUICK.txt@0: manifest refers to unknown revision 88b857db8eba
54 QUICK.txt@0: manifest refers to unknown revision 88b857db8eba
55 warning: revlog 'data/bar.txt.i' not in fncache!
55 warning: revlog 'data/bar.txt.i' not in fncache!
56 0: empty or missing bar.txt
56 0: empty or missing bar.txt
57 bar.txt@0: manifest refers to unknown revision 256559129457
57 bar.txt@0: manifest refers to unknown revision 256559129457
58 checked 1 changesets with 0 changes to 3 files
58 checked 1 changesets with 0 changes to 3 files
59 3 warnings encountered!
59 3 warnings encountered!
60 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
60 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
61 6 integrity errors encountered!
61 6 integrity errors encountered!
62 (first damaged changeset appears to be 0)
62 (first damaged changeset appears to be 0)
63 [1]
63 [1]
64
64
65 $ cd ../../..
65 $ cd ../../..
66 $ cd ..
66 $ cd ..
67
67
68 Set up a repo for testing missing revlog entries
68 Set up a repo for testing missing revlog entries
69
69
70 $ hg init missing-entries
70 $ hg init missing-entries
71 $ cd missing-entries
71 $ cd missing-entries
72 $ echo 0 > file
72 $ echo 0 > file
73 $ hg ci -Aqm0
73 $ hg ci -Aqm0
74 $ cp -R .hg/store .hg/store-partial
74 $ cp -R .hg/store .hg/store-partial
75 $ echo 1 > file
75 $ echo 1 > file
76 $ hg ci -Aqm1
76 $ hg ci -Aqm1
77 $ cp -R .hg/store .hg/store-full
77 $ cp -R .hg/store .hg/store-full
78
78
79 Entire changelog missing
79 Entire changelog missing
80
80
81 $ rm .hg/store/00changelog.*
81 $ rm .hg/store/00changelog.*
82 $ hg verify -q
82 $ hg verify -q
83 0: empty or missing changelog
83 0: empty or missing changelog
84 manifest@0: d0b6632564d4 not in changesets
84 manifest@0: d0b6632564d4 not in changesets
85 manifest@1: 941fc4534185 not in changesets
85 manifest@1: 941fc4534185 not in changesets
86 3 integrity errors encountered!
86 3 integrity errors encountered!
87 (first damaged changeset appears to be 0)
87 (first damaged changeset appears to be 0)
88 [1]
88 [1]
89 $ cp -R .hg/store-full/. .hg/store
89 $ cp -R .hg/store-full/. .hg/store
90
90
91 Entire manifest log missing
91 Entire manifest log missing
92
92
93 $ rm .hg/store/00manifest.*
93 $ rm .hg/store/00manifest.*
94 $ hg verify -q
94 $ hg verify -q
95 0: empty or missing manifest
95 0: empty or missing manifest
96 1 integrity errors encountered!
96 1 integrity errors encountered!
97 (first damaged changeset appears to be 0)
97 (first damaged changeset appears to be 0)
98 [1]
98 [1]
99 $ cp -R .hg/store-full/. .hg/store
99 $ cp -R .hg/store-full/. .hg/store
100
100
101 Entire filelog missing
101 Entire filelog missing
102
102
103 $ rm .hg/store/data/file.*
103 $ rm .hg/store/data/file.*
104 $ hg verify -q
104 $ hg verify -q
105 warning: revlog 'data/file.i' not in fncache!
105 warning: revlog 'data/file.i' not in fncache!
106 0: empty or missing file
106 0: empty or missing file
107 file@0: manifest refers to unknown revision 362fef284ce2
107 file@0: manifest refers to unknown revision 362fef284ce2
108 file@1: manifest refers to unknown revision c10f2164107d
108 file@1: manifest refers to unknown revision c10f2164107d
109 1 warnings encountered!
109 1 warnings encountered!
110 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
110 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
111 3 integrity errors encountered!
111 3 integrity errors encountered!
112 (first damaged changeset appears to be 0)
112 (first damaged changeset appears to be 0)
113 [1]
113 [1]
114 $ cp -R .hg/store-full/. .hg/store
114 $ cp -R .hg/store-full/. .hg/store
115
115
116 Entire changelog and manifest log missing
116 Entire changelog and manifest log missing
117
117
118 $ rm .hg/store/00changelog.*
118 $ rm .hg/store/00changelog.*
119 $ rm .hg/store/00manifest.*
119 $ rm .hg/store/00manifest.*
120 $ hg verify -q
120 $ hg verify -q
121 warning: orphan data file 'data/file.i'
121 warning: orphan data file 'data/file.i'
122 1 warnings encountered!
122 1 warnings encountered!
123 $ cp -R .hg/store-full/. .hg/store
123 $ cp -R .hg/store-full/. .hg/store
124
124
125 Entire changelog and filelog missing
125 Entire changelog and filelog missing
126
126
127 $ rm .hg/store/00changelog.*
127 $ rm .hg/store/00changelog.*
128 $ rm .hg/store/data/file.*
128 $ rm .hg/store/data/file.*
129 $ hg verify -q
129 $ hg verify -q
130 0: empty or missing changelog
130 0: empty or missing changelog
131 manifest@0: d0b6632564d4 not in changesets
131 manifest@0: d0b6632564d4 not in changesets
132 manifest@1: 941fc4534185 not in changesets
132 manifest@1: 941fc4534185 not in changesets
133 warning: revlog 'data/file.i' not in fncache!
133 warning: revlog 'data/file.i' not in fncache!
134 ?: empty or missing file
134 ?: empty or missing file
135 file@0: manifest refers to unknown revision 362fef284ce2
135 file@0: manifest refers to unknown revision 362fef284ce2
136 file@1: manifest refers to unknown revision c10f2164107d
136 file@1: manifest refers to unknown revision c10f2164107d
137 1 warnings encountered!
137 1 warnings encountered!
138 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
138 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
139 6 integrity errors encountered!
139 6 integrity errors encountered!
140 (first damaged changeset appears to be 0)
140 (first damaged changeset appears to be 0)
141 [1]
141 [1]
142 $ cp -R .hg/store-full/. .hg/store
142 $ cp -R .hg/store-full/. .hg/store
143
143
144 Entire manifest log and filelog missing
144 Entire manifest log and filelog missing
145
145
146 $ rm .hg/store/00manifest.*
146 $ rm .hg/store/00manifest.*
147 $ rm .hg/store/data/file.*
147 $ rm .hg/store/data/file.*
148 $ hg verify -q
148 $ hg verify -q
149 0: empty or missing manifest
149 0: empty or missing manifest
150 warning: revlog 'data/file.i' not in fncache!
150 warning: revlog 'data/file.i' not in fncache!
151 0: empty or missing file
151 0: empty or missing file
152 1 warnings encountered!
152 1 warnings encountered!
153 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
153 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
154 2 integrity errors encountered!
154 2 integrity errors encountered!
155 (first damaged changeset appears to be 0)
155 (first damaged changeset appears to be 0)
156 [1]
156 [1]
157 $ cp -R .hg/store-full/. .hg/store
157 $ cp -R .hg/store-full/. .hg/store
158
158
159 Changelog missing entry
159 Changelog missing entry
160
160
161 $ cp -f .hg/store-partial/00changelog.* .hg/store
161 $ cp -f .hg/store-partial/00changelog.* .hg/store
162 $ hg verify -q
162 $ hg verify -q
163 manifest@?: rev 1 points to nonexistent changeset 1
163 manifest@?: rev 1 points to nonexistent changeset 1
164 manifest@?: 941fc4534185 not in changesets
164 manifest@?: 941fc4534185 not in changesets
165 file@?: rev 1 points to nonexistent changeset 1
165 file@?: rev 1 points to nonexistent changeset 1
166 (expected 0)
166 (expected 0)
167 1 warnings encountered!
167 1 warnings encountered!
168 3 integrity errors encountered!
168 3 integrity errors encountered!
169 [1]
169 [1]
170 $ cp -R .hg/store-full/. .hg/store
170 $ cp -R .hg/store-full/. .hg/store
171
171
172 Manifest log missing entry
172 Manifest log missing entry
173
173
174 $ cp -f .hg/store-partial/00manifest.* .hg/store
174 $ cp -f .hg/store-partial/00manifest.* .hg/store
175 $ hg verify -q
175 $ hg verify -q
176 manifest@1: changeset refers to unknown revision 941fc4534185
176 manifest@1: changeset refers to unknown revision 941fc4534185
177 file@1: c10f2164107d not in manifests
177 file@1: c10f2164107d not in manifests
178 2 integrity errors encountered!
178 2 integrity errors encountered!
179 (first damaged changeset appears to be 1)
179 (first damaged changeset appears to be 1)
180 [1]
180 [1]
181 $ cp -R .hg/store-full/. .hg/store
181 $ cp -R .hg/store-full/. .hg/store
182
182
183 Filelog missing entry
183 Filelog missing entry
184
184
185 $ cp -f .hg/store-partial/data/file.* .hg/store/data
185 $ cp -f .hg/store-partial/data/file.* .hg/store/data
186 $ hg verify -q
186 $ hg verify -q
187 file@1: manifest refers to unknown revision c10f2164107d
187 file@1: manifest refers to unknown revision c10f2164107d
188 1 integrity errors encountered!
188 1 integrity errors encountered!
189 (first damaged changeset appears to be 1)
189 (first damaged changeset appears to be 1)
190 [1]
190 [1]
191 $ cp -R .hg/store-full/. .hg/store
191 $ cp -R .hg/store-full/. .hg/store
192
192
193 Changelog and manifest log missing entry
193 Changelog and manifest log missing entry
194
194
195 $ cp -f .hg/store-partial/00changelog.* .hg/store
195 $ cp -f .hg/store-partial/00changelog.* .hg/store
196 $ cp -f .hg/store-partial/00manifest.* .hg/store
196 $ cp -f .hg/store-partial/00manifest.* .hg/store
197 $ hg verify -q
197 $ hg verify -q
198 file@?: rev 1 points to nonexistent changeset 1
198 file@?: rev 1 points to nonexistent changeset 1
199 (expected 0)
199 (expected 0)
200 file@?: c10f2164107d not in manifests
200 file@?: c10f2164107d not in manifests
201 1 warnings encountered!
201 1 warnings encountered!
202 2 integrity errors encountered!
202 2 integrity errors encountered!
203 [1]
203 [1]
204 $ cp -R .hg/store-full/. .hg/store
204 $ cp -R .hg/store-full/. .hg/store
205
205
206 Changelog and filelog missing entry
206 Changelog and filelog missing entry
207
207
208 $ cp -f .hg/store-partial/00changelog.* .hg/store
208 $ cp -f .hg/store-partial/00changelog.* .hg/store
209 $ cp -f .hg/store-partial/data/file.* .hg/store/data
209 $ cp -f .hg/store-partial/data/file.* .hg/store/data
210 $ hg verify -q
210 $ hg verify -q
211 manifest@?: rev 1 points to nonexistent changeset 1
211 manifest@?: rev 1 points to nonexistent changeset 1
212 manifest@?: 941fc4534185 not in changesets
212 manifest@?: 941fc4534185 not in changesets
213 file@?: manifest refers to unknown revision c10f2164107d
213 file@?: manifest refers to unknown revision c10f2164107d
214 3 integrity errors encountered!
214 3 integrity errors encountered!
215 [1]
215 [1]
216 $ cp -R .hg/store-full/. .hg/store
216 $ cp -R .hg/store-full/. .hg/store
217
217
218 Manifest and filelog missing entry
218 Manifest and filelog missing entry
219
219
220 $ cp -f .hg/store-partial/00manifest.* .hg/store
220 $ cp -f .hg/store-partial/00manifest.* .hg/store
221 $ cp -f .hg/store-partial/data/file.* .hg/store/data
221 $ cp -f .hg/store-partial/data/file.* .hg/store/data
222 $ hg verify -q
222 $ hg verify -q
223 manifest@1: changeset refers to unknown revision 941fc4534185
223 manifest@1: changeset refers to unknown revision 941fc4534185
224 1 integrity errors encountered!
224 1 integrity errors encountered!
225 (first damaged changeset appears to be 1)
225 (first damaged changeset appears to be 1)
226 [1]
226 [1]
227 $ cp -R .hg/store-full/. .hg/store
227 $ cp -R .hg/store-full/. .hg/store
228
228
229 Corrupt changelog base node to cause failure to read revision
229 Corrupt changelog base node to cause failure to read revision
230
230
231 $ printf abcd | dd conv=notrunc of=.hg/store/00changelog.i bs=1 seek=16 \
231 $ printf abcd | dd conv=notrunc of=.hg/store/00changelog.i bs=1 seek=16 \
232 > 2> /dev/null
232 > 2> /dev/null
233 $ hg verify -q
233 $ hg verify -q
234 0: unpacking changeset 08b1860757c2: * (glob)
234 0: unpacking changeset 08b1860757c2: * (glob)
235 manifest@?: rev 0 points to unexpected changeset 0
235 manifest@?: rev 0 points to unexpected changeset 0
236 manifest@?: d0b6632564d4 not in changesets
236 manifest@?: d0b6632564d4 not in changesets
237 file@?: rev 0 points to unexpected changeset 0
237 file@?: rev 0 points to unexpected changeset 0
238 (expected 1)
238 (expected 1)
239 1 warnings encountered!
239 1 warnings encountered!
240 4 integrity errors encountered!
240 4 integrity errors encountered!
241 (first damaged changeset appears to be 0)
241 (first damaged changeset appears to be 0)
242 [1]
242 [1]
243 $ cp -R .hg/store-full/. .hg/store
243 $ cp -R .hg/store-full/. .hg/store
244
244
245 Corrupt manifest log base node to cause failure to read revision
245 Corrupt manifest log base node to cause failure to read revision
246
246
247 $ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \
247 $ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \
248 > 2> /dev/null
248 > 2> /dev/null
249 $ hg verify -q
249 $ hg verify -q
250 manifest@0: reading delta d0b6632564d4: * (glob)
250 manifest@0: reading delta d0b6632564d4: * (glob)
251 file@0: 362fef284ce2 not in manifests
251 file@0: 362fef284ce2 not in manifests
252 2 integrity errors encountered!
252 2 integrity errors encountered!
253 (first damaged changeset appears to be 0)
253 (first damaged changeset appears to be 0)
254 [1]
254 [1]
255 $ cp -R .hg/store-full/. .hg/store
255 $ cp -R .hg/store-full/. .hg/store
256
256
257 Corrupt filelog base node to cause failure to read revision
257 Corrupt filelog base node to cause failure to read revision
258
258
259 $ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \
259 $ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \
260 > 2> /dev/null
260 > 2> /dev/null
261 $ hg verify -q
261 $ hg verify -q
262 file@0: unpacking 362fef284ce2: * (glob)
262 file@0: unpacking 362fef284ce2: * (glob)
263 1 integrity errors encountered!
263 1 integrity errors encountered!
264 (first damaged changeset appears to be 0)
264 (first damaged changeset appears to be 0)
265 [1]
265 [1]
266 $ cp -R .hg/store-full/. .hg/store
266 $ cp -R .hg/store-full/. .hg/store
267
267
268 $ cd ..
268 $ cd ..
269
269
270 test changelog without a manifest
270 test changelog without a manifest
271
271
272 $ hg init b
272 $ hg init b
273 $ cd b
273 $ cd b
274 $ hg branch foo
274 $ hg branch foo
275 marked working directory as branch foo
275 marked working directory as branch foo
276 (branches are permanent and global, did you want a bookmark?)
276 (branches are permanent and global, did you want a bookmark?)
277 $ hg ci -m branchfoo
277 $ hg ci -m branchfoo
278 $ hg verify
278 $ hg verify -q
279 checking changesets
280 checking manifests
281 crosschecking files in changesets and manifests
282 checking files
283 checked 1 changesets with 0 changes to 0 files
284
279
285 test revlog corruption
280 test revlog corruption
286
281
287 $ touch a
282 $ touch a
288 $ hg add a
283 $ hg add a
289 $ hg ci -m a
284 $ hg ci -m a
290
285
291 $ echo 'corrupted' > b
286 $ echo 'corrupted' > b
292 $ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
287 $ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
293 $ cat start b > .hg/store/data/a.i
288 $ cat start b > .hg/store/data/a.i
294
289
295 $ hg verify
290 $ hg verify -q
296 checking changesets
297 checking manifests
298 crosschecking files in changesets and manifests
299 checking files
300 a@1: broken revlog! (index a is corrupted)
291 a@1: broken revlog! (index a is corrupted)
301 warning: orphan data file 'data/a.i'
292 warning: orphan data file 'data/a.i'
302 checked 2 changesets with 0 changes to 1 files
303 1 warnings encountered!
293 1 warnings encountered!
304 1 integrity errors encountered!
294 1 integrity errors encountered!
305 (first damaged changeset appears to be 1)
295 (first damaged changeset appears to be 1)
306 [1]
296 [1]
307
297
308 $ cd ..
298 $ cd ..
309
299
310 test revlog format 0
300 test revlog format 0
311
301
312 $ revlog-formatv0.py
302 $ revlog-formatv0.py
313 $ cd formatv0
303 $ cd formatv0
314 $ hg verify
304 $ hg verify
315 repository uses revlog format 0
305 repository uses revlog format 0
316 checking changesets
306 checking changesets
317 checking manifests
307 checking manifests
318 crosschecking files in changesets and manifests
308 crosschecking files in changesets and manifests
319 checking files
309 checking files
320 checked 1 changesets with 1 changes to 1 files
310 checked 1 changesets with 1 changes to 1 files
321 $ cd ..
311 $ cd ..
322
312
323 test flag processor and skipflags
313 test flag processor and skipflags
324
314
325 $ hg init skipflags
315 $ hg init skipflags
326 $ cd skipflags
316 $ cd skipflags
327 $ cat >> .hg/hgrc <<EOF
317 $ cat >> .hg/hgrc <<EOF
328 > [extensions]
318 > [extensions]
329 > flagprocessor=$RUNTESTDIR/flagprocessorext.py
319 > flagprocessor=$RUNTESTDIR/flagprocessorext.py
330 > EOF
320 > EOF
331 $ echo '[BASE64]content' > base64
321 $ echo '[BASE64]content' > base64
332 $ hg commit -Aqm 'flag processor content' base64
322 $ hg commit -Aqm 'flag processor content' base64
333 $ hg verify
323 $ hg verify -q
334 checking changesets
335 checking manifests
336 crosschecking files in changesets and manifests
337 checking files
338 checked 1 changesets with 1 changes to 1 files
339
324
340 $ cat >> $TESTTMP/break-base64.py <<EOF
325 $ cat >> $TESTTMP/break-base64.py <<EOF
341 > import base64
326 > import base64
342 > base64.b64decode=lambda x: x
327 > base64.b64decode=lambda x: x
343 > EOF
328 > EOF
344 $ cat >> .hg/hgrc <<EOF
329 $ cat >> .hg/hgrc <<EOF
345 > breakbase64=$TESTTMP/break-base64.py
330 > breakbase64=$TESTTMP/break-base64.py
346 > EOF
331 > EOF
347
332
348 $ hg verify
333 $ hg verify -q
349 checking changesets
350 checking manifests
351 crosschecking files in changesets and manifests
352 checking files
353 base64@0: unpacking 794cee7777cb: integrity check failed on base64:0
334 base64@0: unpacking 794cee7777cb: integrity check failed on base64:0
354 checked 1 changesets with 1 changes to 1 files
355 1 integrity errors encountered!
335 1 integrity errors encountered!
356 (first damaged changeset appears to be 0)
336 (first damaged changeset appears to be 0)
357 [1]
337 [1]
358 $ hg verify --config verify.skipflags=2147483647
338 $ hg verify --config verify.skipflags=2147483647 -q
359 checking changesets
360 checking manifests
361 crosschecking files in changesets and manifests
362 checking files
363 checked 1 changesets with 1 changes to 1 files
364
339
General Comments 0
You need to be logged in to leave comments. Login now